How to configure dual NICs in Ubuntu

Source: Internet
Author: User
The company's DELLR610 server has two NICs, one connected to the Intranet, the Development Department for testing, now there is a need to connect to the dual Nic, the other to connect to the Internet IP address; after the Internet IP address is assigned, the Internet IP address cannot be pinged all the time; the IP address can be connected to the laptop without any problem. The solution is as follows: in the Linux environment: Ubuntu14.04.1, the system's intranet IP address is 192.168.4.213, and the Intranet Gateway: 192.168.4.1, the Internet IP address is 58.200.

The company's DELL R610 server has two NICs, one connected to the Intranet, the Development Department for testing, now there is a need to connect to the dual Nic, the other to connect to the Internet IP address; after the Internet IP address is assigned, the Internet IP address cannot be pinged all the time; the IP address can be connected to the laptop without any problem.

The solution is as follows:

Linux: Ubuntu 14.04.1

Intranet IP: 192.168.4.213, Intranet Gateway: 192.168.4.1

Internet IP: 58.200.200.15 subnet mask: 255.255.255.128 Gateway: 58.200.200.1

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:

Vi/etc/network/interfaces:
Auto eth0
Iface eth0 inet static
Address 192.168.4.213
Netmask 255.255.255.0
 
Auto eth1
Iface eth1 inet static
Address 58.200.200.15
Netmask 255.255.255.255.128
Gateway 58.200.200.1

Note: We have not set a gateway for eth0 (internal network). Save and exit;

2. restart the NIC. The command for restarting the NIC in Ubuntu is:/etc/init. d/networking restart.

3. manually set the server route

Route add-net 192.168.4.0/24 gw 192.168.4.1 dev eth0

Note: The manually added route does not take effect after the server is restarted. You can add the preceding statement to the Automatic startup file;

After adding the IP address, you can ping the Internet IP address. The problem is solved!

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-09/123207.htm

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.