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
热议
2楼 royzheng 2小时前
你的网口确认叫eth1吗
3楼 wuguou6 2小时前
你的网口确认叫eth1吗
嗯
ifconfig
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>mtu 1500
inet 104.149.141.131netmask 255.255.255.254broadcast 255.255.255.255
inet6 fe80::ec4:7aff:fe0a:8b3cprefixlen 64scopeid 0x20<link>
ether 0c:c4:7a:0a:8b:3ctxqueuelen 1000(Ethernet)
RX packets 3764468bytes 308036980 (293.7 MiB)
RX errors 0dropped 2353761overruns 0frame 0
TX packets 832965bytes 355895309 (339.4 MiB)
TX errors 0dropped 0 overruns 0carrier 0collisions 0
device interrupt 16memory 0xdf900000-df920000
lo: flags=73<UP,LOOPBACK,RUNNING>mtu 65536
inet 127.0.0.1netmask 255.0.0.0
inet6 ::1prefixlen 128scopeid 0x10<host>
looptxqueuelen 1000(Local Loopback)
RX packets 553130bytes 212503198 (202.6 MiB)
RX errors 0dropped 0overruns 0frame 0
TX packets 553130bytes 212503198 (202.6 MiB)
TX errors 0dropped 0 overruns 0carrier 0collisions 0
4楼 aru 2小时前
将 gateway 108.181.24.14 这行注释掉后再试试
因为不能直接设置2个网关
5楼 aru 2小时前
如果注释掉重启网络没报错,那么将相关部分改一下
# 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
6楼 wuguou6 2小时前
如果注释掉重启网络没报错,那么将相关部分改一下
# 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.
7楼 aru 2小时前
删除或者注接还是报错
● networking.service - Raise network interfaces
Loaded: loaded (/lib/sy ...
ip route运行结果发一下
8楼 wuguou6 2小时前
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
9楼 aru 2小时前
default via 104.149.141.131 dev eth1 onlink
104.149.141.131/31 dev eth1 proto kernel scope link s ...
看样子你已经加上了
两个IP现在都能用吧
10楼 wuguou6 1小时前
看样子你已经加上了
两个IP现在都能用吧
嗯 都可以用 就是重启网络一直报错 比较奇怪
申明:本文内容由网友收集分享,仅供学习参考使用。如文中内容侵犯到您的利益,请在文章下方留言,本站会第一时间进行处理。