1
Virtual private networks / Re: Multiple VPN client tunnels & bypass rules
« on: July 20, 2023, 04:03:32 am »
Hey guys. I did end up finally getting this working. I think it was a combination of a couple of things.
Firstly, I had Firewall > NAT > Outbound set to "Hybrid outbound NAT rule generation". Which worked fine with one tunnel running but I think that the rules it was auto creating were conflicting when it came to splitting different parts of my network over different client tunnels.
So i changed this setting to "Manual outbound NAT rule generation"
When i had set the mode to "Manual outbound NAT rule generation", i would lose connectivity entirely. The reason this was happening is because when you change it to manual mode, you need to create two sets of rules (an Outbound NAT rule as well as a matching Firewall LAN rule):
1. Outbound NAT catchall rule; This rule is set to cover my entire network and should be at the bottom of the rule list.
For example;
Interface: Choose the VPN interface you're using for your catchall
Source network: 172.21.0.0/16
Destination: ANY
Translation Target: The VPN interface you want to you as your catchall (this tunnel should already be configured and running).
Since i'm using Manual rule generation for my outbound NAT, i will need a matching manually created LAN rule. And since this is my matching catchall rule, it should also be at the bottom of the rule list.
So: Firewall > Rules > LAN > + new rule
Interface: LAN
Source: LAN net
Gateway: Choose the VPN interface you're using for your catchall.
At this point all your traffic should be going through your chosen catchall tunnel.
______________________________________
To add exceptions make sure you have a second VPN client tunnel already configured and running then:
Firewall > NAT > Outbound > + New rule
Interface: Choose the second / third / whatever VPN interface
Source network: The alias or IP of the device you want to re-direct. eg: 172.21.1.1/32 (ensure it's /32 if it's a single device you're splitting off)
Destination: ANY
Translation Target: Same as Interface
Then create a matching firewall rule.
Firewall > NAT > Outbound > + New rule
Interface: LAN
Source: Same as source in the outbound NAT rule (alias or specific IP of device you're diverting)
Gateway: Choose the second / third / whatever VPN interface. Should be the same tunnel as what you selected in the interface field on your matching Outbound NAT rule.
That's it!
Make sure that any exception rules (in Outbound NAT as well as the matching LAN firewall rules) are placed above the catchall rules.
To avoid confusion about which Outbound NAT rule matches which LAN rule, having a good description that makes sense to you is important.
As an example, i do something like this:
Outbound NAT: "10-LAN VPN Catchall (Has matching manually created firewall/LAN rule)"
LAN: "10-LAN VPN Catchall - (Has matching Outbound NAT rule)"
The next rule above, would start with 20- then 30- etc
This way, as the number of rules increases, i can see pretty quickly get a sense of my rule ordering and the numbering will match both rule pairs.
Hopefully that all makes sense and i didn't make things even more confusing and that it guides someone else trying to do the same thing.
Firstly, I had Firewall > NAT > Outbound set to "Hybrid outbound NAT rule generation". Which worked fine with one tunnel running but I think that the rules it was auto creating were conflicting when it came to splitting different parts of my network over different client tunnels.
So i changed this setting to "Manual outbound NAT rule generation"
When i had set the mode to "Manual outbound NAT rule generation", i would lose connectivity entirely. The reason this was happening is because when you change it to manual mode, you need to create two sets of rules (an Outbound NAT rule as well as a matching Firewall LAN rule):
1. Outbound NAT catchall rule; This rule is set to cover my entire network and should be at the bottom of the rule list.
For example;
Interface: Choose the VPN interface you're using for your catchall
Source network: 172.21.0.0/16
Destination: ANY
Translation Target: The VPN interface you want to you as your catchall (this tunnel should already be configured and running).
Since i'm using Manual rule generation for my outbound NAT, i will need a matching manually created LAN rule. And since this is my matching catchall rule, it should also be at the bottom of the rule list.
So: Firewall > Rules > LAN > + new rule
Interface: LAN
Source: LAN net
Gateway: Choose the VPN interface you're using for your catchall.
At this point all your traffic should be going through your chosen catchall tunnel.
______________________________________
To add exceptions make sure you have a second VPN client tunnel already configured and running then:
Firewall > NAT > Outbound > + New rule
Interface: Choose the second / third / whatever VPN interface
Source network: The alias or IP of the device you want to re-direct. eg: 172.21.1.1/32 (ensure it's /32 if it's a single device you're splitting off)
Destination: ANY
Translation Target: Same as Interface
Then create a matching firewall rule.
Firewall > NAT > Outbound > + New rule
Interface: LAN
Source: Same as source in the outbound NAT rule (alias or specific IP of device you're diverting)
Gateway: Choose the second / third / whatever VPN interface. Should be the same tunnel as what you selected in the interface field on your matching Outbound NAT rule.
That's it!
Make sure that any exception rules (in Outbound NAT as well as the matching LAN firewall rules) are placed above the catchall rules.
To avoid confusion about which Outbound NAT rule matches which LAN rule, having a good description that makes sense to you is important.
As an example, i do something like this:
Outbound NAT: "10-LAN VPN Catchall (Has matching manually created firewall/LAN rule)"
LAN: "10-LAN VPN Catchall - (Has matching Outbound NAT rule)"
The next rule above, would start with 20- then 30- etc
This way, as the number of rules increases, i can see pretty quickly get a sense of my rule ordering and the numbering will match both rule pairs.
Hopefully that all makes sense and i didn't make things even more confusing and that it guides someone else trying to do the same thing.