Hetzner ipv6: Difference between revisions

From TykWiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 16: Line 16:
This means I can add the line <code>ipv6_defaultrouter="fe80::7afe:3dff:fe46:ec8f%em0"</code> to <code>/etc/rc.conf</code> and IPv6 works.
This means I can add the line <code>ipv6_defaultrouter="fe80::7afe:3dff:fe46:ec8f%em0"</code> to <code>/etc/rc.conf</code> and IPv6 works.


== Using static NDP (not recommended) ==
'''Note: Is seems that Hetzner has decided (finally) to add fe80::1 to all their routers, so the ipv6 gateway is fe80::1%interface no matter which datacenter you are in. This has the added advantage that the gateway IP doesn't change if they change the hardware (a normal link-local fe80:: IP is constructed from the mac-address of the interface).


This is for rc.conf:
In the datacenters where they already made this change, pinging ff02::2%interface looks like this:
<pre>
<pre>
### v6 extra config due to weird v6 setup at hetzner
[tykling@haze ~]$ ping6 ff02::2%re0
ipv6_static_routes="gw"
PING6(56=40+8+8 bytes) fe80::4261:86ff:fee9:d063%re0 --> ff02::2%re0
ipv6_route_gw="2a01:4f8:141:52a0::1 -iface re0"
16 bytes from fe80::1%re0, icmp_seq=0 hlim=64 time=2.383 ms
static_ndp_pairs="gw"
16 bytes from fe80::1%re0, icmp_seq=1 hlim=64 time=1.072 ms
static_ndp_gw="2a01:4f8:141:52a0::1 0:26:88:75:e7:95"
^C
v6_network_extra_enable="YES"
--- ff02::2%re0 ping6 statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.072/1.728/2.383/0.656 ms
 
[tykling@haze ~]$
</pre>
</pre>


Replace my values with your ipv6 default gateway's IP and mac address.
Thanks to Hetzner for realizing that their IPv6 network setup was causing problems for customers, and taking appropriate steps to rectify the situation.
 
You also need two rc.d scripts: <code>/etc/rc.d/static_ndp</code> (included in base from FreeBSD 9, if you need it find it [http://svn.freebsd.org/base/head/etc/rc.d/static_ndp here]). The other script, <code>/usr/local/etc/rc.d/v6_network_extra</code> is not included in FreeBSD (yet), it looks like this:
<pre>
#!/bin/sh
#
# ipv6 tunnels and default router
#
# PROVIDE: v6_network_extra
# REQUIRE: NETWORKING static_ndp
# KEYWORD: nojail
 
. /etc/rc.subr
 
name="v6_network_extra"
start_cmd="v6_network_extra_start"
 
v6_network_extra_start()
{     
        /sbin/route -n add -inet6 default 2a01:4f8:141:52a0::1
        /etc/rc.d/static_ndp restart
}
load_rc_config $name
run_rc_command "$1"
</pre>
'''Remember to change your default gateway in this script, and remember to chmod +x the script.'''

Revision as of 12:21, 10 October 2012

With Hetzner IPv6 you get a default gateway that is outside your own subnet. This can be rather frustrating to configure with FreeBSD, so I just use the link-local address of the router instead.

Using the routers fe80:: address

$ ping6 ff02::2%em0
PING6(56=40+8+8 bytes) fe80::ea40:f2ff:fe09:be0%em0 --> ff02::2%em0
16 bytes from fe80::7afe:3dff:fe46:ec8f%em0, icmp_seq=0 hlim=64 time=3.470 ms
16 bytes from fe80::7afe:3dff:fe46:ec8f%em0, icmp_seq=1 hlim=64 time=1.033 ms
^C
--- ff02::2%em0 ping6 statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.033/2.252/3.470/1.218 ms

$ 

This means I can add the line ipv6_defaultrouter="fe80::7afe:3dff:fe46:ec8f%em0" to /etc/rc.conf and IPv6 works.

Note: Is seems that Hetzner has decided (finally) to add fe80::1 to all their routers, so the ipv6 gateway is fe80::1%interface no matter which datacenter you are in. This has the added advantage that the gateway IP doesn't change if they change the hardware (a normal link-local fe80:: IP is constructed from the mac-address of the interface).

In the datacenters where they already made this change, pinging ff02::2%interface looks like this:

[tykling@haze ~]$ ping6 ff02::2%re0
PING6(56=40+8+8 bytes) fe80::4261:86ff:fee9:d063%re0 --> ff02::2%re0
16 bytes from fe80::1%re0, icmp_seq=0 hlim=64 time=2.383 ms
16 bytes from fe80::1%re0, icmp_seq=1 hlim=64 time=1.072 ms
^C
--- ff02::2%re0 ping6 statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.072/1.728/2.383/0.656 ms

[tykling@haze ~]$

Thanks to Hetzner for realizing that their IPv6 network setup was causing problems for customers, and taking appropriate steps to rectify the situation.