我有一个正在运行的 Android 电视盒阿姆比安5.41(Ubuntu 16.04.5)。自从我从 kodi-standalone 更改为 MATE 以来,我发现了网络问题。
盒子通过以太网连接,MATE 显示两个接口:eth0 和 ifupdown(eth0)。我想使用 eth0,因为我无法在 ifupdown 上设置静态 IP,因为它是只读的。每次重启MATE都会自动连接ifupdown,导致没有网络。
我需要静态IP,因为我有Pi孔也在其上运行,并启用了 DHCP 服务器。 eth0的静态IP已在网络管理器中设置。我怎样才能删除这个接口或者至少将普通的 eth0 设置为默认值?
/etc/网络/接口
# Wired adapter #1
allow-hotplug eth0
no-auto-down eth0
iface eth0 inet dhcp
#address 192.168.0.17
#netmask 255.255.255.0
#gateway 192.168.0.1
#dns-nameservers 8.8.8.8 8.8.4.4
# hwaddress ether # if you want to set MAC manually
# pre-up /sbin/ifconfig eth0 mtu 3838 # setting MTU for DHCP, static just: mtu 3838
# Wireless adapter #1
# Armbian ships with network-manager installed by default. To save you time
# and hassles consider using 'sudo nmtui' instead of configuring Wi-Fi settings
# manually. The below lines are only meant as an example how configuration could
# be done in an anachronistic way:
#
#allow-hotplug wlan0
#iface wlan0 inet dhcp
#address 192.168.0.100
#netmask 255.255.255.0
#gateway 192.168.0.1
#dns-nameservers 8.8.8.8 8.8.4.4
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# Disable power saving on compatible chipsets (prevents SSH/connection dropouts over WiFi)
#wireless-mode Managed
#wireless-power off
# Local loopback
auto lo
iface lo inet loopback
答案1
从/etc/network/interfaces
:
# Armbian ships with network-manager installed by default. To save you time
# and hassles consider using 'sudo nmtui' instead of configuring Wi-Fi settings
# manually.
编辑/etc/NetworkManager/NetworkManager.conf
然后更改以下内容:
[ifupdown]
managed=true
到
[ifupdown]
managed=false
网络管理器不会管理在/etc/network/interfaces
运行时配置的网络接口:
sudo systemctl restart network-manager
使用命令sudo nmtui
配置静态IP。