IPV6 Firewall Port Opening Help

I have this working for my WG server.
I have set a static IPv6 IP for this WG server.
To deal with dynamic prefix OpenWrt can work with a negative mask to mask the prefix.

My traffic rule for my WG server which has a static IPv6 IP of ::6

config rule
	option name 'wg-server6-6'
	list proto 'udp'
	option family 'ipv6'
	option src 'wan'
	option dest 'lan'
	option dest_port '51810'
	option target 'ACCEPT'
	list src_ip '::6/-64'

You can see the -64 negative mask which masks my prefix so if the prefix changes the rule should still work.

For completeness my static IP address (from /etc/dhcp):

config host
	option dns '1'
	option name 'EA8500'
	option mac 'C0:56:91:41:AA:BB'
	option ip '192.168.0.6'
	option leasetime '6h'
	option duid '00030001c0562723456d'
	option hostid '06'
3 Likes