UbuntuServer10.10 server: China Telecom, China Unicom dual-line access, and Intranet three-line access

Source: Internet
Author: User
Tags ibm server
The server environment is as follows: IBM server, a total of 4 NICs; Operating System: Ubuntu-10.10-server access Intranet, telecommunications and Unicom IP, the information is as follows: 168.168.168.96 Telecommunications (TEL) IP: 125.91.219.252; subnet Mask: 255.255.255.248; Gateway: 125.91.219.249 Unicom (CNC) IP: 120.81.225

The server environment is as follows:

IBM server, with a total of 4 NICs;

Operating System: Ubuntu-10.10-server

The IP address used to connect to the Intranet, telecom, and China Unicom. The information is as follows:

Intranet: 168.168.168.96

China Telecom (TEL) IP: 125.91.219.252; subnet mask: 255.255.255.248; Gateway: 125.91.219.249

China Unicom (CNC) IP: 120.81.225.31; subnet mask: 255.255.255.0; Gateway: 120.81.225.1

The procedure is as follows:

1. Configure Nic Information

Run the sudo vim/etc/network/interfaces command to modify the configuration as follows:

Auto lo

Iface loinet loopback

Auto eth0

Ifaceeth0 inet static

Address 168.168.168.96

Netmask 255.255.255.0

Ifaceeth1 inet static

Address 120.81.225.31

Netmask 255.255.255.0

Auto eth1

Ifaceeth2 inet static

Address 125.91.219.252

Netmask 255.255.255.248

Gateway 125.91.219.249

Auto eth2

Save configuration information and enable the network card

Sudo/etc/init. d/networking restart

2. Added route tables for China Telecom tel and China Unicom cnc

First, check the route table information.

Cat/etc/iproute2/rt_tables

Some routing information is displayed in it. Add the following two sentences after it to save and exit.

252 tel

251 cnc

3. Add routing rules and run the following six commands. The first three commands are to set up the telecom gateway so that the telecom data can be transmitted from the eth2 Nic, and the last three are to set the UNICOM gateway, let the data go from eth1

Sudo ip route flush table tel

Sudo ip route add default via 125.91.219.249 dev eth2 src125.91.219.252 table tel

Sudo ip rule add from 125.91.219.252 table tel

Sudo ip route flush table cnc

Sudo ip route add default via 120.81.225.1 dev eth1 src120.81.225.31 table cnc

Sudo ip rule add from 120.81.225.31 table cnc

4. Run the command sudo vim/etc/init. d/networking to add the following content before exit 0, which is the routing rule just added.

Ip route flush table tel

Ip route add default via 125.91.219.249 dev eth2 src125.91.219.252 table tel

Ip rule add from 125.91.219.252 table tel

Ip route flush table cnc

Ip route add default via 120.81.225.1 dev eth1 src120.81.225.31 table cnc

Ip rule add from 120.81.225.31 table cnc

5. Restart the network to run sudo/etc/init. d/networkingrestart.

By now, the network is pinged by a friend of China Telecom and China Unicom to check whether the network is normal. Another point is that dual-line access is a WEB service, but China Telecom has disabled port 80. You have to call China Telecom to apply for port 80.

6. Write the system startup script and run the command sudovim/etc/rc. local to write the routing Rule Information in Step 4 to the startup script.

Related Article

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.