Using RPI3 as VPN gateway with single lan port

Hey all,

Recently I started creating the perfect travelrouter to take with me when traveling as a digital nomad. Started with the RPI3 to share a lan over it's wifi, then got myself a travelrouter (https://openwrt.org/toh/gl.inet/gl-mt300n_v2) and did the same but with a but more options.

Now having it set with different wireguard tunnels to 2 homes in different countries and 3 cloud wg servers I'm hosting, having policy based routing so I can connect with both lan's from my homes, having a few streamingapps going to my home internet to work. And having extra SSID's that are isolated for each tunnel.

If I would connect the WAN + LAN (of this travelrouter) to the same router ports, set-up my device with the lan/subnet of my Openwrt router traffic will go trough this router and I will have my routes etc while using the local wifi or lan connections which mostly are pretty well (better then then 2,4ghz from the device)

Now I was thinking if it was possible to make a kind of Plug and Use Gateway device with my RPI3. Connecting it with the single port to the router, getting the WAN, then having it set up with the tunnels, policy based routes etc and being able to access it on the same port when having my lan/subnet equal to that lan. I've been playing with the firewall to allow WAN->LAN and trying to set up a VLAN on the same port, but didn't reach the router.

Like I said the reason is that it would be better to use the local WIFI or LAN, but still having my internet routed trough my own router, and also having my devices (android tv, tablet etc) doing the same to make it easier to set up when switching to a new location.

Any tips of guides I can use to make my single port work as WAN + LAN on a RPI3?

Always after sharing a post you figuture it out after trial and error.

So i've been able to get it to work.
Setting wan interface to static ip with same lan ip as the router and gateway it's connected to, set DNS on advanced page as well to have the gateway IP. Then setting dhcp to active (and then enable ignore interface)

Now when i'm going to a new location, i plug in the RPI, change the IP to the local router info. Then just set ip on my device the local ip and change the gateway and DNS to the RPI IP.

When selecting a vpn to default route my internet is routed of the vpn.
But with PBR i have added ip's to do for me. So that the ip of my device would be routed over the vpn without having the RPI fully be over the VPN as well.

Now I can easily have a fast Wireguard client to Go with me when going to new places/countries.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.