网卡地址配置
Ubuntu的网络配置文件是:/etc/network/interfaces
以DHCP
方式配置网卡
auto eth0
iface eth0 inet dhcp
用sudo /etc/init.d/networking restart命令使网络设置生效
为网卡配置静态IP地址
sudo vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
sudo /etc/init.d/networking restart
设定第二个IP地址(虚拟IP地址)
sudo vi /etc/network/interfaces
auto eth0:1
iface eth0:1 inet static
address 192.168.1.101
netmask 255.255.0
gateway 192.168.1.1
sudo /etc/init.d/net