大网数据广告活动
服务器运维问答

IPv6 forwarding seems to only work in one direction

· 52CE 我爱测

I now know the answer: I did a bad mistake and did not even tell you. There was also a running radvd for router advertisment and instead of RA'ing a 64-net I was RA'ing a 56-net. So the router and/or the gateway always asked a wh…

问题原文

原帖链接 · Kev Inski · CC BY-SA 3.0

I now know the answer: I did a bad mistake and did not even tell you. There was also a running radvd for router advertisment and instead of RA'ing a 64-net I was RA'ing a 56-net. So the router and/or the gateway always asked a who has... solicitation message, which means that it thought it is in the same subnet as the ping'ed server.

I am playing around with some IPv6 routing and addresses and facing a weird problem and can't figure out. I can only ping from one direction but not the other way around.

Let's say I have 3 PC's and a router:

Client[eth0] <---> [lan1]Router[wan] <---> [box0]Gateway[eth0] <---> [eth0]Server

The Client, Gateway and Server are LXC Container and are working totally fine with IPv4!

The Gateway is running a DHCPv6 server which delegates a prefix (2001:db8:0:1::/56) through interface box0 so the router gets an IP-address (2001:db8:0:1:8856:7cf8:8e46:d8cb) and the client configures itself.

The interface box0 on the gateway has a static IP from the same subnet: 2001:db8:0:1::1234:1.

The interface eth0 on the gateway has a static IP from another subnet: 2001:db8:0:2::4321:1. See the changed 2 in the prefix.

The interface eth0 of the server has a static IP from the same subnet as eth0@gateway has: 2001:db8:0:2::4321:2

I first enabled IPv6 forwarding with

sysctl net.ipv6.conf.all.forwarding=1

Now I did set up a route on the gateway which leads into the /56 subnet

ip -6 route add 2001:db8:0:1::/56 via 2001:db8:0:1:8856:7cf8:8e46:d8cb

And a default route for the server

ip -6 route add default via 2001:db8:0:2::4321:1

My Problem is: I can ping everything from the server side (except the client because the router blocks it) but I'm unable to ping anything behind eth0@gateway from the router side.

Did you encounter this, for me, strange behaviour? Do you need further information, like routing table etc.?

已采纳解答

原帖链接 · Kev Inski · CC BY-SA 3.0

The answer is pretty simple and is traced back to missconfiguration.

There was also a running radvd for router advertisement and instead of RA'ing a 64-net I was RA'ing a 56-net. So the router and/or the gateway always asked a who has... solicitation message, which means that it thought it is in the same subnet as the ping'ed server.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-08-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。