Page 1 of 1

NAT for protocol 41 (ipv6 encapsulation) working?

Posted: Mon May 23, 2016 4:21 pm
by Adri
I am trying to setup a 6in4 tunnel to Hurricane Electrics tunnel broker.
Using stock firmware on a Netgear WNDR3700v1, this works fine with my local ipv4 address of 192.168.1.3. The stock firmware automatically does NAT for protocol 41 and is based on a very old version of OpenWRT.

Using the exact same tunnel with Gargoyle 1.9.x (from ispysail), I can't get the tunnel to work.
Every ping and other packet gets a 'Destination port unreachable.' error from the other end of the tunnel.
This seems to be because the outgoing protocol 41 packets don't have their local address replaced with the public address of the WAN interface by Gargoyle.
For normal ipv4 packets, NAT works fine.

Does anyone have an idea how to setup a 6in4 tunnel from the local net behind Gargoyle?
Would the OpenWRT method https://wiki.openwrt.org/doc/uci/network6 for a 6in4 tunnel be possible on Gargoyle?

Re: NAT for protocol 41 (ipv6 encapsulation) working?

Posted: Mon May 23, 2016 4:42 pm
by Lantis
All IPv6 related protocols and software is stripped from gargoyle. You'd need to install them and set them up from the command line.
Yes most setups applicable to openwrt work on gargoyle.

Re: NAT for protocol 41 (ipv6 encapsulation) working?

Posted: Tue May 24, 2016 6:57 am
by Adri
6in4 packets for the tunnel are encapsulated in ipv4 IP packets, using protocol type 41.
This means for gargoyle and NAT, it is just a normal ipv4 IP packet, except with a different type.

How is the NAT handled in Gargoyle?
If I can add the extra protocol type to the standard NAT, I don't need any ipv6 support from Gargoyle to get the tunnel running.
Only when Gargoyle needs to setup the tunnel and forward ipv6, would I need to install all the ipv6 modules and setup from the command line.
I would prefer to just make the NAT working.

Re: NAT for protocol 41 (ipv6 encapsulation) working?

Posted: Tue May 24, 2016 7:13 am
by Lantis
The first paragraph in the wiki you linked says that 6in4 needs to be installed.
In openwrt it is now default.
In gargoyle these are all stripped out. That is what I'm referring to.
I think without these packages gargoyle won't understand what protocol 41 is or how to identify it.

But, it sounds like you know more about it than I. Just give it a go.
You can't really break anything.

In general, any wiki for openwrt works for gargoyle

Re: NAT for protocol 41 (ipv6 encapsulation) working?

Posted: Tue May 24, 2016 11:02 am
by Adri
Lantis,

Before I go the route of installling all ipv6 modules and configuring the tunnel on Gargoyle, I'd like to try geting the NAT working first.
All that is needed for this is generic ipv4 support. no special modules etc are needed, everything is in the kernel with ipv4.

Can you point me to the relevant config files or modules which handle ipv4 NAT in gargoyle?
Is it iptables or some other module?

Thanks,

Adri.

Re: NAT for protocol 41 (ipv6 encapsulation) working?

Posted: Tue May 24, 2016 4:41 pm
by Lantis
I think NAT is handled by the netfilter module for the firewall.
And most firewall things are handled by iptables

Re: NAT for protocol 41 (ipv6 encapsulation) working?

Posted: Wed May 25, 2016 3:39 am
by Adri
Thanks,

I'll have a look at the netfilter configuration and see if it can be adapted.

Re: NAT for protocol 41 (ipv6 encapsulation) working?

Posted: Mon May 30, 2016 4:28 am
by Adri
It seems gargoyle is not really suited for IPV6.
Installing OpenWRT CC has IPV6 support out of the box and after installing the 6in4 package, setting up a tunnel is straight forward.

Re: NAT for protocol 41 (ipv6 encapsulation) working?

Posted: Mon May 30, 2016 4:31 am
by Lantis
I did say that lol. :roll: