I have to connect multiple, potentially hundrets of networks (branch offices) with overlapping network ranges to a single "core" network using OpenVPN. I wonder if there is a tool that helps me statically mapping ipv4 addresses in a single ipv6 address range.
Let's say, I have four branch offices, with the following address ranges:
Location A: 192.168.1.x/24Location B: 192.168.1.x/24 (not a typo, same as A)Location C: 12.14.1.0/8
for any given ipv4 adress a.b.c.d
, I would like to "embed" it in it's own ipv6 range, for example 2a03:1000:{location}:ab:cd
(2a03:1000 randomly chosen for this example)
Location A would be mapped to 2a03:1000:0001::c0a8:01xx (c0=192, a8=168, 01=1, xx=host part)Location B would be mapped to 2a03:1000:0002::c0a8:01xx (c0=192, a8=168, 01=1, xx=host part)Location B would be mapped to 2a03:1000:0003::0c0c:0100 ^^^^ ^^^^^^^^^ | | | | ipv4 address range | | location or site id
I think you get the idea ... This way, the overlapping is no longer a problem since these are all unique valid ipv6 addresses. The communication inside each location is still ipv4, and to and from the ipv6 core network each location is identified by it location id as part of the ipv6 address.
As a result, I need routable ipv6 traffic between the core network and each site. It's not required to have traffic between the sites.
Can you give me a kind hint of this is possible and how to implement this using Linux tools such as iptables/nftables or any other software?
Thank you very much!