I have a remote openwrt router. I want to access luci console without doing a VPN. But restrict access to it from specific ipv6 address only. So I setup a firewall rule as below,
config rule
option src 'wan'
option family 'ipv6'
option dest_port '80'
option target 'ACCEPT'
option name 'router_remote_access'
list proto 'tcp'
list src_ip '2xx:7xx:xx:xxxx:xxxx:7xxx:fxxx:xxxx'
And it worked.
Above ipv6 address is not static, so I have a domain name with dynamic dns service updating latest ipv6 address to AAAA record.
Another approach would be an always running script on router, with an infinite loop and sleep 10, to do ‘nslookup ipv6.xxx.freeddns.org ‘ and update firewall rule, in case of any change.
While that might be fine within a tiered local setup (strictly between multiple of your own/ trusted networks, explicitly NOT traversing the internet), you really shouldn't do this over the open internet (regardless of the src_ip restriction). Wireguard is easily set up for a roadwarrior style VPN and will just offer this in a secure way.
I agree with the suggestion to use WireGuard. In addition to providing a secure method to connect to your router (and your network or even appear to be using the internet via your home ISP while away from home), you also do not need to worry about any source IP restrictions. That's because WG is secure and is not 'chatty` so it won't appear in port scans and only responds when it receives valid cryptographic connections.
I have a tailscale network (managed by my own self-hosted Tailscale control server - headscale)
Is adding the remote router to that network generally considered safe?