临时ip地址
自动 获取
dhclient etho
手动配置 IP地址ifconfig eth0 192.168.226.140/24
配置dns
DNC 存储在 /etc/resolv.conf
echo nameserver 192.168.1.1 > /etc/resolv.conf
也可以 vim /etc/resolv.conf
固定ip 地址配置
固定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