CentOS dual-NIC dual IP Settings system environment: Centos linux network environment: two IP addresses, 10.4.34.31 and 10.4.35.31, the mask is 255.255.255.0, and the gateway addresses of these two subnets are 10.4.34.1 and 10.4.35.1 respectively. 1. Configure the IP address 10.4.34.31 for the NIC eth0, configure the IP address for the NIC eth1 with the 10.4.35.31 profile as:/etc/sysconfig/network-scripts/ifcfg-eth0/ etc/sysconfig/network-scripts/ifcfg-eth1 2. Configure the default gateway to any one. This default gateway determines the interface that the system uses when it actively uses the network. Configuration file:/etc/sysconfig/network 3. Edit route table A, modify/etc/iproute2/rt_tables, add content:252 net2251 net3b, modify/etc/rc.local, add the original path return route:ip route flush table net2ip route add Default via 10.4.34.1 dev eth0 src 10.4.34.31 table net2ip rule add from 10.4.34.31 table net2ip route flush table net3ip Route add default via 10.4.35.1 dev eth1 src 10.4.35.31 table net3ip rule add from 10.4.35.31 table net3 Reference: Http://www.lartc.org/LARTC-zh _cn.gb2312.pdf
Linux configuration Dual-Nic dual-route