Re: ip virtuales
El vie, 20-07-2007 a las 01:44 -0500, José Alfredo Andaluz Prado
escribió:
> la pregunta seria por que no funciona al hacerlo manualmente en el
> interfaces ?
Bien, llegamos a un acuerdo, el kernel de debian SI lo soporta :)
Veamos, dado un host:
[root][random]:~ # cat /etc/network/interfaces
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
[root][random]:~ # ifconfig
eth0 Link encap:Ethernet HWaddr 00:19:D1:1C:29:94
inet addr:192.168.1.52 Bcast:192.168.1.255
Mask:255.255.255.0
inet6 addr: fe80::219:d1ff:fe1c:2994/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2394 errors:0 dropped:0 overruns:0 frame:0
TX packets:2507 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1739474 (1.6 MiB) TX bytes:277723 (271.2 KiB)
Base address:0x20c0 Memory:90400000-90420000
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:16436 Metric:1
RX packets:43 errors:0 dropped:0 overruns:0 frame:0
TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5088 (4.9 KiB) TX bytes:5088 (4.9 KiB)
Le añadimos una interfaz virtual:
[root][random]:~ # echo "" >> /etc/network/interfaces
[root][random]:~ # echo "auto eth0:0" >> /etc/network/interfaces
[root][random]:~ # echo "iface eth0:0 inet static" \
>> /etc/network/interfaces
[root][random]:~ # echo "address 192.168.1.36" \
>> /etc/network/interfaces
[root][random]:~ # echo "netmask 255.255.255.0" \
>> /etc/network/interfaces
[root][random]:~ # echo "gateway 192.168.1.1" \
>> /etc/network/interfaces
Nos queda tal que así:
[root][random]:~ # cat /etc/network/interfaces
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
auto eth0:0
iface eth0:0 inet static
address 192.168.1.36
netmask 255.255.255.0
gateway 192.168.1.1
Y levantamos la interfaz ¡voilá!:
[root][random]:~ # ifup eth0:0
[root][random]:~ # ifconfig
eth0 Link encap:Ethernet HWaddr 00:19:D1:1C:29:94
inet addr:192.168.1.52 Bcast:192.168.1.255
Mask:255.255.255.0
inet6 addr: fe80::219:d1ff:fe1c:2994/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2399 errors:0 dropped:0 overruns:0 frame:0
TX packets:2512 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:1739800 (1.6 MiB) TX bytes:278043 (271.5 KiB)
Base address:0x20c0 Memory:90400000-90420000
eth0:0 Link encap:Ethernet HWaddr 00:19:D1:1C:29:94
inet addr:192.168.1.36 Bcast:192.168.1.255
Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Base address:0x20c0 Memory:90400000-90420000
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:16436 Metric:1
RX packets:43 errors:0 dropped:0 overruns:0 frame:0
TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5088 (4.9 KiB) TX bytes:5088 (4.9 KiB)
¿Quizás te está dando guerra declarar el network y el broadcast?
Saludos
Reply to: