1、添加
sudo ifconfig enp0s31f6:0 192.168.10.10 up
2、卸載
sudo ifconfig enp0s31f6:0 down
注意:enp0s31f6每台電腦都不一樣,可以使用ifconfig進行查看得知。
3、高級寫法
sudo vim /etc/network/interfaces
在這個文件中增加如下內容並保存:
auto eth0:0 iface eth0:0 inet static address 192.168.1.63 netmask 255.255.255.0 network 192.168.1.1 broadcast 192.168.1.255
注意:eth0每台電腦都不一樣,使用ifconfig進行查看。
保存后重啟:
sudo /etc/init.d/networking restart
參考:
http://blog.csdn.net/hzhsan/article/details/44677867
http://www.cnblogs.com/wolfsky/articles/2851887.html
http://os.51cto.com/art/201311/419204.htm