debain11添加新IP报错 请教下如何解决 RTNETLINK answers: File exists

36次阅读

共计 4208 个字符,预计需要花费 11 分钟才能阅读完成。

root@hostname:~# systemctl status networking.service● networking.service – Raise network interfaces     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)     Active: failed (Result: exit-code) since Sat 2023-06-10 16:55:53 PDT; 4min 34s ago       Docs: man:interfaces(5)    Process: 1868 ExecStart=/sbin/ifup -a –read-environment (code=exited, status=1/FAILURE)   Main PID: 1868 (code=exited, status=1/FAILURE)        CPU: 35msJun 10 16:55:53 deviceid7317 systemd[1]: Starting Raise network interfaces…Jun 10 16:55:53 deviceid7317 ifup[1875]: RTNETLINK answers: File existsJun 10 16:55:53 deviceid7317 ifup[1868]: ifup: failed to bring up eth1:1Jun 10 16:55:53 deviceid7317 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILUREJun 10 16:55:53 deviceid7317 systemd[1]: networking.service: Failed with result \’exit-code\’.Jun 10 16:55:53 deviceid7317 systemd[1]: Failed to start Raise network interfaces.root@hostname:~## 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 interfaceauto loiface lo inet loopback# The primary network interfaceallow-hotplug eth0iface eth0 inet dhcpauto eth1iface eth1 inet static  address 104.149.141.131  netmask 255.255.255.252  gateway 104.149.141.130 auto eth1:1iface eth1:1 inet static  address 108.181.24.15  netmask 255.255.255.254  gateway 108.181.24.14 royzheng 2023-06-11 08:05 2 你的网口确认叫 eth1 吗 wuguou6 2023-06-11 08:11 3royzheng 发表于 2023-6-11 08:05 你的网口确认叫 eth1 吗嗯 ifconfigeth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500        inet 104.149.141.131  netmask 255.255.255.254  broadcast 255.255.255.255        inet6 fe80::ec4:7aff:fe0a:8b3c  prefixlen 64  scopeid 0x20<link>        ether 0c:c4:7a:0a:8b:3c  txqueuelen 1000  (Ethernet)        RX packets 3764468  bytes 308036980 (293.7 MiB)        RX errors 0  dropped 2353761  overruns 0  frame 0        TX packets 832965  bytes 355895309 (339.4 MiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0        device interrupt 16  memory 0xdf900000-df920000lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536        inet 127.0.0.1  netmask 255.0.0.0        inet6 ::1  prefixlen 128  scopeid 0x10<host>        loop  txqueuelen 1000  (Local Loopback)        RX packets 553130  bytes 212503198 (202.6 MiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 553130  bytes 212503198 (202.6 MiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 aru 2023-06-11 08:19 4 内容最后由 aru 于 2023-6-11 08:21 编辑 将    gateway 108.181.24.14 这行注释掉后再试试因为不能直接设置 2 个网关 aru 2023-06-11 08:23 5 如果注释掉重启网络没报错,那么将相关部分改一下# The primary network interfaceallow-hotplug eth0iface eth0 inet dhcpauto eth1iface eth1 inet static  address 104.149.141.131  netmask 255.255.255.252  post-up route add default gw 104.149.141.130 metric 1  pre-down route del default gw 104.149.141.130 auto eth1:1iface eth1:1 inet static  address 108.181.24.15  netmask 255.255.255.254  post-up route add default gw 108.181.24.14 metric 2  pre-down route del default gw 108.181.24.14 wuguou6 2023-06-11 08:30 6aru 发表于 2023-6-11 08:23 如果注释掉重启网络没报错,那么将相关部分改一下# The primary network interface 删除或者注接还是报错● networking.service – Raise network interfaces     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)     Active: failed (Result: exit-code) since Sat 2023-06-10 17:28:23 PDT; 7s ago       Docs: man:interfaces(5)    Process: 268457 ExecStart=/sbin/ifup -a –read-environment (code=exited, status=1/FAILURE)   Main PID: 268457 (code=exited, status=1/FAILURE)        CPU: 32msJun 10 17:28:23 systemd[1]: Starting Raise network interfaces…Jun 10 17:28:23 ifup[268464]: RTNETLINK answers: File existsJun 10 17:28:23 ifup[268457]: ifup: failed to bring up eth1:1Jun 10 17:28:23 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILUREJun 10 17:28:23 systemd[1]: networking.service: Failed with result \’exit-code\’.Jun 10 17:28:23 systemd[1]: Failed to start Raise network interfaces. aru 2023-06-11 08:32 7wuguou6 发表于 2023-6-11 08:30 删除或者注接还是报错● networking.service – Raise network interfaces     Loaded: loaded (/lib/sy …ip route   运行结果发一下 wuguou6 2023-06-11 08:40 8aru 发表于 2023-6-11 08:32ip route   运行结果发一下 default via 104.149.141.131 dev eth1 onlink104.149.141.131/31 dev eth1 proto kernel scope link src 104.149.141.130108.181.24.15/31 dev eth1 proto kernel scope link src 108.181.24.14 aru 2023-06-11 08:42 9wuguou6 发表于 2023-6-11 08:40default via 104.149.141.131 dev eth1 onlink104.149.141.131/31 dev eth1 proto kernel scope link s … 看样子你已经加上了两个 IP 现在都能用吧

正文完
 0