1. configure the network interface: $ sudogedit/etc/network/interfaces # Set the NIC interface in the pop-up text and fill in the code to allocate a static IP address to eth0, as shown below: autoeth0 # enable the NIC automatically when the instance is started. # Ifaceeth1inetdhcp. But it can be left without deletion.) ifaceeth0i
1. Configure the network interface:
$ Sudo gedit/etc/network/interfaces
# In the pop-up text, set the NIC interface and enter the code for allocating a static IP address to eth0, as shown below:
Auto eth0 # enable the NIC automatically when the instance is started.
# Iface eth1 inet dhcp (if this line of code exists, add "#" in front and comment it out. Of course, ignore it. But it can be left without deletion)
Iface eth0 inet static
Address 192.168.1.123 # this IP address should be entered based on your own situation. do not conflict with others' addresses in the network. For TPlink, enter 192.168.1.168.
Netmask subnet mask 255.255.0. If it is TPlink, you do not need to change it.
Gateway 192.168.1.1 # gateway, ask the network administrator to enter or enter a vro. For TPlink, enter 192.168.1.1.
2. Configure DNS:
$ Sudo gedit/etc/resolv. conf # enter the DNS name server address in the pop-up text.
Nameserver 222.30.45.1 # the address of the preferred DNS server, which you can see in the vro directly.
Nameserver 222.30.45.1 # enter the address of the backup DNS server.
3. Restart.
$ Sudo/etc/init. d/networking restart