全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 939|回复: 9

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

[复制链接]
发表于 2023-6-11 08:01:04 | 显示全部楼层 |阅读模式








root@:~# 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: 35ms

Jun 10 16:55:53 deviceid7317 systemd[1]: Starting Raise network interfaces...
Jun 10 16:55:53 deviceid7317 ifup[1875]: RTNETLINK answers: File exists
Jun 10 16:55:53 deviceid7317 ifup[1868]: ifup: failed to bring up eth1:1
Jun 10 16:55:53 deviceid7317 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Jun 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@:~#

# 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
allow-hotplug eth0
iface eth0 inet dhcp
auto eth1
iface eth1 inet static
  address 104.149.141.131
  netmask 255.255.255.252
  gateway 104.149.141.130
  
auto eth1:1
iface eth1:1 inet static
  address 108.181.24.15
  netmask 255.255.255.254
  gateway 108.181.24.14
发表于 2023-6-11 08:05:36 | 显示全部楼层
你的网口确认叫eth1吗
 楼主| 发表于 2023-6-11 08:11:35 | 显示全部楼层
royzheng 发表于 2023-6-11 08:05
你的网口确认叫eth1吗


ifconfig
eth1: 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-df920000  

lo: 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
发表于 2023-6-11 08:19:01 | 显示全部楼层
本帖最后由 aru 于 2023-6-11 08:21 编辑

将   gateway 108.181.24.14 这行注释掉后再试试
因为不能直接设置2个网关
发表于 2023-6-11 08:23:30 | 显示全部楼层
如果注释掉重启网络没报错,那么将相关部分改一下

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
auto eth1
iface 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:1
iface 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


 楼主| 发表于 2023-6-11 08:30:20 | 显示全部楼层
aru 发表于 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: 32ms

Jun 10 17:28:23 systemd[1]: Starting Raise network interfaces...
Jun 10 17:28:23 ifup[268464]: RTNETLINK answers: File exists
Jun 10 17:28:23 ifup[268457]: ifup: failed to bring up eth1:1
Jun 10 17:28:23 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Jun 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.

发表于 2023-6-11 08:32:00 | 显示全部楼层
wuguou6 发表于 2023-6-11 08:30
删除或者注接还是报错
● networking.service - Raise network interfaces
     Loaded: loaded (/lib/sy ...

ip route  运行结果发一下
 楼主| 发表于 2023-6-11 08:40:34 | 显示全部楼层
aru 发表于 2023-6-11 08:32
ip route  运行结果发一下

default via 104.149.141.131 dev eth1 onlink
104.149.141.131/31 dev eth1 proto kernel scope link src 104.149.141.130
108.181.24.15/31 dev eth1 proto kernel scope link src 108.181.24.14
发表于 2023-6-11 08:42:46 | 显示全部楼层
wuguou6 发表于 2023-6-11 08:40
default via 104.149.141.131 dev eth1 onlink
104.149.141.131/31 dev eth1 proto kernel scope link s ...

看样子你已经加上了
两个IP现在都能用吧
 楼主| 发表于 2023-6-11 09:00:48 | 显示全部楼层
aru 发表于 2023-6-11 08:42
看样子你已经加上了
两个IP现在都能用吧

嗯 都可以用 就是重启网络一直报错 比较奇怪
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-12-30 17:12 , Processed in 0.094571 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表