# native ipv6

## elmar283

XS4ALL (a Dutch internet provider) is now providing native ipv6. 

I'm using a Gentoo router, dhcp and squid / iptables server. I would like to make it ipv6 ready. 

I have already compiled the kernel width ipv6 support, put ipv6 on my useflags on '/etc/make.conf' and did an 'emerge -aDNuv @world'.

Just to show that native ipv6 is working on my network without the router:

```

arthurdent:Library elmarotter$ ping6 -c 3 ipv6.google.com

PING6(56=40+8+8 bytes) 2001:980:48ca:1:e480:f55a:6e30:b186 --> 2a00:1450:4007:801::1012

16 bytes from 2a00:1450:4007:801::1012, icmp_seq=0 hlim=54 time=57.560 ms

16 bytes from 2a00:1450:4007:801::1012, icmp_seq=1 hlim=54 time=40.766 ms

16 bytes from 2a00:1450:4007:801::1012, icmp_seq=2 hlim=54 time=57.183 ms

--- ipv6.l.google.com ping6 statistics ---

3 packets transmitted, 3 packets received, 0.0% packet loss

round-trip min/avg/max/std-dev = 40.766/51.836/57.560/7.829 ms

arthurdent:Library elmarotter$ 
```

On my Gentoo router I'm not so lucky. 

```
elmarotter@masterserver ~ $ ping

elmarotter@masterserver ~ $ ping6 -c 3 ipv6.google.com

connect: Network is unreachable
```

However the network seems to be up:

```
elmarotter@masterserver ~ $ sudo ip -6 a

Wachtwoord: 

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 

    inet6 ::1/128 scope host 

       valid_lft forever preferred_lft forever

4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000

    inet6 fe80::2c0:9fff:fe47:8b46/64 scope link 

       valid_lft forever preferred_lft forever

5: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000

    inet6 fe80::20e:35ff:fe45:e757/64 scope link 

       valid_lft forever preferred_lft forever
```

On the internet there is a lot of informatie on how to make an ipv6 tunnel, but almost nothing about how to make a native connection.

Can anyone help me make this connection?

I also would like to configure an ipv6 dhcp-server, firewal (ip6tables) and proxy (squid). The ipv4 verslons are running ok.

----------

## Ant P.

Seems like your router doesn't know its own routes. What does `/sbin/ip -6 r` say? (on both machines)

----------

## elmar283

On my router it says:

```

elmarotter@masterserver ~ $ sudo ip -6 r

Wachtwoord: 

fe80::/64 dev eth1  proto kernel  metric 256 

fe80::/64 dev eth0  proto kernel  metric 256 
```

Directly to my Fritzbox I don't know because I use MacOSX Lion, and it doesn't have ip.

Edit: To be clear, my setup:

I have an MacBook width OSX Lion. That computer connects to an airport Extreme, that connects to my Gentoo Linux route, that connects throug wifi to my Fritzbox, that connects to my ISP (XS4ALL).

To know wether or not there is an ipv6 connection I connect directly to my FritzBox. And the result is that evertyting works fine. The question is about the router.

Edit2:

```

elmarotter@masterserver ~ $ sudo ifconfig

Wachtwoord: 

eth0      Link encap:Ethernet  HWaddr 00:c0:9f:47:8b:46  

          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::2c0:9fff:fe47:8b46/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:603790 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1501050 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:59397122 (56.6 MiB)  TX bytes:2114165835 (1.9 GiB)

          Interrupt:6 

eth1      Link encap:Ethernet  HWaddr 00:0e:35:45:e7:57  

          inet addr:192.168.178.28  Bcast:192.168.178.255  Mask:255.255.255.0

          inet6 addr: fe80::20e:35ff:fe45:e757/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1632657 errors:342 dropped:342 overruns:0 frame:0

          TX packets:1774212 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:585918291 (558.7 MiB)  TX bytes:969725419 (924.8 MiB)

          Interrupt:10 Memory:d0208000-d0208fff 

lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:13845 errors:0 dropped:0 overruns:0 frame:0

          TX packets:13845 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:17586583 (16.7 MiB)  TX bytes:17586583 (16.7 MiB)

```

----------

## NeddySeagoon

elmar283,

```
$ ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 212.110.180.12  netmask 255.255.255.0  broadcast 212.110.180.255

        inet6 2001:41c8:123:112::2  prefixlen 64  scopeid 0x0<global>

        inet6 fe80::216:3eff:fe7f:1d63  prefixlen 64  scopeid 0x20<link>
```

IP6 sddresses beginning fe80 are not routable. They are the equivelent of IPv4 link local addresses.

They do have global scope, as do all IPv6 addresses but they are deliberately dropped by routers.

You need an IPv6 address that has  scopeid 0x0<global>.

----------

## elmar283

How do I set my network on Gentoo so I'll get a propper ipv6 ip-address? Do I need to set something on '/etc/conf.d/net'?

My OSX computer when connected directly on the Fritzbox does get a propper ipv6 address:

