# IPv6 Gateway doesn't work



## palej (Jun 2, 2014)

Hello all, could you please help understand what's wrong with setting up IPv6 GW.
FreeBSD 10, already configured as IPv4 GW based on PF NAT.
I get IPv6 address pool from my provider and seems, configured everything well.
From FreeBSD server I can ping everything via IPv6 (for example, ipv6.google.com), I can see dancing kame (http://www.kame.net).
My LAN computers get IPv6 addresses from FreeBSD server, when I ping each other by netBIOS name, I can see that they do that by IPv6 protocol. I'm working on server by SSH using it's IPv6 address, but can't get access to any resources outside server. It seems I missed something, but can't find what exactly. 
Few more things: 
1. If I ping ipv6.google.com from LAN, I can see outgoing packets on external server interface using tcpdump.
2. It seems, when I ping 
	
	



```
ping6 -I my_ext_if FF02::2
```
 I should see also my_ext_if link local address, but I can see only few neighbor routers.

Could you please help, what's wrong? 

Here is my configs:
/etc/rc.conf

```
### IPv6 ###
ipv6_activate_all_interfaces="YES"
ip6addrctl_enable="YES"
ip6addrctl_policy="ipv6_prefer"
ifconfig_em0_ipv6="inet6 2a03:7380:XXXX:YYYY::1 prefixlen 64"
ifconfig_re0_ipv6="inet6 2a03:7380:XXXX:ZZZZ::fffe prefixlen 64"
ipv6_defaultrouter="YES"
ipv6_defaultrouter="2a03:7380:XXXX:YYYY::fffe"
ipv6_gateway_enable="YES"
rtadvd_enable="YES"
rtadvd_interfaces="re0"
rtsold_enable="YES"
```

/etc/rtadvd.conf

```
re0:\
        :addrs#1:addr="2a03:7380:XXXX:ZZZZ::":prefixlen#64:tc=ether:
```

sysctl -a

```
kern.features.inet6: 1
net.inet6.ip6.forwarding: 1
net.inet6.ip6.redirect: 1
net.inet6.ip6.accept_rtadv: 0
```

pfctl -sr

```
- cut - 
pass quick on em0 proto ipv6-icmp all keep state
- cut -
pass in quick on em0 inet6 proto tcp from any to (em0) port = smtp flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = ni-ftp flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = domain flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = http flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = pop3 flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = smtps flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = submission flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = imaps flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = pop3s flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = pptp flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = 5005 flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = 5006 flags S/SA keep state
pass in quick on em0 inet6 proto tcp from any to (em0) port = 8100 flags S/SA keep state
pass in quick on em0 inet6 proto ipv6-icmp from any to (em0) icmp6-type routersol keep state
pass in quick on em0 inet6 proto ipv6-icmp from any to (em0) icmp6-type routeradv keep state
pass in quick on em0 inet6 proto ipv6-icmp from any to (em0) icmp6-type neighbrsol keep state
pass in quick on em0 inet6 proto ipv6-icmp from any to (em0) icmp6-type neighbradv keep state
pass in quick on em0 inet6 proto ipv6-icmp from any to (em0) icmp6-type redir keep state
pass in quick on em0 inet6 proto udp from any to (em0) port = domain keep state
pass in quick on em0 inet6 proto udp from any to (em0) port = ntp keep state
pass in quick on em0 inet6 proto udp from any to (em0) port = dhcpv6-client keep state
pass in quick on em0 inet6 proto ipv6-icmp all icmp6-type toobig keep state
pass in quick on em0 inet6 proto ipv6-icmp all icmp6-type echoreq keep state
```


----------



## SirDice (Jun 2, 2014)

What kind of address (range) did you get from your ISP, a /48 or /64?


----------



## palej (Jun 2, 2014)

I get /64 subnet: 2a03:7380:XXXX:ZZZZ::
as you can see, local interface on server is re0, configured as 2a03:7380:XXXX:ZZZZ::fffe
And for example, now, my local computer get from rtadvd address: 2a03:7380:XXXX:ZZZZ:f1f1:878a:ee88:e095


----------



## SirDice (Jun 2, 2014)

palej said:
			
		

> I get /64 subnet: 2a03:7380:XXXX:ZZZZ::


Then your em0 interface should have an address in that range, assuming that's your _external_ interface. And you probably have to split up the /64 into two segments to allow for routing between your internal and external interface.


----------



## palej (Jun 2, 2014)

sorry, your latest post isn't clear for me. Could you please check and compare configuration that I wrote above with settings that I get from provider:

```
Router IP: 2a03:7380:XXXX:YYYY::1
Router GW: 2a03:7380:XXXX:YYYY::fffe
your local network: 2a03:7380:XXXX:ZZZZ::/64
```
This is complete email from provider, nothing more.

And one more addon:
using http://www.subnetonline.com/pages/ipv6- ... 6-ping.php
I can ping both my router interfaces, but nothing in local subnet.


----------

