禁用armbian的netplan
1、先安装 ifupdown、resolvconf 软件包。
XML/HTML代码
- sudo apt install ifupdown resolvconf
2、修改配置文件配置好网络连接。
XML/HTML代码
- sudo nano /etc/network/interfaces
XML/HTML代码
- auto lo
- iface lo inet loopback
- # The primary network interface
- auto eth0
- iface eth0 inet static
- address 192.168.1.2
- netmask 255.255.255.0
- gateway 192.168.1.1
- dns-nameservers 8.8.8.8 8.8.4.4
DHCP 网络配置示例:
XML/HTML代码
- # This file describes the network interfaces available on your system
- # and how to activate them. For more information, see interfaces(5).
- # source /etc/network/interfaces.d/*
- # The loopback network interface
- auto lo
- iface lo inet loopback
- # The primary network interface
- auto eth0
- allow-hotplug eth0
- iface eth0 inet dhcp
3、关闭 & 重开网络接口,设置 networking 服务开机启动和重启使设置生效。
XML/HTML代码
- sudo ifdown --force eth0 lo && ifup -a
- sudo systemctl enable networking
- sudo systemctl restart networking
4、停止、取消和禁止 Netplan 相关服务运行
XML/HTML代码
- systemctl disable NetworkManager
- systemctl stop NetworkManager
XML/HTML代码
- sudo apt -y install net-tools