Hello everyone!
I have updated the ROS version to 7.1.1. I want to set up a killswitch for ipsec.
I took (this) article as a basis and want to customize the method for ROS7.1.
But in 7.1.1 the usage of routing marks changed. Now I need to add a table named as routing mark. I did so, but the packets are not filtered, but go to the default route of the main route table.
I attach the settings below :
The point is that I applied this rule to the second table.
I also marked the packet (new-routing-mark=second) so that it was sent to the second table search. It looks like the marking is not working.
If there were no marker, then the packet would pass in turn through the list in the routing table.
It’s the vernacular that made you misunderstand what @Sob wrote. The word “rule” is ambiguous.
How it works:
the packet passes through rules in chain prerouting of /ip firewall mangle, which assign it (or not) a routing table name.
next, the packet passes through the rules in /routing/rule. Like firewall rules, these routing rules are also matched first to last (top to bottom) and if conditions are met, the action is taken and further rules are not matched against.
In the routing rules, routing-mark is a match condition, and table is the output value. If a packet matches none of the routing rules, its assigned routing mark (routing table name) does not change, therefore the packet is routed using the table assigned using mangle rules, or using table main if no routing mark has been assigned in mangle, or if no matching route can be found in the table assigned in mangle.
last, the packet is actually routed, using the routing table assigned as a result of all the previous manipulations.
So in step 1, your packet gets a routing-mark second.
In step 2, the packet matches the routing rule action=lookup table=main, because this rule doesn’t check any match conditions. So effectively, the routing mark second is removed here. And since the packet matched this rule, it is not matched against the next one.
So just remove the first routing rule and you should be good.
can I please ask… What is this address ? 195.201.201.32
Could that be rewritten in a more elegant way, without citing a specific IP address, as such IP addresses can easily change when connecting to a different VPN ? Thanks a lot!