Note: System: debian6.0.4IP address: 192.168.21.166 subnet mask: 255.255.255.0 Gateway: 192.168.21.2DNS: 8.8.8.88.8.4.4 operation: System O & M reminder: qihang01 original content copyright, reprinted, please indicate the source and original article links 1. set the IP address, Gateway nano/etc/network/inte
Note:
System: debian 6.0.4
IP address: 192.168.21.166
Subnet mask: 255.255.255.0
Gateway: 192.168.21.2
DNS: 8.8.8.8
8.8.4.4
Operation:
System O & M reminder: qihang01 original content is copyrighted. For more information, see the source and original article links.
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
Auto eth0 # automatically connect to the network at startup
Iface lo inet loopback
Allow-hotplug eth0
Iface eth0 inet static # static indicates using a fixed ip address, and dhcp indicates using a dynamic ip address
Address 192.168.21.166 # set the IP address
Netmask 255.255.255.0 # set the subnet mask
Gateway192.168.21.2 # set the 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
Nameserver 8.8.8.8 # set preferred dns
Nameserver 8.8.4.4 # Set backup dns
Ctrl + o # save configuration
Ctrl + x # exit