Configuration of dual NICs in Ubuntu

Source: Internet
Author: User
Environment: for Ubuntu, assume that the Intranet IP address is 10.35.0.58, the Intranet gateway is 10.35.0.254, the Internet IP address is 222.76.250.4, and the Internet gateway is 222.76.250.1. the LAN must be connected to 10.35.0.X, 10.35.51.X, and 10.35.60.X. 1. when the server is configured as an Internet IP address and an Intranet IP address, only the gateway of the Internet IP address is set. Do not set the gateway of the Intranet IP address. the operation is as follows: sudo

Environment: Ubuntu System

Assume that the Intranet IP address is 10.35.0.58, the Intranet gateway is 10.35.0.254, the Internet IP address is listen, and the Internet gateway is 222.76.250.1. The lan must be connected to 10.35.0.X, 10.35.51.X, and 10.35.60.X.

1. When the server is configured as an Internet IP address and an Intranet IP address, only the gateway of the Internet IP address is set. Do not set the gateway of the Intranet IP address.

The procedure is as follows:

Sudo nano/etc/network/interfaces

Run the following command to open the network configuration file:

Auto eth0

Iface eth0 inet static

Address 10.35.0.58

Netmask 255.255.255.0

Iface eth1 inet static

Address 222.76.250.4

Netmask has been released successfully

Gateway 222.76.250.1

Auto eth1

Note:

We didn't set gateway for eth0 (internal network). After the modification is complete, we use Ctrl + O to save the modification, and then press Ctrl + X to exit the editor.

2. At this time, we restart the network. The command for restarting the network of Ubuntu is:

Sudo/etc/init. d/networking restart

3. Because no intranet gateway is set, we cannot connect to the server using tools such as SecureCRT. To solve this problem, we need to set the server route as follows:

Sudo route add-net 10.35.0.0/24 gw 10.35.0.254 dev eth0

Sudo route add-net 10.35.51.0/24 gw 10.35.0.254 dev eth0

Sudo route add-net 10.35.60.0/24 gw 10.35.0.254 dev eth0

The preceding commands are 10.35.0.X, 10.35.51.X, and 10.35.60.X respectively. If the Internet cannot be connected, try:

Sudo route add default gw 222.76.250.4 dev eth1

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.