I'm attempting to create a new bridged device that's used for my Wireguard VPN. This is because I want a specific Ethernet port on my router to be the only port with VPN access. So far, I have connected my computer to the Ethernet port to access the VPN and successfully changed my IP address. I can also access the local IP from LAN 172.16.1.1 while connected to my VPN, but I can't access any other IPs from the LAN interface.
I want the VPNLAN interface to access the LAN interfaces internal IPv4/24 addresses and forward those addresses to the VPN (WG1) server.
You can ignore wg0, as that's for testing purposes.
Maybe your table 1742 also needs a local route, it probably only has a default route via the WG interface?
Something like ip route add 172.16.1.0/24 dev br-lan
note I do not see interface LAN in your etc/config/network but that could just be me
I only included the things I'm working on in my /etc/config/network. I can include the whole file but there's a lot of other things I will need to Redact from it.
Google site to site setup.
The OpenWRT wiki has a paragraph about it, you must open up the firewall on the client side basically like you would do on a server side.
Easiest is just to add the wg client interface to the lan zone
It works whenever I connect to the VPN over my phone. I'm able to access my internal network of 172.16.1.0/24 but whenever I try to connect via my router it does not work.
wg1 sends the IP data up to the server and vpnlan+pull_wg1 is supposed to bring the data back to the internal network.
From what I'm noticing vpnlan still assumes it's on the same network as everything else and prevents me from accessing the internal network but I could be wrong about that.
How can I route two bridges together? I have everything working it seems but I can't get vpnlan and lan to communicate with each other besides the routers IP of 172.16.1.1. Both of them can access that.
uci add firewall rule
uci set firewall.@rule[-1].name='Allow-VPN-to-LAN'
uci set firewall.@rule[-1].src='vpnlan' # Adjust the zone name if different
uci set firewall.@rule[-1].dest='lan'
uci set firewall.@rule[-1].target='ACCEPT'
uci add firewall rule
uci set firewall.@rule[-1].name='Allow-LAN-to-VPN'
uci set firewall.@rule[-1].src='lan'
uci set firewall.@rule[-1].dest='vpnlan' # Adjust the zone name if different
uci set firewall.@rule[-1].target='ACCEPT'
while uci -q delete network.@rule[0]; do :; done
while uci -q delete network.@route[0]; do :; done
uci -q delete network.wg1.defaultroute
uci del_list network.@device[0].ports="wg1"
uci set network.@wireguard_wg1[0].route_allowed_ips="1"
uci set network.lan.ip4table="1"
uci set network.vpnlan.ip4table="2"
uci set network.wg1.ip4table="3"
uci set network.vpnlan_wg1="rule"
uci set network.vpnlan_wg1.in="vpnlan"
uci set network.vpnlan_wg1.lookup="3"
uci set network.vpnlan_wg1.priority="30000"
uci commit network
/etc/init.d/network restart
uci -q delete firewall.lan_vpnlan
uci set firewall.lan_vpnlan="forwarding"
uci set firewall.lan_vpnlan.src="lan"
uci set firewall.lan_vpnlan.dest="vpnlan"
uci -q delete firewall.vpnlan_lan
uci set firewall.vpnlan_lan="forwarding"
uci set firewall.vpnlan_lan.src="vpnlan"
uci set firewall.vpnlan_lan.dest="lan"
uci commit firewall
/etc/init.d/firewall restart
I have one last question. I've spend all of today on it and I'm unsure how to do it. I believe I've already setup the correct rules on the server side for wireguard.