OpenWrt Forum Archive

Topic: trouble with IPv6 firewall

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

After upgrading to BARRIER BREAKER (14.07, r42625), I cannot get IPv6 via gw6c zu work. The gw6c and radvd parts are fine, and I can access IPv6 hosts from the router directly. In my LAN, IPv6 addresses are correctly assigned, but I cannot get a connection to the outside world. After some debugging, I see one obvious problem in the firewall (ip6tables):

Chain zone_lan_forward (1 references)
pkts bytes target     prot opt in     out     source               destination         
   37  3128 forwarding_lan_rule  all      *      *       ::/0                 ::/0                 /* user chain for forwarding */
   37  3128 zone_wan_dest_ACCEPT  all      *      *       ::/0                 ::/0                 /* forwarding lan -> wan */
   37  3128 zone_lan_dest_ACCEPT  all      *      *       ::/0                 ::/0

clearly doesn't make sense, note wan_dest, then lan_dest. It should be lan_src, I assume.

I changed this to add a -j ACCEPT as the third rule to circumvent the issue, but it seems only part of the problem.

I reset the counters and tried to establish a connection to see what other DROP or REJECT rules were hit, but found none.

This is the full output of ip6tables:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination         
   21  1440 delegate_input  all      *      *       ::/0                 ::/0               

Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination         
    8   640 delegate_forward  all      *      *       ::/0                 ::/0               

Chain OUTPUT (policy ACCEPT 3 packets, 312 bytes)
pkts bytes target     prot opt in     out     source               destination         
   66  5228 delegate_output  all      *      *       ::/0                 ::/0               

Chain delegate_forward (1 references)
pkts bytes target     prot opt in     out     source               destination         
    8   640 forwarding_rule  all      *      *       ::/0                 ::/0                 /* user chain for forwarding */
    0     0 ACCEPT     all      *      *       ::/0                 ::/0                 ctstate RELATED,ESTABLISHED
    0     0 DROP       all      *      *       ::/0                 ::/0                 ctstate INVALID
    7   560 zone_lan_forward  all      br-lan *       ::/0                 ::/0               
    0     0 zone_wan_forward  all      pppoe-wan *       ::/0                 ::/0               
    1    80 reject     all      *      *       ::/0                 ::/0               

