Ubuntu 配置IP地址

1 DHCP模式

更改配置文件 /etc/network/interfaces

auto eth0

iface eth0 inet dhcp

2 靜態模式

auto eth0

iface eth0 inet static

address 192.168.1.4

netmask 255.255.255.0

gateway 192.168.1.1

更改配置文件後需要重啓網絡服務,sudo /etc/init.d/networking

如果重啓不成功,可以嘗試 sudo ifconfig eth0 down,sudo ifconfig eth0 up

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章