Ubuntu 16.04 网卡配置方法

· Frytea · 5 分钟 · 技术笔记
Ubuntu 16.04 网卡配置方法

Ubuntu 旧版网卡配置方法.

ubuntu 16.04 配置网卡的方法还是比较经典的做法,与

debian 类似的。

  • 第一步:修改网卡配置文件
sudo vi /etc/network/interfaces
  • 第二步:修改配置内容
auto enp0s3
iface enp0s3 inet static
address 192.168.0.1
netmask  255.255.255.0
gateway  192.168.0.1
  • 第三不:重启网络
/etc/init.d/networking restart
或者(下面是指定启动关闭某个网卡命令)
ifdown enp0s3    (关闭网卡enp0s3)
ifup   enp0s3    (启动网卡enp0s3)
sudo service network-manager restart

注:该方法不适用于 ubuntu 20 以上,请参考新文章。

参考文献