Chain delegate_input (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all      lo     *       ::/0                 ::/0               
   21  1440 input_rule  all      *      *       ::/0                 ::/0                 /* user chain for input */
    0     0 ACCEPT     all      *      *       ::/0                 ::/0                 ctstate RELATED,ESTABLISHED
    0     0 DROP       all      *      *       ::/0                 ::/0                 ctstate INVALID
    0     0 syn_flood  tcp      *      *       ::/0                 ::/0                 tcp flags:0x17/0x02
   21  1440 zone_lan_input  all      br-lan *       ::/0                 ::/0               
    0     0 zone_wan_input  all      pppoe-wan *       ::/0                 ::/0               

Chain delegate_output (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all      *      lo      ::/0                 ::/0               
   66  5228 output_rule  all      *      *       ::/0                 ::/0                 /* user chain for output */
    9  1084 ACCEPT     all      *      *       ::/0                 ::/0                 ctstate RELATED,ESTABLISHED
    0     0 DROP       all      *      *       ::/0                 ::/0                 ctstate INVALID
   54  3832 zone_lan_output  all      *      br-lan  ::/0                 ::/0               
    0     0 zone_wan_output  all      *      pppoe-wan  ::/0                 ::/0               

Chain forwarding_lan_rule (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain forwarding_rule (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain forwarding_wan_rule (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain input_lan_rule (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain input_rule (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain input_wan_rule (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain output_lan_rule (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain output_rule (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain output_wan_rule (1 references)
pkts bytes target     prot opt in     out     source               destination         

Chain reject (3 references)
pkts bytes target     prot opt in     out     source               destination         
    1    80 REJECT     tcp      *      *       ::/0                 ::/0                 reject-with tcp-reset
    0     0 REJECT     all      *      *       ::/0                 ::/0                 reject-with icmp6-port-unreachable

Chain syn_flood (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 RETURN     tcp      *      *       ::/0                 ::/0                 tcp flags:0x17/0x02 limit: avg 25/sec burst 50
    0     0 DROP       all      *      *       ::/0                 ::/0               

Chain zone_lan_dest_ACCEPT (2 references)
pkts bytes target     prot opt in     out     source               destination         
   54  3832 ACCEPT     all      *      br-lan  ::/0                 ::/0               

Chain zone_lan_forward (1 references)
pkts bytes target     prot opt in     out     source               destination         
    7   560 forwarding_lan_rule  all      *      *       ::/0                 ::/0                 /* user chain for forwarding */
    7   560 zone_wan_dest_ACCEPT  all      *      *       ::/0                 ::/0                 /* forwarding lan -> wan */
    7   560 ACCEPT     all      *      *       ::/0                 ::/0               
    0     0 zone_lan_dest_ACCEPT  all      *      *       ::/0                 ::/0               

Chain zone_lan_input (1 references)
pkts bytes target     prot opt in     out     source               destination         
   21  1440 input_lan_rule  all      *      *       ::/0                 ::/0                 /* user chain for input */
   21  1440 zone_lan_src_ACCEPT  all      *      *       ::/0                 ::/0               

Chain zone_lan_output (1 references)
pkts bytes target     prot opt in     out     source               destination         
   54  3832 output_lan_rule  all      *      *       ::/0                 ::/0                 /* user chain for output */
   54  3832 zone_lan_dest_ACCEPT  all      *      *       ::/0                 ::/0               

Chain zone_lan_src_ACCEPT (1 references)
pkts bytes target     prot opt in     out     source               destination         
   21  1440 ACCEPT     all      br-lan *       ::/0                 ::/0               

Chain zone_wan_dest_ACCEPT (2 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all      *      pppoe-wan  ::/0                 ::/0               

Chain zone_wan_dest_REJECT (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 reject     all      *      pppoe-wan  ::/0                 ::/0               

Chain zone_wan_forward (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 forwarding_wan_rule  all      *      *       ::/0                 ::/0                 /* user chain for forwarding */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 128 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Forward */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 129 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Forward */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 1 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Forward */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 2 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Forward */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 3 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Forward */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 4 code 0 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Forward */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 4 code 1 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Forward */
    0     0 zone_wan_dest_REJECT  all      *      *       ::/0                 ::/0               

Chain zone_wan_input (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 input_wan_rule  all      *      *       ::/0                 ::/0                 /* user chain for input */
    0     0 ACCEPT     udp      *      *       fe80::/10            fe80::/10            udp spt:547 dpt:546 /* Allow-DHCPv6 */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 128 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 129 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 1 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 2 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 3 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 4 code 0 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 4 code 1 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 133 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 135 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 134 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     icmpv6    *      *       ::/0                 ::/0                 ipv6-icmptype 136 limit: avg 1000/sec burst 5 /* Allow-ICMPv6-Input */
    0     0 ACCEPT     tcp      *      *       ::/0                 ::/0                 tcp dpt:22 /* SSH */
    0     0 zone_wan_src_REJECT  all      *      *       ::/0                 ::/0               

Chain zone_wan_output (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 output_wan_rule  all      *      *       ::/0                 ::/0                 /* user chain for output */
    0     0 zone_wan_dest_ACCEPT  all      *      *       ::/0                 ::/0               

Chain zone_wan_src_REJECT (1 references)
pkts bytes target     prot opt in     out     source               destination         
    0     0 reject     all      pppoe-wan *       ::/0                 ::/0


Can anybody spot the problem?

Thanks,
Frank

I'm having more or less the same problem. Except that I'm seeing it directly after a `firstboot` (reset). I can `ping -6 google.com`, but not `ping6 google.com` from OS X. I have native IPv6 from XS4ALL.nl. I can visit IPv4 sites through the router. The router is a TP-LINK WDR4300.

According to OpenWRT documentation IPv6 routing should work out of the box. I'm running "BARRIER BREAKER (14.07, r42625)"

"net.ipv6.conf.all.forwarding=1" is in /etc/sysctl.conf

/etc/config/firewall looks sane, and is default (just reset the box).

I have the exact same problem as you Henk. Though my release is r41657.
My router can ping6 google.com. My Mac behind the router does not.

I might have a different setup since I have to use a cable router.

cable router <--- wdr3600 <--- Mac

I have native Dual Stack IPv6.

EDIT:// --------------------------------------------------------------------
I've deactivated my firewall and the problem still exists.

A few months back I tried already enabling ipv6 in my network. I remember that someone said it might be that router advertisements are not forwarded into the lan. In http://wiki.openwrt.org/doc/uci/network … ic.changes it says something similar. But checking for the listes options, they exist in my /etc/config/network

/proc/sys/net/ipv6/conf/all/forwarding is 1
and I use ip6assing within my lan area.

So this is my /etc/config/network:

config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

config globals 'globals'
    option ula_prefix '2a02:8071:2DC1:6a02::/60'

config interface 'lan'
    option ifname 'eth0.1'
    option force_link '1'
    option type 'bridge'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ip6assign '60'

config interface 'wan'
    option proto 'dhcp'
    option type 'bridge'
    option _orig_ifname 'eth0.2 wlan0 wlan1'
    option _orig_bridge 'true'
    option ifname 'eth0.2'

config interface 'wan6'
    option ifname '@wan'
    option proto 'dhcpv6'

config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

config switch_vlan
    option device 'switch0'
    option vlan '1'
    option ports '0t 2 3 4 5'

config switch_vlan
    option device 'switch0'
    option vlan '2'
    option ports '0t 1'

and my /etc/config/dhcp

config dnsmasq
    option domainneeded '1'
    option boguspriv '1'
    option filterwin2k '0'
    option localise_queries '1'
    option rebind_protection '1'
    option rebind_localhost '1'
    option local '/lan/'
    option domain 'lan'
    option expandhosts '1'
    option nonegcache '0'
    option authoritative '1'
    option readethers '1'
    option leasefile '/tmp/dhcp.leases'
    option resolvfile '/tmp/resolv.conf.auto'

config dhcp 'lan'
    option interface 'lan'
    option start '100'
    option limit '150'
    option leasetime '12h'
    option ra 'server'
    option dhcpv6 'server'
    option ra_management '1'

config dhcp 'wan'
    option interface 'wan'
    option ignore '1'

config odhcpd 'odhcpd'
    option maindhcp '0'
    option leasefile '/tmp/hosts/odhcpd'
    option leasetrigger '/usr/sbin/odhcpd-update'

(Last edited by deepblue881 on 5 Oct 2014, 14:46)

That tells us that 3 months ago it was already broken.

https://dev.openwrt.org/browser/trunk/t … ?rev=41657

Unless opkg packages for these revisions get updated later on.

Also, it might be that there is an incompatibility with OS X (Edit: same problem with Win10). Might also be something in the reset / firstboot. Or specific to the platform, WDR3600 is basically a WDR4300 (if I remember it correctly).

You'd say that somebody would have noticed in the mean time.

Edit: Installed a 'factory' image for good measure, openwrt-ar71xx-generic-tl-wdr4300-v1-squashfs-factory.bin. Didn't help.
Edit: Installed 14.07-rc1, same problem.
Edit: Installed 12.09, umount /overlay, firstboot. Does not appear to have IPv6. Also, 3.3.8 is too old for proper fq_codel, which I  want to use.

A similar issue by someone on XS4ALL (2001::) --> https://dev.openwrt.org/ticket/18031

It can apparently be fixed by `/etc/init.d/network restart`

Edit, does not fix it for me on 14.07, r42625

Tip for those testing: Confusing on OS X is that though IPv4 does follow network interface priorities (interface order in Network config panel), IPv6 will route around it if you are also connected to another network (ex: via WiFi). So connections through IPv4 will fail when highest prio (ethernet) is blocked, but IPv6 will go over your WiFi connection.

Edit: It looks like my OS X machine isn't getting a router for IPv6. But does get IPv6 addresses.

Same for me on 14.07, r42625  sad

Can`t ping IPv6 from My PC , but from router pings are OK for IPv6

`ifstatus wan6` on the openwrt box showed my FritzBox didn't hand out enough to do IPv6 delegation. I could reconfigure my Fritz!Box. Maybe something similar happens on your side.

Look for "ipv6-prefix", the "mask" value should be lower than 64.

If the problem is NOT caused by missing delegated-prefixes (i.e. prefixes are there and your clients have public addresses) but you are missing (default) routes instead this work-around my might help you (or not): https://dev.openwrt.org/changeset/42803

Also in any case please rant at your ISP for not getting IPv6 right.

Oh, I'm getting a /48 from my ISP, but AVM's Fritz!Box 7360 doesn't get it right.

This modem by default does not hand out IPv6 addresses & masks with enough room to do delegation. You can check on your openwrt box with ifstatus wan6. The "ipv6-prefix" will show a "mask" value of 64. It needs to be below 64.

If you follow this guide, the Fritz!Box will start handing out a mask of 62: http://en.avm.de/nc/service/fritzbox/fr … e-network/

Hmm I've checked your suggestion and get this for ifstatus wan6:

{
    "up": true,
    "pending": false,
    "available": true,
    "autostart": true,
    "uptime": 193488,
    "l3_device": "br-wan",
    "proto": "dhcpv6",
    "device": "br-wan",
    "metric": 0,
    "delegation": true,
    "ipv4-address": [
       
    ],
    "ipv6-address": [
        {
            "address": "xxxx:xxxx:2dc1:6a01:6670:2ff:fe5d:af08",
            "mask": 64,
            "preferred": 604784,
            "valid": 1209584
        }
    ],
    "ipv6-prefix": [
       
    ],
    "ipv6-prefix-assignment": [
       
    ],
    "route": [
        {
            "target": "xxxx:xxxx:2dc1:6a01::",
            "mask": 64,
            "nexthop": "::",
            "metric": 256,
            "valid": 1209584,
            "source": "::\/0"
        },
        {
            "target": "xxxx:xxxx:2dc1:6a00::",
            "mask": 56,
            "nexthop": "fe80::xxxx:7dff:fe45:367b",
            "metric": 1024,
            "valid": 1209584,
            "source": "xxxx:xxxx:2dc1:6a01:6670:2ff:fe5d:af08\/64"
        },
        {
            "target": "xxxx:xxxx:2dc1:6a00::",
            "mask": 56,
            "nexthop": "fe80::xxxx:7dff:fe45:367b",
            "metric": 1024,
            "valid": 1209584,
            "source": "::\/128"
        },
        {
            "target": "::",
            "mask": 0,
            "nexthop": "fe80::xxxx:7dff:fe45:367b",
            "metric": 1024,
            "valid": 1784,
            "source": "xxxx:xxxx:xxxx:6a01:6670:2ff:fe5d:af08\/64"
        },
        {
            "target": "::",
            "mask": 0,
            "nexthop": "fe80::xxxx:7dff:fe45:367b",
            "metric": 1024,
            "valid": 1784,
            "source": "::\/128"
        }
    ],
    "dns-server": [
        "xxxx:xxxx:0:201:82:212:62:62",
        "xxxx:xxxx:2000:201:78:42:43:62"
    ],
    "dns-search": [
       
    ],
    "inactive": {
        "ipv4-address": [
           
        ],
        "ipv6-address": [
           
        ],
        "route": [
           
        ],
        "dns-server": [
           
        ],
        "dns-search": [
           
        ]
    },
    "data": {
       
    }
}

so it looks like I don't get a prefix at all. O.o or am I doing something wrong?

Same problem. "Destination unreacheble: Port unreacheble"

I disable ipv6 rules in /etc/config/firewall, but its no true way.

Any ideas?

http://fpaste.org/141059/14129715/

The problem is the firewall doesn't get updated by gw6c with information about the new sit1 interface. As such all traffic originating from the lan destined for sit1 hits the default reject rule in the IPv6 FORWARD table.

The fix is to insert an additional rule to allow this traffic. Edit /etc/firewall.user and add the following line:

ip6tables -I FORWARD -o sit1 -j ACCEPT

You can also do this via Luci interface under Firewall -> Custom Rules

I've updated the Wiki article with a note about this.

(Last edited by porjo on 22 May 2015, 23:13)

The discussion might have continued from here.