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

猜你喜欢

转载自blog.csdn.net/baidu_24553027/article/details/82986390