找回密码
 立即注册
查看: 126|回复: 6

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

[复制链接]

1

主题

0

回帖

39

积分

ssr节点分享志愿者

积分
39
发表于 2023-6-11 07:54:21 | 显示全部楼层 |阅读模式
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
回复

使用道具 举报

0

主题

1021

回帖

0

积分

新手上路

积分
0
发表于 2023-6-11 07:59:05 | 显示全部楼层
你的网口确认叫eth1吗
回复 支持 反对

使用道具 举报

0

主题

928

回帖

0

积分

新手上路

积分
0
发表于 2023-6-11 08:00:24 | 显示全部楼层
嗯
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
回复 支持 反对

使用道具 举报

0

主题

956

回帖

0

积分

新手上路

积分
0
发表于 2023-6-11 08:03:08 | 显示全部楼层
将   gateway 108.181.24.14 这行注释掉后再试试
因为不能直接设置2个网关
回复 支持 反对

使用道具 举报

0

主题

1030

回帖

0

积分

新手上路

积分
0
发表于 2023-6-11 08:06:17 | 显示全部楼层
如果注释掉重启网络没报错,那么将相关部分改一下

# 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
回复 支持 反对

使用道具 举报

0

主题

934

回帖

0

积分

新手上路

积分
0
发表于 2023-6-11 08:14:51 | 显示全部楼层
删除或者注接还是报错
● 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.
回复 支持 反对

使用道具 举报

0

主题

1019

回帖

0

积分

新手上路

积分
0
发表于 2023-6-11 08:19:15 | 显示全部楼层
ip route  运行结果发一下
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|翻墙党

GMT+8, 2026-9-25 20:49 , Processed in 0.088572 second(s), 29 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

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