0

I am trying to setup virtual ip for ucarp. But after configuration something strange happens with ifup ifdown as try to view the configurations. I change /etc/network/interfaces like

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# The primary network interface
auto enp0s3
iface enp0s3 inet static
address 10.1.178.153
netmask 255.255.255.0
gateway 10.1.178.1
dns-nameservers 10.1.171.200

  #######################
  # ucarp configuration
  #######################
  # vid : The ID of the virtual server [1-255]
  ucarp-vid 1
  # vip : The virtual address
  ucarp-vip 10.1.178.150
  # password : A password used to encrypt Carp communications
  ucarp-password secret
  # advskew : Advertisement skew [1-255]
  ucarp-advskew 100
  # advbase : Interval in seconds that advertisements will occur
  ucarp-advbase 1
  # master : determine if this server is the master

# The carp network interface, on top of enp0s3
iface enp0s3:ucarp inet static
        address 10.1.178.150
        netmask 255.255.255.0
        gateway 10.1.178.1
        dns-nameservers 10.1.171.200

Below is the output from terminal proceedings after that

$ sudo service networking restart
$ ifconfig
enp0s3    Link encap:Ethernet  HWaddr 08:00:27:c6:9b:54  
          inet addr:10.1.178.153  Bcast:10.1.178.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fec6:9b54/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2826136 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1271544 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:320630219 (320.6 MB)  TX bytes:94783376 (94.7 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:37307 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37307 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3039725 (3.0 MB)  TX bytes:3039725 (3.0 MB)

I try to take enp0s3 down so that enp0s3:ucarp can be taken up, but there is a surprise#1

$ sudo ifdown enp0s3
RTNETLINK answers: No such process
$ ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:37358 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37358 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3042933 (3.0 MB)  TX bytes:3042933 (3.0 MB)

Okay, now that enp0s3 does not show up I try to bring enp0s3:ucarp up. But here comes surprise#2

$ sudo ifup enp0s3:ucarp
RTNETLINK answers: File exists
run-parts: /etc/network/if-up.d/avahi-autoipd exited with return code 2
Failed to bring up enp0s3:ucarp.
$ ifconfig
enp0s3    Link encap:Ethernet  HWaddr 08:00:27:c6:9b:54  
          inet6 addr: fe80::a00:27ff:fec6:9b54/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2826298 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1271688 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:320646091 (320.6 MB)  TX bytes:94802033 (94.8 MB)

enp0s3:ucarp Link encap:Ethernet  HWaddr 08:00:27:c6:9b:54  
          inet addr:10.1.178.150  Bcast:10.1.178.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:37376 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37376 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3044101 (3.0 MB)  TX bytes:3044101 (3.0 MB)

Not able to understand; not able to configure ucarp; Request someone to help get me some inner-peace with this !!

  • Does ifconfig display active network configuration/all network configuration regardless of up/down ?
  • How is making a virtual adress up resulting in primary interface being up as well ?

1 Answer 1

0

Nevermind, an update to Ubuntu 15.10 seems to have solved the problem. Additionally, learnt to cross-verify every operation against /run/network/ifstate as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.