使用ubuntu 16.04 server版本
ubuntu server版本只用这个文件作为网卡配置。
1、编辑网卡文件
sudo vim /etc/network/interfaces

2、添加参数
动态:
auto eth0
iface eth0 inet dhcp
静态:
auto eth0
iface eth0 inet static
address 192.168.199.61
netmask 255.255.255.0
gateway 192.168.199.1
dns-nameservers 114.114.114.114
#pre-up ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx(要改成的MAC)
#从udev中查看

3、服务重启
sudo /etc/init.d/networking restart

4、ping dns测试
ping 114.114.114.114

相关文章:

  • 2021-12-02
  • 2022-02-11
  • 2022-12-23
  • 2021-12-25
  • 2021-11-30
  • 2022-12-23
猜你喜欢
  • 2021-12-18
  • 2022-01-09
  • 2021-12-07
  • 2022-12-23
  • 2021-11-24
  • 2022-12-23
  • 2021-05-21
相关资源
相似解决方案