# IPv6 can't ping local address



## JohnR (Dec 13, 2010)

I've been trying to setup IPv6 on my FreeBSD 7 box but for some reason I can't get it to work as I would have expected. I've gotten a few addresses from my hoster and trying to configure the box with the address 2a00:dd0:0:2::21

The outgoing connectivity works fine. If I ping the gateway I get this result:

```
[root@chno ~]# ping6 -c 10 2a00:dd0:0:2::1
PING6(56=40+8+8 bytes) 2a00:dd0:0:2::21 --> 2a00:dd0:0:2::1
16 bytes from 2a00:dd0:0:2::1, icmp_seq=0 hlim=64 time=0.435 ms
16 bytes from 2a00:dd0:0:2::1, icmp_seq=1 hlim=64 time=0.567 ms
16 bytes from 2a00:dd0:0:2::1, icmp_seq=2 hlim=64 time=0.457 ms
16 bytes from 2a00:dd0:0:2::1, icmp_seq=3 hlim=64 time=0.666 ms
16 bytes from 2a00:dd0:0:2::1, icmp_seq=4 hlim=64 time=0.989 ms
16 bytes from 2a00:dd0:0:2::1, icmp_seq=5 hlim=64 time=0.590 ms
16 bytes from 2a00:dd0:0:2::1, icmp_seq=6 hlim=64 time=0.827 ms
16 bytes from 2a00:dd0:0:2::1, icmp_seq=7 hlim=64 time=0.562 ms
16 bytes from 2a00:dd0:0:2::1, icmp_seq=8 hlim=64 time=0.617 ms
16 bytes from 2a00:dd0:0:2::1, icmp_seq=9 hlim=64 time=0.794 ms

--- 2a00:dd0:0:2::1 ping6 statistics ---
10 packets transmitted, 10 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.435/0.650/0.989/0.164 ms
```

If I try however to ping my own IP-address I get no reply

```
[root@chno ~]# ping6 -c 10 2a00:dd0:0:2::21
PING6(56=40+8+8 bytes) 2a00:dd0:0:2::21 --> 2a00:dd0:0:2::21

--- 2a00:dd0:0:2::21 ping6 statistics ---
10 packets transmitted, 0 packets received, 100.0% packet loss
```

I configured the IPv6 part in /etc/rc.conf like this:

```
ipv6_enable="YES"
ipv6_ifconfig_re0="2a00:dd0:0:2::21"
ipv6_defaultrouter="2a00:dd0:0:2::1"
```

The output of ifconfig looks pretty sane to me

```
[root@chno ~]# ifconfig -a
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
        ether 12:c6:93:60:e8:6f
        inet6 fe80::10c6:93ff:fe60:e86f%re0 prefixlen 64 scopeid 0x1 
        inet 94.228.215.88 netmask 0xffffff80 broadcast 94.228.215.127
        inet6 2a00:dd0:0:2::21 prefixlen 64 
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        inet6 ::1 prefixlen 128 
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 
        inet 127.0.0.1 netmask 0xff000000
```

The routing table looks pretty sane:

```
[root@chno ~]# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            94.228.215.1       UGS         0     2881    re0
94.228.215.0/25    link#1             UC          0        0    re0
94.228.215.1       00:0c:db:26:73:c0  UHLW        2        0    re0   1200
94.228.215.88      12:c6:93:60:e8:6f  UHLW        1      217    lo0
127.0.0.1          127.0.0.1          UH          0     3145    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRS        lo0 =>
default                           2a00:dd0:0:2::1               UGS         re0
::1                               ::1                           UHL         lo0
::ffff:0.0.0.0/96                 ::1                           UGRS        lo0
2a00:dd0:0:2::/64                 link#1                        UC          re0
2a00:dd0:0:2::1                   00:0c:db:26:73:c0             UHLW        re0
2a00:dd0:0:2::21                  12:c6:93:60:e8:6f             UHL         lo0
fe80::/10                         ::1                           UGRS        lo0
fe80::%re0/64                     link#1                        UC          re0
fe80::20c:dbff:fe26:73c0%re0      00:0c:db:26:73:c0             UHLW        re0
fe80::10c6:93ff:fe60:e86f%re0     12:c6:93:60:e8:6f             UHL         lo0
fe80::%lo0/64                     fe80::1%lo0                   U           lo0
fe80::1%lo0                       link#3                        UHL         lo0
ff01:1::/32                       link#1                        UC          re0
ff01:3::/32                       ::1                           UC          lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%re0/32                     link#1                        UC          re0
ff02::%lo0/32                     ::1                           UC          lo0
```

But everything on re0 seems to get blocked. I have a firewall enabled but the rules state

