core icon indicating copy to clipboard operation
core copied to clipboard

Stateless NAT64 and DNS64 support

Open dsbaars opened this issue 11 years ago • 35 comments

I have the need for a IPv6-only network. Unfortunately, you still need to be able to connect to IPv4 hosts to visit most sites on the internet, this can be done using nat64. It would be nice to have this feature in OPNsense.

This is possible using NAT64 and DNS64

  • For NAT64 a possibile solution is tayga
  • For DNS64 there are several options:

Unfortunately, dnsmasq does not support dns64 yet.

nat64-tayga-mock

dsbaars avatar May 06 '15 15:05 dsbaars

I was experimenting with this at some point, TOTD sort of worked but overall it sucked. Not tried tayga. Would love to see this in opnsense eventually.

sjorge avatar Jun 23 '15 22:06 sjorge

We'd need pf(4) support for this in order to drop in nicely.

fichtner avatar Feb 16 '16 05:02 fichtner

I am also in need of this feature, Apple has made it a requirement for submission of Apps to their store (as of June 2016) that they support IPv6 only networks, they currently suggest supporting IPv4 via NAT64/DNS64 hence requirement of this feature so i can make an IPv6 Only network that can still do IPv4 Traffic. Any one aware how this can currently be achieved until this feature is added?

AtomiclyCursed avatar Jun 25 '16 10:06 AtomiclyCursed

Hi, I would very much appreciate that the NAT64 and DNS64 are available under opnsens. Currently we have a Debian with Tayga for NAT and Bind for DNS, but we would prefer to put it in a opnsense.

pierrehenrymuller avatar May 31 '17 09:05 pierrehenrymuller

note that there is an old ticket about that: https://github.com/opnsense/plugins/issues/16

fabianfrz avatar May 31 '17 09:05 fabianfrz

Wikipedia says that PF can do NAT64 since OpenBSD 5.1 (https://de.wikipedia.org/wiki/NAT64#Unterst.C3.BCtzung) If PF in FreeBSD is not too old, it may support it as well.

fabianfrz avatar May 31 '17 10:05 fabianfrz

FreeBSD doesn't support NAT64 in PF unfortunately, otherwise it probably was implemented already.

There seems to be progress on the ipfw side, but as far as I know, nobody is working on NAT64 in PF on FreeBSD. A plugin for Tayga is probably the only viable option at the moment, which is where ticket https://github.com/opnsense/plugins/issues/16 comes in. Although kernel level support (preferably in PF) would be better.

Adding Tayga to our ports collection might be an option, but we have to ask @fichtner about that, but in that case you have to configure it manually.

AdSchellevis avatar May 31 '17 10:05 AdSchellevis

sure https://github.com/opnsense/tools/commit/d2a6720d8

fichtner avatar May 31 '17 10:05 fichtner

@fichtner thanks! one stupid question, is Sixxs out of support?

AdSchellevis avatar May 31 '17 10:05 AdSchellevis

Yes: https://www.sixxs.net/sunset/

EOL: 2017-06-06

fichtner avatar May 31 '17 10:05 fichtner

I totally forgot, thanks!

AdSchellevis avatar May 31 '17 10:05 AdSchellevis

timeout (+ duplicate https://github.com/opnsense/plugins/issues/16 )

AdSchellevis avatar Oct 15 '17 15:10 AdSchellevis

if i am not mistaking, we are now based on hardenedbsd, which supports nat64? if so, will we be seeing this functionality come natively to opnsense? (need it to easily manage my network when going ipv6 with a provider that changes wan prefix almost daily)

thutex avatar Jan 17 '20 07:01 thutex

If there's a volunteer to test with such a setup I can try to build a plugin with tayga .. but no promise for success

mimugmail avatar Jan 17 '20 08:01 mimugmail

i should be able to test it if needed

thutex avatar Jan 17 '20 08:01 thutex

@dsbaars @pierrehenrymuller sorry for bothering you, which bits did you set in BIND for DNS64? As it's also available I have to add some stuff there too.

mimugmail avatar Jan 17 '20 09:01 mimugmail

Natively ipfw supports nat64 in both stateful and stateless modes, but since we use pf as our main firewall, it’s always the question how well those two play together.

A nice sample of both options can be found here: https://bsdrp.net/documentation/examples/nat64

Unfortunately pf only supports nat64 on openbsd (https://man.openbsd.org/pf.conf#af-to)

AdSchellevis avatar Jan 17 '20 10:01 AdSchellevis

@AdSchellevis I had a quick look at tayga, most annoying thing is missing rc script, but it's not the first plugin where I had to add one. :)

mimugmail avatar Jan 17 '20 16:01 mimugmail

@mimugmail startup scripts usually aren’t the challenge indeed😊 I haven’t tried any of the options, but if ipfw is easier to add, we might also consider adding it to core if someone wants to try out the rules first.

AdSchellevis avatar Jan 17 '20 17:01 AdSchellevis

I'd say we start with a plugin, if adaoption rate is good we can still try ipfw (mostly performance-wise I'd guess).

mimugmail avatar Jan 19 '20 06:01 mimugmail