1、dhcp自动获取
sudo vi /etc/network/interfaces
auto eth0
iface eth0 inet dhcp
设置生效:
sudo /etc/init.d/networking restart
或
sudo dhclient eth0
2、静态IP地址
iface eth0 inet static
address 192.168.3.90
netmask 255.255.255.0
gateway 192.168.3.1
3、虚拟IP地址
添加: