Pages

Monday, 8 April 2013

Linux - Beberapa NIC Dalam Satu Subnet Yang Sama

Pernah tak jadi bila kita letak beberapa NIC dalam server yang sama dan setiap NIC akan guna segmen yang sama juga?

Sebagai contoh :-

192.168.10.1192.168.10.2192.168.10.3192.168.10.4
eth0255.255.255.0
eth1255.255.255.0
eth2255.255.255.0
eth3255.255.255.0

/proc/sys/net/ipv4/conf/(eth0 || eth1)/arp_filter change the value to a 1 instead of 0.

ip route del default

route add default gw 192.168.1.1 dev eth1
route add default gw 192.168.1.1 dev eth0

ip route add 192.168.1.0/24 dev eth0 table 2
ip route add 0/0 via 192.168.1.1 dev eth0 table 2
ip rule add from 192.168.1.123 table 2
ip rule add to 192.168.1.123 table 2

ip route add 192.168.1.0/24 dev eth1 table 3
ip route add 0/0 via 192.168.1.1 dev eth1 table 3
ip rule add from 192.168.1.121 table 3
ip rule add to 192.168.1.121 table 3

echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_filter
echo 1 > /proc/sys/net/ipv4/conf/eth1/arp_filter

No comments:

Post a Comment