自己的网卡为eth2
1.
2.修改/etc/network/interfaces这个文件
auto eth2
iface eth2 inet static
address 192.168.1.10 //静态IP地址
netmask 255.255.255.0 //掩码
gateway 192.168.1.1 //网关
1.
$
sudo
ifdown eth2 //取消激活网卡,此时ifconfig将不会显示eth2 的信息
2.修改/etc/network/interfaces这个文件
auto eth2
iface eth2 inet static
address 192.168.1.10 //静态IP地址
netmask 255.255.255.0 //掩码
gateway 192.168.1.1 //网关
3.$
sudo
ifup eth2 //重新激活网卡eth2