Set 192.168.1.244 to fixed IP
1. Locate the file and make the following changes:
Vim/etc/network/interfaces
The result of the modification is the following section:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see Interfaces (5).
# The Loopback network interface
Auto Lo
Iface Lo inet Loopback
# The Primary network interface
Auto P2P1
Iface p2p1 inet Static
Address 192.168.1.244
Gateway 192.168.1.1
Netmask 255.255.255.0
Note: P2P1 for 192.168.1.244 network card name, different server network card name is different, please modify it yourself
2. Modify DNS resolution
DNS server addresses are automatically assigned because they were previously resolved by DHCP
And once the static IP is set, there is no automatic access to the DNS server.
To set a
Vim/etc/resolv.conf
NameServer 202.96.128.86
NameServer 192.168.1.1
NameServer 220.170.64.68
3. Change the above, if the restart, it will still become the original appearance, so let it change permanently, therefore, the execution:
Vim/etc/resolvconf/resolv.conf.d/base
NameServer 192.168.1.1
NameServer 220.170.64.68
3. Restart the network card:
/etc/init.d/networking restart
Ubuntu Set Fixed IP