1, realize: Through the operator to provide intelligent DNS, the Telecommunications users access, data into the telecommunications network card, out of the gateway also from the telecommunications, access to China Unicom, from the Unicom network card, Unicom card out. This speed will be faster, the implementation of dual-line host functions.
2, network card information (configure two network card information needs to comment out a gateway, otherwise the network will be interrupted):
Telco IP (TEL): 1.82.236.21 netmask 255.255.255.240 Gateway 1.82.236.17 (EM4)
Unicom IP (CNC): 113.200.100.231 netmask 255.255.255.240 Gateway 113.200.100.225 (EM1)
3, Vi/etc/iproute2/rt_tables, increase netcom and telecom two routing table
251 Tel Telecom Routing table
252 CNC Network access by table
4, set up the routing table of the Telecommunications (command line execution directly)
ip route flush table tel#清空路由表
ip route add default 1.82.236.17 dev em4 src 1.82.236.21 table tel
ip rule add from 1.82.236.21 table tel
5, set up the routing table of Unicom
ip route flush table cnc
ip route add default via 113.200.100.225 dev em1 src 113.200.100.231 table cnc
ip rule add from 113.200.100.231 table cnc
6. Configure the network startup script file to add the following before the end of exit 0:
# vi /etc/rc.d/init.d/network
ip route flush table telip route add default 1.82.236.17 dev em4 src 1.82.236.21 table tel ip rule add from 1.82.236.21 table telip route flush table cnc ip route add default via 113.200.100.225 dev em1 src 113.200.100.231 table cnc ip rule add from 113.200.100.231 table cncexit 0
7. Restart the system or the network may fail, please join the startup script:
If it is Ubuntu/debian, the system startup script is/etc/rc.local
If it is Redhat/centos, the system startup script is/etc/rc.d/rc.local
If it is Ubuntu/debian, the network boot script is/etc/init.d/networking
If it is redhat/centos, the network boot script is/etc/rc.d/init.d/network
CENTOS7 Dual network card telecom, Unicom dual-pass configuration