Hi,
I have a RB with two DSL connections. IP addresses as follows
WAN1: 10.1.1.1/30 gw 10.1.1.2 - ether4
WAN2: 10.1.1.5/30 gw 10.1.1.6 - ether5
Each DSL connection will route packets only for the IP assigned so I need to make sure packets leave on the interface they come in on.
I have applied connection tracking and added several mangle rules:
Mark connection to 10.1.1.1 as dsl1 in prerouting
Mark connection to 10.1.1.5 as dsl2 in prerouting
I then apply packet marks based on connection mark
If connection mark dsl1 mark packet as dsl1 in prerouting
If connection mark dsl2 mark packet as dsl2 in prerouting
If connection mark dsl1 mark packet as dsl1 in output
If connection mark dsl2 mark packet as dsl2 in output
I then apply route marks based on packet marks
If packet mark dsl1 mark route as dsl1 in preouting
If packet mark dsl2 mark route as dsl2 in prerouting
If I apply logs in the filter I can see the marks being applied correctly for all packets
In the routing table I have
0.0.0.0/0 gw 10.1.1.2
0.0.0.0/0 route mark dsl1 10.1.1.2
0.0.0.0/0 route mark dsl2 10.1.1.6
I then add two rules
route mark dsl1 lookup dsl1
route mark dsl2 lookup dsl2
Regardless of what I do all packets leave by the 10.1.1.2 interface even though I see the correct marks in place.
My test is to ping 10.1.1.1 and 10.1.1.5 and always the traffic leaves from the correct source ip but always on ether4. I also try ssh in case the issue was the connectionless nature of icmp but that does not resolve the issue.
Can anyone see a solution?
Also, does the order of routes in the table matter? If so I cannot see any way to change the order of routes. My expectation is that it does matter but even if I have the dsl4 mark route before the default gateway with no mark the same result happens.
Any ideas? All suggestions welcome.