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
扫描二维码关注公众号,回复:
4806508 查看本文章
如果重启不成功,可以尝试 sudo ifconfig eth0 down,sudo ifconfig eth0 up