I have an http/https server which is IPv6 only. To allow people who have IPv4 only to reach it I would like to use a server in the middle with IPv4 address and forward traffic to the IPv6 server from there.

I know I could use socat or ssh for tunneling but I would like to know if it is also possible to use the firewall to translate from IPv4 to IPv6 and forward http and https traffic.

How would ufw or iptables rules for doing the forwarding look?

  • IPv4 and IPv6 are completely separate, incompatible protocols. It takes a lot more than simply replacing an IPv4 header with an IPv6 header, or vice versa. Transport protocols would also need to be fixed. – Ron Maupin Dec 3 '19 at 18:51
  • Port forwarding is something you do in a situation with NAPT. IPv6 does not have NAPT (the experimental RFC for NAT66 actually forbids that). – Ron Maupin Dec 3 '19 at 18:52

No UFW cannot do that, you must terminate and re-transmit (like with an nginx proxy or stunnel), you cannot use port mapping as you must rewrite the packet with IPv4/IPv6.

Example - Use Cloudflare - https://community.cloudflare.com/t/proxy-ipv4-visitors-to-ipv6-only-backend/115186

  • Cloudfare is a CDN (content delivery network). This is okay for public content, but not for dynamic personal and private content behind a login. But thanks for the answer. – ab0032 Dec 4 '19 at 23:45
  • 1
    lol? if it's publicly accessible, how is cloud flare not an option. – Jacob Evans Dec 5 '19 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.