: System: UbuntuServer11.10IP address: 192.168.21.168 subnet mask: 255.255.255.0 Gateway: 192.168.21.2DNS: 8.8.8.88.8.4.4 operation: 1. Set IP address, Gateway nano/
Note:
The system is Ubuntu Server 11.10.
IP Address: 192.168.21.168
Subnet Mask: 255.255.255.0
Gateway: 192.168.21.2
DNS: 8.8.8.8
8.8.4.4
Operation:
1. Set IP addresses and gateways
Nano/etc/network/interfaces/etc/network/interfacesbak # back up the original configuration file
Nano/etc/network/interfaces # edit the NIC configuration file
Auto lo
Iface lo inet loopback
Auto eth0 # automatically connect to the network at startup
Iface eth0 inet static # static indicates using a fixed ip address, and dhcp indicates using a dynamic ip Address
Address 192.168.21.168 # Set the IP address
Netmask 255.255.255.0 # Set the subnet mask
Gateway 192.168.21.2 # Set gateway
Ctrl + o # Save Configuration
Ctrl + x # exit
2. Set dns
Cp/etc/resolv. conf/etc/resolv. confbak # back up the original dns configuration file
Nano/etc/resolv. conf # edit the configuration file and add the following content
Nameserver 8.8.8.8 # Set preferred dns
Nameserver 8.8.4.4 # Set backup dns
Ctrl + o # Save Configuration
Ctrl + x # exit
System O & M www.osyunwei.com reminder: qihang01 original content©All rights reserved. For more information, see the source and original link.
3. Restart the network
/Etc/init. d/networking restart # restart the network
Now, the IP address, gateway, and DNS configurations are complete, and the system is ready to access the Internet.