Reverse WireGuard tunnel

You need to do Policy Based Routing and you have 3 options:

  1. mwan3 package
  2. pbr package
  3. a set of rules/routes for each internet connection.

I think for your usecase option #3 is the most simple.

3 Likes

Customize the existing rule like this:

uci set network.lan_wg.src="192.168.1.123/32"
uci commit network
service network restart
2 Likes

It mean's if user of home 1 for example windows pc has a "192.168.1.123" so only this user will use internet from home 2 ? If so if I want later to add some user from home 1 to also like this, can I also add like this:


uci set network.lan_wg.src="192.168.1.xxx/32"
uci commit network
service network restart

(where xxx ip of user)

What if user for example of iOS/android with cellular network, can successfully connect to wg server and if add in allowed ip's 0.0.0.0/0 in can use internet from house 1, what I have to do for that situation to use internet from house 2?

Yes.

The syntax of IP rules allows to specify only one source/destination CIDR per rule, so adding more clients generally requires to add more rules, which you can also do using the web interface:

  • LuCI > Network > Routing > IPv4/IPv6 Rules

Create a rule matching the IP of that mobile VPN client.

1 Like

It's work. Thanks a lot.

1 Like

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