Route network traffic using a second OpenWrt router

I have two OpenWRT routers. There's a main router, connected to the internet; and a second router, a client for the main router.

The second router has OpenVPN client an a connection to OpenVPN server.
I have a client from main router, and I need to route traffic going to to second router, and second router to send the incoming traffic to OpenVPN server.

The main router has

  • route (interface lan, target, gateway

The second router has

  • eth0 (ip is from main router dhcp) (this is the wan)
  • tun0 (openvpn client interface)
  • route (interface wan, target, gateway
  • no bridges.
  • no lan interface.

How can I make it so request to "Service1" ( from "MacMini" ( go throught the vpn client on second router?

I'm aware I could simply install the openvpn client on main router or in each individual computer on the lan. The purpose is to learn about routing and networking in general.

Thank you!

target should be

normally this should not be needed, but if the server is not advertising to the client the whole /24, then you need a route for
Also you need to allow traffic from wan interface of secondary router to the vpn interface and optionally masquerade the traffic in case the OpenVPN server doesn't know about network.

1 Like

what about firewall rules? Curently all zones and all rules are set to "accept"

You can either enable forwarding from wan to lan, or make a rule to allow traffic from wan zone to lan zone. The forwarding is preferred.