To configure the ipvtuserver network in the command line, first configure your IP address and other information: Use vi to open/etc/network/interfaces: vi/etc/network/interfaces if you use a fixed ip address, enter the following content: autoeth0ifaceeth0inetstaticaddress192.168.0.2 # your ip address netmask424255.
Configure the Ubuntu Server network through the command line
First, configure your IP address and other information:
Use vi to open/etc/network/interfaces: vi/etc/network/interfaces
If you are using a fixed ip address, enter the following content:
Auto eth0
Iface eth0 inet static
Address 192.168.0.2 # your IP address
Netmask 255.255.255.0
Gatway 192.168.0.1
Use vi to create the file/etc/resolv. conf: vi/etc/resolv. conf
Enter the following content in the file:
Nameserver 202.117.0.20
Nameserver 202.117.0.21 # This is the backup Domain Name Server address.
After completing the above characters, enter sudo/etc/init. d/networking restart in the terminal. Generally, it will wait for several seconds. When [OK] is displayed, the configuration is successful.
For testing, you can enter the ping command in the terminal: ping www.linuxidc.com. If there is a response instead of network is unreachable, it indicates that the ping is successful.