This article mainly introduces network settings in Ubuntu, including setting dual NICs and binding multiple IP addresses to a single NIC. here we want to implement the most basic network settings, for more information, see Ubuntu.
Network settings in the Ubuntu system, including setting dual NICs and binding multiple IP addresses to a single NIC. what we need to achieve here is the most basic network settings.
Sudo su
Gedit/etc/network/interfaces
File content:
Auto lo
Iface lo inet loopback
Auto eth0 # This should determine whether to enable this port
Iface eth0 inet static # static IP address setting
Hwaddress ether 52: 54: xx: 51: xx # add the MAC address. remember to put it before the IP address.
Address 202.198.151.17
Netmask 255.255.255.0
# Broadcast 202.198.151.255
Gateway 202.198.151.254
# Dynamic settings through dhcp
Iface eth1 inet dhcp
Set MAC address ing
Gedit/etc/iftab
Add a row
Eth1 mac 52: 54: xx: 51: xx
Set DNS server
Sudo vi/etc/resolv. conf
Content
Nameserver 202.198.125.255
Reset the network to enable new settings
Sudo/etc/init. d/networking restart