我遇到了一个问题,我有两个虚拟机,但问题是,当我打开第二台虚拟机时,我失去了与第一台虚拟机的连接,反之亦然。
以下是主机服务器上的桥接网络计划配置:
network:
version: 2
renderer: networkd
ethernets:
enp1s0f0:
dhcp4: no
dhcp6: no
bridges:
viifbr0:
addresses:
- 135.xxx.159.xx/24
- 2001:xxxx:xxx:500f::/128
interfaces: [ enp1s0f0 ]
routes:
- on-link: true
to: 0.0.0.0/0
via: 135.xxx.159.xxx
- on-link: true
to: ::0/
via: 2001:xxxx:xxx:50ff:ff:ff:ff:ff
gateway6: 2001:xxxx:xxx:50ff:ff:ff:ff:ff
macaddress: xx:40:xx:fe:xx:7b
nameservers:
addresses:
- 8.8.8.8
- 8.8.4.4
- 2001:4860:4860::8888
- 2001:4860:4860::8844
(已启用 IPv6 转发)
以下是客户端网络配置:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet6 static
accept_ra 0
address 2001:xxxx:xxx:500f::a2
netmask 64
post-up /sbin/ip -r route add 2001:xxxx:xxx:50ff:ff:ff:ff:ff dev eth0
post-up /sbin/ip -r route add default via 2001:xxxx:xxx:50ff:ff:ff:ff:ff
你能帮助我吗 ?
谢谢。
问候,Irkoska
答案1
确保虚拟机具有不同的 MAC 地址。外部 DHCP 服务器无法区分具有相同 MAC 地址的虚拟机,因此会为两者分配相同的 IP 地址。