Ubuntu nic ip settings

Source: Internet
Author: User
Tags nameserver
Article title: Ubuntu nic ip settings. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

1. single NIC with single IP address (common)

Vi/etc/network/interface

Auto eth0

Iface eth0 inet static

Address IP

Netmask subnet mask

Gateway

2. Dual IP addresses for a single NIC (in rare cases, most of which are used to differentiate services or hide security)

Vi/etc/network/interface

Auto eth0: 0

Iface eth0: 0 inet static

Address IP

Netmask subnet mask

Gateway

Auto eth0: 1

Iface eth0: 1 inet static

Address IP

Netmask subnet mask

Gateway

3. Dual-network card dual IP (many applications, usually one intranet and one Internet)

Auto eth0

Iface eth0 inet static

Address IP

Netmask subnet mask

Gateway

Auto eth1

Iface eth1 inet static

Address IP

Netmask subnet mask

Gateway

In summary, after the configuration is saved and released, you usually need to restart the NIC to make the settings take effect. There are many methods, such as ifdown eth0 and ifup eth0. the most direct method is to directly type/etc/init on the terminal. d/networking restart www.kissgz.com

DNS is the same, as shown below:

Vi/etc/resolv. conf (the file resolv. conf does not exist by default in the system and is created by yourself)

Nameserver Primary DNS

Nameserver backup DNS

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.