• 临时IP地址
• dhclient eth0
• ifconfig eth0 192.168.1.11/24
• route add default gw 192.168.1.1
• echo nameserver 192.168.1.1 > /etc/resolv.conf
固定IP地址
• cat /etc/network/interface
• auto eth0
• iface eth0 inet static
• address 192.168.20.1
• netmask 255.255.255.0
• network 192.168.20.0
• broadcast 192.168.20.255
• gateway 192.168.20.2
• dns-nameservers 192.168.1.1 192.168.1.2
• up route add -net 172.16.5.0/24 gw 192.168.10.100 eth1
• down route del -net 172.24.0.0/24
原文:https://www.cnblogs.com/zzg521/p/11802418.html