Ubuntu 16.04 网卡配置方法

Ubuntu 旧版网卡配置方法.

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

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

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

参考文献


Ubuntu 16.04 网卡配置方法
https://www.frytea.com/post/20211105083054.html
作者
Tianlun Song
发布于
2021年11月5日
更新于
2024年6月10日
许可协议