I will start by stating my objective: creating a secondary router in my home where, if a client connects via LAN or through the SSID, all traffic coming/going to the downstream client device (such as a computer or laptop) runs as a client to an OpenVPN server I have set up.
Current setup
I have a Linksys MR8300 with openwrt installed. It currently has 100 percent packet loss when testing via diagnostic. The WAN port of the openwrt linksys router is wired to a LAN port in the upstream (ISP-provided) router. I intend to still have regular devices connected to the upstream router be reasonably impacted by the openwrt device.
Other than attempting to configure wireless for my openwrt linksys device (I get "wireless is not associated") I have openwrt's 22.03.2 for that device installed.
As a starting point, it is sometimes/often necessary to change the LAN IP address of the OpenWrt router so that it doesn't conflict with the upstream router's subnet. If your existing router is using 192.168.1.0/24 for its LAN, you must change OpenWrt... it can be any RFC1918 range that doesn't conflict. For example, 192.168.4.1 would be fine for the OpenWrt lan address.
If this doesn't solve the problem, please post your config files for review:
Please 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:
I think you're saying that you want endpoints connected to the 8300 (wifi or LAN ports) to go to the Internet via VPN, while endpoints connected to the main router continue to go directly to the Internet without VPN.
In that case, the configuration of OpenWrt is the same as if it were a main router connected directly to the Internet. Though as psherman said, since your WAN IP will be a private range, you have to be sure not to conflict with the new LAN.
Get regular lan-wan routing working first, then install and configure OpenVPN.
Thanks for getting back to me. Indeed they do have the same subnet. (i.e. 192.168.1.1) The link that you shared is not clear to me and appears to be outdated in terms of its explanation on how to change the IP of the openwrt router.
The link is up to date and describes the process of changing your LAN IP, but I can help provide some clarification if you'd like... what's causing confusion?
Indeed, they are both different issues. Now that I've changed the address of the openwrt machine to .2.1 everything is good, the VPN is evidently working. But I am struggling with WAN. Should I make a new post?
I just don't understand how to broadcast a wireless signal via Openwrt. Under interfaces, the only GUI interface that appears to be working right now is the LAN.
My virtual interface (TESTTUN) is useless, does nothing, and my WAN & WAN6 just don't do anything.
Set all three radios to your country. Do this by editing an interface on a radio, click the Advanced tab near the top of the page, and pull down to choose the county. Do this 3 times, they must all 3 be set to the same country.
In the MR8300, radio 0 must be set to channel 100 or higher, and radio2 to channel 60 or lower. Note that in most countries, a DFS channel (60-132) will not come up immediately as there is a 1 minute wait to confirm there is no radar operating nearby.
Delete all the interfaces except for one AP on each radio. You have a STA interface on one radio that will never find its AP, that keeps any APs configured on the radio from starting up.
The lan should be using device br-lan. Then, from there, you go to the wireless configuration and you set the SSID and password, and you associate it with the lan network.
I now only have radio0 setup as 5ghz. I managed to connect with another device.
Right now on a desktop I am hardwired into openwrt with openvpn set up as a client. From this hardwired machine I am accessing the web via the VPN.
However, on a remote laptop connected to my openwrt associated SSID (there's only one attached to LAN) , this is not hte case. It is connected directly to the public internet which is not the VPN. What am I missing here?
Let's take a look at the full set of config files... so far, we've only seen the wireless file. Please post all 4 so that we can see the latest situation.
I should also add that since I have altered things (not sure what specifically did this) I am now noticing that traffic on LAN (my connected desktop) does not appear to be going through the VPN anymore
So you're saying that the devices connected via wifi are not using the tunnel, but the ethernet connected ones do?
I'm not seeing any reason for that behavior, but I can suggest the following:
move the VPN into a separate zone. Remove it from the wan zone, create a new zone. Remove lan > wan forwarding (this won't be obvious, but is removed from the below config) and enable lan > vpn forwarding. Your config should look like this:
config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
option mtu_fix '1'
list network 'wan'
list network 'wan6'
config zone
option name 'vpn'
option input 'REJECT'
option output 'ACCEPT'
option forward 'REJECT'
option masq '1'
list device 'tun0'
config forwarding
option src 'lan'
option dest 'vpn'
With this, your config will only allow the lan clients to egress via the VPN tunnel... they will not be able to egress via the wan.
Check to make sure that your SSID is unique and that your devices only have a single active connection to the network we're talking about here (the secondary router)... any other connections (wifi or wired, like to your main upstream network) could obviously have the effect of accidentally bypassing the VPN.