ubuntu環境修改IP地址方法和CentOS系統修改方法不太一樣。ubuntu系統修改IP地址方法如下:
編輯/etc/network/interfaces,增加以下內容:
auto eth0 iface eth0 inet static address 192.168.1.100 gateway 192.168.1.1 netmask 255.255.255.0
修改完之后執行以下命令重啟網卡:
/etc/init.d/networking restart
或者執行這個命令也可以重啟網卡:
systemctl restart networking
如果網卡重啟失敗,可以執行以下命令查看日志:
journalctl -xe