我有同样的症状这里但配置略有不同。我的 Debian 服务器位于数据中心,因此我无法进行本地访问,只能进行远程访问。
由于更换了主板,除非进入救援模式,否则我无法以任何方式访问我的服务器。在这里我可以安装磁盘驱动器并检查文件。
所以启动日志给我看
...
[FAILED] Failed to start Raise network interfaces.
See 'systemctl status networking.service' for details.
...
我不确定问题是什么以及如何真正找到问题的根本原因,所以在这里我发布了一些配置文件。这些应该和更换主板之前一样,因为我没有改变它们
/etc/网络/接口
auto lo
iface lo inet loopback
#
# device: eth0
auto eth0
iface eth0 inet static
address vvv.www.xxx.zzz
netmask 255.255.255.224
gateway vvv.www.xxx.1
iface eth0 inet6 static
address xxxx:xxx:xxx:xxxx::x
netmask 128
gateway xxxx::1
up sysctl -p
auto vmbr0
iface vmbr0 inet static
address 10.10.10.2
netmask 255.255.255.0
bridge_ports eth0
bridge_stp off
bridge_fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o eth0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o eth0 -j MASQUERADE
/etc/默认/网络
# Configuration for networking init script being run during
# the boot sequence
# Set to 'no' to skip interfaces configuration on boot
#CONFIGURE_INTERFACES=yes
# Don't configure these interfaces. Shell wildcards supported/
#EXCLUDE_INTERFACES=
# Set to 'yes' to enable additional verbosity
#VERBOSE=no
/etc/systemd/system/network-online.target.wants/networking.service
有什么线索可以从哪里开始看吗?
[Unit]
Description=Raise network interfaces
Documentation=man:interfaces(5)
DefaultDependencies=no
Wants=network.target
After=local-fs.target network-pre.target apparmor.service systemd-sysctl.service systemd-modules-load.service
Before=network.target shutdown.target network-online.target
Conflicts=shutdown.target
[Install]
WantedBy=multi-user.target
WantedBy=network-online.target
[Service]
Type=oneshot
EnvironmentFile=-/etc/default/networking
ExecStartPre=-/bin/sh -c '[ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle'
ExecStart=/sbin/ifup -a --read-environment
ExecStop=/sbin/ifdown -a --read-environment --exclude=lo
RemainAfterExit=true
TimeoutStartSec=5min
更新1
root@chroot > ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
inet xxx.xx.xx.xx/xx brd xx.xx.xx.xx scope global eth0
valid_lft forever preferred_lft forever
inet6 xxxx:xxxx:xxx:xxxx::x/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::xxxx:xxxx:xxxx:xxxx/64 scope link
valid_lft forever preferred_lft forever
/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 0x8086:0x1502 (e1000e)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="4c:72:b9:98:12:ab", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
答案1
删除/etc/udev/rules.d/70-persistent-net.rules
或修改它以匹配您的新以太网接口(现在名为 eth1)。