HI,
I use wg and pbr and in the moment everything goes to wg, but now I have just few devices which need wg so I would prefer traffic trough wan and use pbr to add some devices to wg. I thought I had only to unchecked the route allowed ips
, but it seems to does not work.
Did you tryed with net.ipv4.conf.wg0.rp_filter = 2
in /etc/sysctl.conf
?
no I have no idea what it is
I added it, it seems to be the same. I try to choose ''wan'' instead of '''torguard wg'' as default route?
1 Like
where is the Use default gateway
??
trendy
February 2, 2023, 4:57pm
8
You cannot choose that. It displays the default gateway that has top priority in the main routing table.
But this doesn't matter too much you can add a rule to route a few devices via VPN and then another rule to route everything via the WAN.
1 Like
Bill
February 2, 2023, 6:05pm
10
Been almost a year since using PBR @trendy , so I don't know for fact this next statement.
Could one put a metric on the wan interface and then just execute ifdown wg0
Bill:
ifdown wg0
after ifdown wg0
I got the traffic on wan but it is not really what I wanted, cause when I restart wg0, the default is back on wg
trendy
February 2, 2023, 7:11pm
12
Yes, you can set a higher metric in the wg0 interface, then do a ifup wg0
and it will come up with default in PRB the wan.
1 Like
Bill
February 2, 2023, 7:13pm
13
We are going to need you to assign static address "reserved address" for the devices you only want on wan.
Then we can help you build assign these devices to a table
lookup and put it on the wan metric
.
wg0
stays default route and the simple lookup table will send the exceptions to the wan interface.
Bill
February 2, 2023, 7:16pm
14
I don't want to sound antagonistic to PBR, but it is not needed if you do a lookup table and metric.
but pbr seems to be easier to setup, right?
Bill
February 2, 2023, 7:22pm
16
Easy? Have you got it working?
pbr? yes, it is working well, but all my devices on pbr are on WAN except 3. So I wanted to do the inverse but it is not a big deal
Bill
February 2, 2023, 7:38pm
18
Great you've achieved PBR making wan the default route correct?
You've got some devices that you need on wg0
correct?
PBR has a huge README and scenarios.
Where do the scenarios not fit in your easy lan?
not, still on wg0, the default route goes on ''wan'' only if I do ifdown wg0 but I dont want to stop my wg
trendy
February 2, 2023, 7:46pm
20
I mentioned how to fix that here .
1 Like