```
arthurdent:Library elmarotter$ ifconfig

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384

   options=3<RXCSUM,TXCSUM>

   inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 

   inet 127.0.0.1 netmask 0xff000000 

   inet6 ::1 prefixlen 128 

   inet6 fd2e:2a2c:cfea:6368:21e:c2ff:fe1b:7796 prefixlen 128 

gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280

stf0: flags=0<> mtu 1280

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

   options=2b<RXCSUM,TXCSUM,VLAN_HWTAGGING,TSO4>

   ether 00:1e:c2:1b:77:96 

   media: autoselect

   status: inactive

en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

   ether 00:1e:c2:ac:d5:79 

   inet6 fe80::21e:c2ff:feac:d579%en1 prefixlen 64 scopeid 0x5 

   inet 192.168.178.24 netmask 0xffffff00 broadcast 192.168.178.255

   inet6 2001:980:48ca:1:21e:c2ff:feac:d579 prefixlen 64 autoconf 

   inet6 2001:980:48ca:1:486d:28a4:278e:8330 prefixlen 64 autoconf temporary 

   media: autoselect

   status: active

fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 2030

   lladdr 00:1f:5b:ff:fe:28:35:7a 

   media: autoselect <full-duplex>

   status: inactive

vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

   ether 00:50:56:c0:00:01 

   inet 192.168.147.1 netmask 0xffffff00 broadcast 192.168.147.255

vmnet8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500

   ether 00:50:56:c0:00:08 

   inet 172.16.233.1 netmask 0xffffff00 broadcast 172.16.233.255

utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380

   inet6 fe80::21e:c2ff:fe1b:7796%utun0 prefixlen 64 scopeid 0x9 

   inet6 fd00:6587:52d7:f8f7:21e:c2ff:fe1b:7796 prefixlen 64 

```

----------

## elmar283

I think I now have a right ipv6 address for eth1.

```

elmarotter@masterserver ~ $ sudo ip -6 addr 

Wachtwoord: 

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 

    inet6 ::1/128 scope host 

       valid_lft forever preferred_lft forever

3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000

    inet6 fe80::2c0:9fff:fe47:8b46/64 scope link 

       valid_lft forever preferred_lft forever

4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000

    inet6 2001:980:48ca:1:20e:35ff:fe45:e757/64 scope global dynamic 

       valid_lft 5835sec preferred_lft 2235sec

    inet6 fe80::20e:35ff:fe45:e757/64 scope link 

       valid_lft forever preferred_lft foerier

```

No I have to put in an ip-address for eth0 in '/etc/conf.d/net'  This is the file now:

```

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /usr/share/doc/openrc/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

dns_domain_lo="eotter1979.xs4all.nl"

config_eth0="192.168.0.1 netmask 255.255.255.0 brd 192.168.0.255"

#routes_eth0="default via 192.168.0.1"

dns_servers_eth0="192.168.0.1"

associate_timeout_eth0=60

dhcp_eth0="nontp"

#gateways_eth1="192.168.178.1"

iwconfig_eth1="mode managed"

modules_eth1="wpa_supplicant dhclient"

wpa_supplicant_eth1="-Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf"

wpa_timeout_eth1=60

associate_timeout_eht1=60

dhcp_Earth="release nodns nontp"

dhcp_eth1="release nodns nontp"

```

What address should I add? on eth0 and how do I setup 'dhcpd' so my MacBook and Airport Extreme gets the right ipv6 addresses[/code]?

----------

## mtfj

Hi, are you... still struggling to enable ipv6 on your gentoo router?

I've recently built a gentoo router from scratch enabling both ipv6 and ipv4 dual stack and it took me a few weeks to configure.

(I wanted my gentoo mirror ipv6 enabled by world ipv6 launch and put it in the list).

I assume you have a network like this.

PCs <-> gentoo router <-> Filtzbox (assuming some sort of modem or stb) <-> Internet

First, you need to find out how your isp (xs4all?) distributes ipv6 networks/addresses to you.

it's either RA (router advertisement) or DHPCv6.

I don't know how exactly Flitzbox works here, but assuming it sends (or passes through) RA. That is the reason why your eth1@gentoo router obtained ipv6 without installing dibbler. I guess it is 2001:980:48ca:1::/64. You can confirm this by installing net-misc/radvd and execute radvdump. you will see an advertisement like 

```

~ # radvdump

#

# radvd configuration generated by radvdump 1.8.5

# based on Router Advertisement from fe80::6a05:caff:fe05:967a

# received by interface eth1

#

interface eth1

{

        AdvSendAdvert on;

        # Note: {Min,Max}RtrAdvInterval cannot be obtained with radvdump

        AdvManagedFlag off;

        AdvOtherConfigFlag on;

        AdvReachableTime 0;

        AdvRetransTimer 0;

        AdvCurHopLimit 64;

        AdvDefaultLifetime 30;

        AdvHomeAgentFlag off;

        AdvDefaultPreference medium;

        AdvSourceLLAddress on;

        prefix 2001:980:48ca:1::/64

        {

                AdvValidLifetime 30;

                AdvPreferredLifetime 20;

                AdvOnLink on;

                AdvAutonomous on;

                AdvRouterAddr off;

        }; # End of prefix definition

}; # End of interface definition

```

Based on this info, you can decide how you would like to distribute your ipv6 addresses from gentoo router to your network. I am using radvd to configure addresses/default route and dibbler-server to configure dns servers.

----------

