0

I have a subnet like 2001:face:feed:beef::/64. I want to assign all of them to my server, without manually assign every address like 2001:face:feed:beef::[123456789abcdef]...

In ipv4, we may use DNAT to do this, but it doesn't have NAT concept in ipv6, so I want to know if this is workable and does it have some workarounds.

Tydus
  • 11

2 Answers2

7

You can't (with a run-of-the-mill IP stack). IP addressing isn't intended to work like that. You almost certainly won't even be able to assign anywhere near that many addresses to an interface (using a script or similar); there'll be hard-coded limits in the data structures somewhere to stop that sort of thing from happening.

womble
  • 95,029
  • 29
  • 173
  • 228
0

Answered in 209203 and 236626.

In short, you need three things:

  1. A static route to your machine (it won't answer NDP)
  2. An internal route so the machine knows it should handle the traffic
  3. If you want to be able to listen on any of these addresses, you must also set sysctl net.ipv6.ip_nonlocal_bind=1 (Linux kernel >= 4.3)
jornane
  • 1,096
  • 1
  • 8
  • 25