Nic configurations with fixed ip addresses in Ubuntu

Source: Internet
Author: User
Tags nameserver
To prepare the NIC configuration of a fixed ip address in Ubuntu, you must first understand the vi command. You can learn about it at any time by google: 1. Single NIC with Single IP (common) vi/etc/network/interfaceautoeth0ifaceeth0inetstaticaddressIPnetmask subnet mask gateway 2. Single Nic Dual IP (relatively

To prepare the NIC configuration of a fixed ip address in Ubuntu, you must first understand the vi command, so you can understand it at google:

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

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

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.