检查网络设置

ifconfig

更改以太网配置

# 更改以太网配置文件
sudo vi /etc/network/interfaces
# 若设置 DHCP 自动获取 IP 地址,在以上文件中添加
auto eth0
iface eth0 inet dhcp
# 若配置自定义 IP 地址,在以上文件中添加
auto eth0
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1

以上为配置 eth0 网口的两种配置方法,如果接口名不同,替换即可。如 eth1

使配置生效

#重启 networking 服务,让配置生效
sudo /etc/init.d/networking restart
#也可以单独重启 eth0 网口,不影响其它网口运行
sudo ifdown eth0
sudo ifup eth0





相关文章:

  • 2021-05-29
  • 2021-11-10
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2021-12-25
  • 2021-08-04
  • 2021-11-03
猜你喜欢
  • 2021-12-21
  • 2022-12-23
  • 2021-12-25
  • 2021-06-12
  • 2021-09-15
相关资源
相似解决方案