我在 Proxmox (KVM) 服务器上设置 IPV6 时遇到了问题:
我的 ISP 向我发送了此信息(xxx=占位符):
IPs: 2a01:XXX:XXX:301:: /64
Gateway: 2a01:XXX:XXX:300::1 /59
这是主机服务器上的接口设置:
auto vmbr1
iface vmbr1 inet static
address 178.XX.XX.4
broadcast 178.XX.XX.63
netmask 255.255.255.192
pointopoint 178.XX.XX.1
gateway 178.XX.XX.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
iface vmbr1 inet6 static
address 2a01:XXX:XXX:301::2
netmask 64
up ip -6 route add 2a01:XXX:XXX:300::1 dev vmbr1
down ip -6 route del 2a01:XXX:XXX:300::1 dev vmbr1
up ip -6 route add default via 2a01:XXX:XXX:300::1 dev vmbr1
down ip -6 route del default via 2a01:XXX:XXX:300::1 dev vmbr1
关于客人:
auto eth0
iface eth0 inet static
address 178.xx.xx.47
netmask 255.255.255.255
broadcast 178.xx.xx.63
gateway 178.xx.xx.1
pointopoint 178.xx.xx.1
iface eth0 inet6 static
pre-up modprobe ipv6
address 2a01:XXX:XXX:301::2:2
netmask 64
up ip -6 route add 2a01:XXX:XXX:300::1 dev eth0
down ip -6 route del 2a01:XXX:XXX:300::1 dev eth0
up ip -6 route add default via 2a01:XXX:XXX:300::1 dev eth0
down ip -6 route del default via 2a01:XXX:XXX:300::1 dev eth0
Ipv4 在主机和客户机上均可用,但 Ipv6 仅“有时”可用。它会运行几分钟,然后再次停止运行,直到我进行一些更改。
但是我实际上可以从主机和客户机 ping 主机和客户机。
host:~# ip -6 neigh
2a01:XXX:XXX:301::100:2 dev vmbr1 lladdr 00:50:56:00:00:e0 REACHABLE
2a01:XXX:XXX:300::1 dev vmbr1 lladdr 00:26:88:76:18:18 router STALE
host:~# ip -6 route
2a01:XXX:XXX:300::1 dev vmbr1 metric 1024 mtu 1500 advmss 1440 hoplimit 4294967295
2a01:XXX:XXX:301::/64 dev vmbr1 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
fe80::/64 dev vmbr0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
fe80::/64 dev eth0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
fe80::/64 dev vmbr1 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
fe80::/64 dev tap101i1d0 proto kernel metric 256 mtu 1500 advmss 1440 hoplimit 4294967295
default via 2a01:XXX:XXX:300::1 dev vmbr1 metric 1024 mtu 1500 advmss 1440 hoplimit 4294967295
有人知道为什么它不起作用吗?有没有办法从同一个子网配置多个 v6 IP,以便我可以将 IP 专用于具有多个虚拟主机的服务器上的网站?
答案1
答案2
如果主机是来宾的路由器,则必须在主机上安装、配置并运行 radvd。要使此操作正常进行,不要过滤/丢弃邻居发现数据包。否则,客户机将看不到默认路由。您也可以手动配置默认路由,但这很繁琐,而且容易出错。
附录:不要忘记在主机上启用转发并允许使用 ip6tables 进行数据包转发。
答案3
我会尝试以最简单的方式进行设置……
对于主机:
iface vmbr1 inet6 static
address 2a01:XXX:XXX:301::2
netmask 59
router 2a01:XXX:XXX:300::1
对于客人:
iface eth0 inet6 static
pre-up modprobe ipv6
address 2a01:XXX:XXX:301::2:2
netmask 59
router 2a01:XXX:XXX:300::1