18.04: 回到/etc/network/interfaces

分享于 

1分钟阅读

ubuntu

  繁體

以下过程适用于Ubuntu 18.04 (Bionic Beaver )

I.重新安装ifupdown包:


# apt-get update


# apt-get install ifupdown



II,使用如下配置节配置/etc/network/interfaces文件:


source /etc/network/interfaces.d/*



# The loopback network interface


auto lo


iface lo inet loopback



allow-hotplug enp0s3


auto enp0s3


iface enp0s3 inet static


 address 192.168.1.133


 netmask 255.255.255.0


 broadcast 192.168.1.255


 gateway 192.168.1.1


 dns-nameservers 8.8.8.8 8.8.4.4



III,使配置生效(不需要重新启动):


# ifdown --force enp0s3 lo && ifup -a



IV,禁用和删除不需要的服务:


# systemctl stop networkd-dispatcher


# systemctl disable networkd-dispatcher


# systemctl mask networkd-dispatcher


# apt-get purge nplan netplan.io





network  Ubuntu  switch  网络  
相关文章