
我正在其他地方的資料中心的遠端主機上進行全新安裝的 Debian Buster 安裝。
我有一個腳本準備將工作標準 /etc/network/interfaces 複製回原位並使用在如果變更網路設定時出現問題,請輸入指令。
當我將橋接 br0 條目新增至 /etc/network/interfaces 並呼叫 ifup br0 時,橋接介面顯示如下:
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet xx.xxx.62.204 netmask 255.255.255.0 broadcast xx.xxx.62.255
inet6 xxxx::7a2b:cbff:fe71:b0b0 prefixlen 64 scopeid 0x20<link>
ether 78:xx:xx:xx:b0:b0 txqueuelen 1000 (Ethernet)
RX packets 1722 bytes 80621 (78.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5 bytes 426 (426.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet xx.xxx.62.204 netmask 255.255.255.0 broadcast xx.xxx.62.255
ether 78:xx:xx:xx:b0:b0 txqueuelen 1000 (Ethernet)
RX packets 27871902 bytes 1784816339 (1.6 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10682 bytes 1326822 (1.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
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 (Lokale Schleife)
RX packets 26 bytes 3455 (3.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 26 bytes 3455 (3.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
使用此 /etc/network/interfaces 條目:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eno1
iface eno1 inet static
address xx.xxx.62.204
netmask 255.255.255.0
network xx.xxx.62.0
broadcast xx.xxx.62.255
gateway xx.xxx.62.254
iface eno1 inet6 static
address xxxx:198:ff0d:e800::/40
pre-up echo 0 > /proc/sys/net/ipv6/conf/eno1/accept_dad
post-up ip -6 route add default via xxxx:198:ff00::1
up ip -6 addr add xxxx:198:ff0d:e800::1/40 dev $IFACE
down ip -6 addr del xxxx:198:ff0d:e800::1/40 dev $IFACE
auto br0
iface br0 inet static
address xx.xxx.62.204
netmask 255.255.255.0
gateway xx.xxx.62.254
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0
但幾秒鐘後,ssh 連線凍結,ping 資料包不再到達,我必須等待緊急腳本修復/重新啟動。
整個嘗試是在主機上提供一個帶有橋接介面的kvm虛擬機,以便透過單獨的IP4位址存取外界。
新增的橋接條目是根據這個伺服器故障帖子