[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

problems with nics and multiple ips



Hi all,

  Yesterday I had a problem with a server and adding/removing ips to a nic.

I have two servers and I had to switch their ips remotely. To do that then I decided to add two extra ips to each server, then stop the "interface" with ip that I had to switch and then leave just one ip in each server. What I did is the following:

1.- Edit the /etc/network/interfaces of each server and add the second ip:

# The loopback interface
# automatically added when upgrading
auto lo eth0
iface lo inet loopback

iface eth0 inet static
        address 192.168.10.3
        netmask 255.255.255.0
        gateway 192.168.10.1

#added part
auto eth0:0
iface eth0:0 inet static
        address 192.168.10.4
        netmask 255.255.255.0
        gateway 192.168.10.1



2.- then I did ifup eth0:0 and everything goes ok, The problem is when I want to stop the primary ip. I wasn't able to do it. With "ifdown eth0" I stopped the whole interface and I had to call somebody to go there an do an ifup eth0.

I tried to modify again the interfaces file and try with /etc/init.d/network restart, even modify the file and: ifdown eth0; /etc/init.d/network restart; ifup eth0. Nothing worked, finally what I did was modify the interfaces and restart the server. I think there should be a better way to do this, do you know how?

Cheers!
--
Arnau



Reply to: