- 查看ubuntu 网卡信息名
ip addr
1.lo:
2.enp1s0
3.docker0
4.br-eff5ea5eea78
- 修改 配置文件
sudo vi /etc/network/interfaces
#The primary network interface
#auto enp1s0
#iface enp1s0 inet dhcp //这两行是用来设定自动获取ip地址的 enp1s0 即为第一步中的网卡名
auto enp1s0
iface enp1s0 inet static
address 192.168.0.112
netmask 255.