Now, I want to protect the openwrt router against the wireguard server. So assuming the wireguard server is controlled by an adversary, I want to prevent:
the remote wireguard server to access lan.
the remote wireguard server from accessing the internet via the local openwrt router.
No, unless you have other things in the firewall that would permit it.
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
ubus call system board
cat /etc/config/network
cat /etc/config/firewall
/etc/config/firewall
config zone
option name 'wireguard_lan'
list network 'wg0'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
config forwarding
option src 'lan'
option dest 'wireguard_lan'
config rule 'lan_dhcp'
option name 'Allow-DHCP-lan'
option src 'lan'
option dest_port '67'
option family 'ipv4'
option proto 'udp'
option target 'ACCEPT'
config rule 'lan_dns'
option name 'Allow-DNS-lan'
option src 'lan'
option dest_port '53'
option proto 'tcp udp'
option target 'ACCEPT'
I was thinking of modifying allowed_ips to exclude all RFC1918 addresses.
Also, from the config, it's clear that lan cannot access wan. However, from an abundance of cautious, I'd like to test that practically. Is there a way to test it, maybe via traceroute or something like that?
Very little in those files are actually private and uniquely identifying -- WG keys, public IP addresses, passwords need to be redacted. Many people also choose to redact MAC addresses, but that isn't strictly necessary. Of course, we don't want to have you post anything that might be sensitive, so if you are working with an abundance of caution, it is understandable.
That said, if you (or your friend) cannot post the complete files, we can only provide advice based on what we see -- that means that there could be issues that we are unaware of and therefore cannot help solve.
Yes, that's absolutely fair. I'll talk to him and revert back to you if he is more open.
But your answer already helps me confirm the situation. Thanks!