1.网络配置

配置网卡
修改 /etc/network/interfaces 添加如下

# #号后面是备注,不要添加哦!

auto eth0 #开机自动激活
iface eth0 inte static #静态IP
address 192.168.0.56 #本机IP
netmask 255.255.255.0 #子网掩码
gateway 192.168.0.254 #路由网关

#因为我是通过路由上网的,所以配置为静态IP和网关

如果是用DHCP自动获取,请在配置文件里添加如下:

iface eth0 inet dhcp

设置DNS

echo "nameserver 202.96.128.86" >> /etc/resolv.conf
#请设置为你当地的DNS

到这里配置好以后,重启一下网卡。

/etc/init.d/network restart

 

相关文章:

  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
猜你喜欢
  • 2021-11-19
  • 2021-11-23
  • 2021-06-04
  • 2022-02-27
  • 2021-11-07
  • 2022-12-23
相关资源
相似解决方案