lundi 16 avril 2007, par JKlr
/etc/network/interfaces
Une seulle interface eth0 en mode DHCP :
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcpPlusieures interfaces, dont des alias en IP fixes, et des options de commandes UP, DOWN et PRE-UP :
# The loopback network interface
auto lo eth0 eth1 eth2 eth3 eth1:1 eth2:1
iface lo inet loopback
# The primary network interface
iface eth0 inet static
address 10.0.0.5
netmask 255.255.255.0
broadcast 10.0.0.255
network 10.0.0.0
gateway 10.0.0.10
pre-up iptables-restore < /etc/iptables.up.rules
iface eth1 inet static
address 192.168.224.5
netmask 255.255.255.0
broadcast 192.168.224.255
network 192.168.224.0
up route add -net 172.24.0.0 netmask 255.255.0.0 gw 192.168.224.18 metric 1
down route del -net 172.24.0.0 netmask 255.255.0.0 gw 192.168.224.18 metric 1
up route add -net 192.168.193.0 netmask 255.255.255.0 gw 192.168.224.18 metric 1
down route del -net 192.168.193.0 netmask 255.255.255.0 gw 192.168.224.18 metric 1
up route add -net 192.168.194.0 netmask 255.255.255.0 gw 192.168.224.18 metric 1
down route del -net 192.168.194.0 netmask 255.255.255.0 gw 192.168.224.18 metric 1
iface eth2 inet static
address 192.168.225.5
netmask 255.255.255.0
broadcast 192.168.225.255
network 192.168.225.0
iface eth3 inet static
address 192.168.226.5
netmask 255.255.255.0
broadcast 192.168.226.255
network 192.168.226.0
iface eth1:1 inet static
address 192.168.224.226
netmask 255.255.255.0
broadcast 192.168.224.255
network 192.168.224.0
iface eth2:1 inet static
address 192.168.255.5
netmask 255.255.255.0
broadcast 192.168.255.255
network 192.168.255.0