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