```
IPF="ipfw -q add"
ipfw -q -f flush

#loopback
$IPF 10 allow all from any to any via lo0
$IPF 20 deny all from any to 127.0.0.0/8
$IPF 30 deny all from 127.0.0.0/8 to any
$IPF 40 deny tcp from any to any frag

# statefull
$IPF 50 check-state
$IPF 60 allow tcp from any to any established
$IPF 70 allow all from any to any out keep-state
$IPF 80 allow icmp from any to any

# open port ftp (20,21), ssh (22), mail (25)
# http (80), dns (53) etc
$IPF 130 allow tcp from any to any 22 in
$IPF 150 allow tcp from any to any 25 in
$IPF 161 allow tcp from any to any 110 in
$IPF 163 allow tcp from any to any 143 in
$IPF 170 allow udp from any to any 53 in
$IPF 175 allow tcp from any to any 53 in
$IPF 200 allow tcp from any to any 80 in
$IPF 211 allow tcp from any to any 443 in

# deny and log everything
$IPF 500 deny log all from any to any
```

The version I'm running is the 7.2 release

I've been almost banging my head against my desk over this one since I really can't figure out what might be the problem. Any help would be greatly appreciated.


----------



## SirDice (Dec 14, 2010)

You're missing the prefix in your ipv6_ifconfig statement.


----------



## JohnR (Dec 14, 2010)

I added the prefixlen (which should default to 64 if I'm not mistaking but still nothing. The other strange thing is, I can't ping my net local address too. 

```
[root@chno ~]# ping6 -c10 fe80::10c6:93ff:fe60:e86f%re0
PING6(56=40+8+8 bytes) fe80::10c6:93ff:fe60:e86f%re0 --> fe80::10c6:93ff:fe60:e86f%re0

--- fe80::10c6:93ff:fe60:e86f%re0 ping6 statistics ---
10 packets transmitted, 0 packets received, 100.0% packet loss
```
Another strange thing I noticed is when I ping the gateway, or any other address after there hasn't been traffic for a while, the first 4-6 pings get a timeout. If the traffic keeps flowing (the ping keeps running) the connection remains rocksolid.


----------



## SirDice (Dec 14, 2010)

Check your firewall. IPv6 works fine.


```
dice@molly:~>uname -a
FreeBSD molly.dicelan.home 8.1-STABLE FreeBSD 8.1-STABLE #0: Tue Oct 12 19:29:31 CEST 2010     root@molly.dicelan.home:/usr/obj/usr/src/sys/MOLLY8  i386
dice@molly:~>ifconfig -a
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 00:1e:e5:d8:98:78
        inet 192.168.1.190 netmask 0xffffff00 broadcast 192.168.1.255
        inet6 fe80::21e:e5ff:fed8:9878%re0 prefixlen 64 scopeid 0x1
        inet6 2001:888:1c5b::190 prefixlen 64
        inet 192.168.1.191 netmask 0xffffffff broadcast 192.168.1.191
        inet 192.168.1.192 netmask 0xffffffff broadcast 192.168.1.192
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
rl0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=3808<VLAN_MTU,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
        ether 00:01:6c:1d:18:12
        media: Ethernet autoselect
        status: no carrier
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet 127.0.0.1 netmask 0xff000000
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
        nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
dice@molly:~>ping6 2001:888:1c5b::190
PING6(56=40+8+8 bytes) 2001:888:1c5b::190 --> 2001:888:1c5b::190
16 bytes from 2001:888:1c5b::190, icmp_seq=0 hlim=64 time=0.097 ms
16 bytes from 2001:888:1c5b::190, icmp_seq=1 hlim=64 time=0.080 ms
^C
--- 2001:888:1c5b::190 ping6 statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.080/0.088/0.097/0.009 ms

dice@molly:~>ping6 2001:888:1c5b::1
PING6(56=40+8+8 bytes) 2001:888:1c5b::190 --> 2001:888:1c5b::1
16 bytes from 2001:888:1c5b::1, icmp_seq=0 hlim=64 time=0.289 ms
16 bytes from 2001:888:1c5b::1, icmp_seq=1 hlim=64 time=0.307 ms
16 bytes from 2001:888:1c5b::1, icmp_seq=2 hlim=64 time=0.321 ms
^C
--- 2001:888:1c5b::1 ping6 statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.289/0.306/0.321/0.013 ms
```


----------



## JohnR (Dec 14, 2010)

*Solved*

It was indeed the firewall, thanks for the big help. I completely overlooked the fact I had to open up icmp6 in my ipfw config. I added the line 

```
$IPF 85 allow icmp6 from any to any
```
and it works like a charm


----------

