CENTOS7 Dual network card telecom, Unicom dual-pass configuration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.