Routing specific traffic from single host out secondary gateway
Posted: Fri Feb 03, 2017 11:21 pm
Scenario:
RB2011 with two WAN connections:
pppoe
lte
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.
I have a route that matches the routing mark amazon, which sends amazon traffic out the pppoe interface.
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.
What am I doing wrong?
RB2011 with two WAN connections:
pppoe
lte
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.
Code: Select all
/ip firewall mangle
add action=mark-connection chain=forward dst-address-list=amazonips new-connection-mark=amazon
add action=mark-routing chain=prerouting connection-mark=amazon new-routing-mark=amazon
Code: Select all
/ip route
add check-gateway=ping distance=1 gateway=pppoe-out1 routing-mark=amazon
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.
Code: Select all
/ip firewall mangle
add action=mark-connection chain=forward dst-address-list=!amazonips new-connection-mark=carol-lte src-address=192.168.1.5
add action=mark-routing chain=prerouting connection-mark=carol-lte new-routing-mark=carol
/ip route
add check-gateway=ping distance=1 gateway=lte1 routing-mark=carol