ste*_*ven 5 linux vmware-player debian-wheezy
我在“ifup eth0:1”上收到“RTNETLINK 答案:文件存在无法启动 eth0:1”。
我怀疑这是因为我在 VM 的网络适配器中分配了一个新的 mac 地址。
你能告诉我如何解决这个问题吗?
我的配置是这样的:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.80
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
# Alias being connected to 192.168.10.x Network
auto eth0:1
allow-hotplug eth0:1
iface eth0:1 inet static
address 192.168.10.83
netmask 255.255.255.0
gateway 192.168.10.10
dns-nameservers 192.168.10.1
Run Code Online (Sandbox Code Playgroud)
为什么我会突然收到“RTNETLINK 答案:文件存在..”?我之前使用过这个配置没有问题。我过去所做的只是更新适配器 mac 地址。
目前我已连接到 192.168.10.x 网络,如果连接
/etc/init.d/networking stop
/etc/init.d/networking start
Run Code Online (Sandbox Code Playgroud)
然后我得到了“RTNETLINK [...] 无法启动 eth0:1”,但奇怪的是我能够通过 ssh 从我的主机连接到 192.168.10.83。但是我无法从 debian 客户端访问互联网。
我希望现在清楚我的问题是什么。
更新
如果我像这样更改我的 /etc/network/interfaces,那么“ifup eth0”也会失败,也会出现同样的错误!
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.10.83
netmask 255.255.255.0
gateway 192.168.10.10
dns-nameservers 192.168.10.1
Run Code Online (Sandbox Code Playgroud)
启用详细选项后,我得到了:
Configuring interfache eth0=eth0 (inet)
run-parts --verbose /etc/network/if-pre-up.d
ip addr add 192.168.10.83/255.255.255.0 broadcast 192.168.10.255 dev eth0 label eth0
RTNETLINK answers: File exists Failed to bring up eth0.
Run Code Online (Sandbox Code Playgroud)
如果我手动输入也一样:
ip addr add 192.168.10.83/255.255.255.0 broadcast 192.168.10.255 dev eth0 label eth0
Run Code Online (Sandbox Code Playgroud)
看看 /etc/udev/rules.d/70-persistent-net.rules
这是我的:(适当地加工)
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x10de:/sys/devices/pci0000:00/0000:00:0a.0 (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="11:22:33:44:55:66", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x168c:/sys/devices/pci0000:00/0000:00:14.0/0000:07:00.0 (ath5k)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="77:88:99:aa:bb:cc", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
Run Code Online (Sandbox Code Playgroud)
我想你在那里有一个 eth0 的条目,删除整行,然后停止/开始网络,或者只是重新启动。当系统(重新)发现网络设备时,应重新创建该文件。
该文件用于将网络设备(通过 MAC)映射到网络设备 NAME。例如,我的“11:22:33:44:55:66”设备名为 /dev/eth0。
如果您有多个 NIC 或多个 Wifi 设备等,这就是系统在每次启动时避免交换 eth0 和 eth1 的方式。
与此相邻的文件 70-persistent-cd.rules 对您的 CD/DVD/BD/laserdisc 播放器执行相同的操作,使它们在名称上保持一致。(我很想看到一个 USB 激光光盘装置!)
您已设置两个具有相同指标的默认网关。(https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1043244/comments/8)
尝试删除一条您不想使用的网关线路。
我也不确定是否allow-hotplug eth0:1正确。尝试删除它。