[Bug] Flint 2 v4.11.0: firewall.nat6 fails when IPv4 Docker rules are present

Hi,

I would like to report a possible firmware compatibility issue on my Flint 2.

This may be related to the issue discussed here:

In that topic, a GL.iNet staff reply identifies FULLCONENAT rules being incorrectly included in the IPv6 firewall import. My case involves the same script, /etc/firewall.nat6, but a different rule: an IPv4 Docker rule containing 127.0.0.0/8.

I am not a networking specialist. The investigation and local workaround were prepared with ChatGPT’s assistance. I had no noticeable network problems before discovering the log error.

System

  • Router: Flint 2 / GL-MT6000

  • GL.iNet firmware: 4.11.0

  • OpenWrt: 21.02-SNAPSHOT, r15812+1095-46b6ee7ffc

  • Kernel: 5.4.238

  • IPv6: enabled, native mode

  • IPv4 Docker rules are present on the router

Observed error

When the firewall reloads, /etc/firewall.nat6 produces:

ip6tables-restore v1.8.7 (legacy): host/network `127.0.0.0' not found
Error occurred at line: 63

The script’s nat6_init() function contains:

iptables-save -t nat \
| sed -e "/\s[DS]NAT\s/d;/\sMASQUERADE\s/d;/\sMASQUERADE$/d;/\sFULLCONENAT$/d;/skip firewall.nat6/d" \
| ip6tables-restore -w -T nat

The FULLCONENAT exclusion is therefore already present in my firmware. However, the filtered output still includes this IPv4 Docker rule at line 63:

-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER

This causes the IPv6 import to fail.

Local workaround tested

An additional filter was inserted immediately before ip6tables-restore:

| sed '/DOCKER/d' \

The modified input passed ip6tables-restore --test. After executing the modified script:

  • The script completed without the previous error.

  • The expected LAN/WAN IPv6 NAT hooks were present.

  • DNS redirection to AdGuard Home on port 3053 was present.

  • Previously duplicated rules in the IPv6 NAT table were no longer duplicated.

The original IPv4 Docker rules were not modified. Backups were made.

This is only a locally tested workaround, not a proposed universal fix. We have not performed comprehensive connectivity tests or established a user-visible improvement.

For completeness, the router also has a manually installed cloudflared service and modified AdGuard Home authentication. The firewall script has now been manually patched as described above.

Could you confirm whether this is another case of IPv4-specific rules being incorrectly copied into the IPv6 NAT table, and whether it can be addressed in the firmware?

Thank you.

Hi,

Thank you for reporting this and sharing your workaround.

We reproduced the same error on firmware 4.11.0 with Docker running. The current firmware builds the IPv6 NAT table by reusing filtered IPv4 NAT rules.

The Docker plugin adds an IPv4-specific rule containing 127.0.0.0/8, which passes through the current filter and causes a compatibility issue during the IPv6 import. We recommend continuing to use your tested filtering workaround for now.

We will share these findings with the relevant team, and a firmware-level adjustment will require further evaluation of compatibility with other firewall rules.

Thank you again for your detailed testing and support.