1. Modify the file:/etc/Network/interfaces defines the static IP address, subnet mask, and gateway settings of the NIC.
Use sudo Kate/etc/Network/interfaces to open the editing. There should be the following two lines:
Auto lo eth0 # eth0 is the nic and lo is the local loopback
Iface lo Inet loopback # define lo loopback
Comment out the above two rows;
Add the following content
Auto eth0
Iface eth0 Inet static # define eth0 Nic, use static IP
Address 192.168.10.36 # define the static IP address of the Local Machine (modified by yourself)
Netmask 255.255.255.0 # define the local subnet mask (modified by yourself)
Gateway 192.168.10.9 # define the local Gateway (modified by yourself)
2. Modify the file:/etc/resolv. conf to define the DNS (Domain Name Resolution Service) address.
Nameserver 192.168.10.9 # (modified by yourself)
3. After these two configuration files are modified, run the following command to restart the network service.
Sudo/etc/init. d/networking restart
--------------------------------------------------------------------------------
Supplement: automatically obtain IP Address Configuration
If there is a vro and the IP address is set to automatically obtained, replace the line related to eth0.
Auto eth0
Iface eth0 Inet DHCP