There are two default routes.
0.0.0.0/0 with distance 1 sends all traffic out of pppoe
0.0.0.0/0 with distance 2 sends all traffic out lte in case of pppoe failing.
We have one host on the network that we want to use the lte as the primary out interface, but we want to send their amazon s3 backup traffic out the pppoe.
I’ve made an address-list named amazonips that contains all of amazon’s ip ranges.
I am mangling all traffic sent to amazonips so it marks the route as amazon.
My question is, how do I create a route which matches all other traffic from that single host, and sends it out the lte interface?
I tried marking the connection from the source IP for all traffic NOT sent to the amazonips address list. But when I created a route out the lte interface matching this routing mark the user lost all internet connectivity.
It’s too late to mark connection in forward chain, if you also need to mark routing for all its packets, because in forward chain, routing is already decided. What happens is that first packet takes default route and only following ones take marked route. And obviously it can’t work. So move connection marking to prerouting (and before route marking rules).
You can also save some processing with connection-mark=no-mark condition:
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
# DST-ADDRESS PREF-SRC GATEWAY DISTANCE
0 A S 0.0.0.0/0 pppoe-out1 1
1 A S 0.0.0.0/0 10.10.10.1 2
2 ADS 0.0.0.0/0 #.#.#.# 3
3 S 0.0.0.0/0 10.10.10.1 4