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

Problemas asignando / desasignando múltiples IPs a una tarjeta de red



Hola a todos,

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

Ayer tuve un problema con un servidor añadiendo/eliminado ips a una tarjeta de red.

Tengo dos servidores y tenía que intercambiar sus ips remotamente. Para hacerlo decidí añadir una ip extra a cada servidor, después parar el interface con la ip que tenía que intercambiar i dejar sólo una ip en cada servidor. Los pasos que seguí fueron:

1.- Editar el fichero /etc/network/interfaces de cada servidor y añadir la segunda 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.

2.- Después hice ifup eth0:0 i todo funcionó correctamente. El problema fue que cuando quise parar la ip primaria, no fui capaz. Hice "ifdown eth0" y toda la tarjeta de red se paró... tuve que pedir a alguien que fuera allí e hiciese un ifup eth0.

Intenté modificar otra vez el fichero interfaces y hacer /etc/init.d/network restart, incluso modificar el archivo y hacer: ifdown eth0; /etc/init.d/network restart; ifup eth0. Nada de esto funció, a final lo que hice fue modificar el fichero interfaces y reiniciar el servidor. Creo que debería haber una forma mejor que no simplemente tenere que reinciar el servidor ¿Sabéís cómo lo tendría que hacer?

Saludos
--
Arnau



Reply to: