You are on page 1of 1

/ip firewall mangle

add action=mark-connection chain=input in-interface=ether1 new-connection-


mark=ether1_conn \
passthrough=yes
add action=mark-connection chain=input in-interface=ether2 new-connection-
mark=ether2_conn \
passthrough=yes
add action=mark-routing chain=output connection-mark=ether1_conn new-routing-mark=\
to_ether1 passthrough=yes
add action=mark-routing chain=output connection-mark=ether2_conn new-routing-mark=\
to_ether2 passthrough=yes
add action=mark-connection chain=prerouting in-interface=bridge1 new-connection-
mark=\
ether1_conn passthrough=yes per-connection-classifier=both-addresses-and-
ports:3/0
add action=mark-connection chain=prerouting in-interface=bridge1 new-connection-
mark=\
ether1_conn passthrough=yes per-connection-classifier=both-addresses-and-
ports:3/1
add action=mark-connection chain=prerouting in-interface=bridge1 new-connection-
mark=\
ether2_conn passthrough=yes per-connection-classifier=both-addresses-and-
ports:3/2
add action=mark-routing chain=prerouting connection-mark=ether1_conn in-
interface=bridge1 \
new-routing-mark=to_ether1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ether2_conn in-
interface=bridge1 \
new-routing-mark=to_ether2 passthrough=yes

/ip firewall nat


add action=masquerade chain=srcnat out-interface=ether1
add action=masquerade chain=srcnat out-interface=ether2

/ip route
add check-gateway=ping distance=1 gateway=192.168.111.1 routing-mark=to_ether1
add check-gateway=ping distance=1 gateway=192.168.165.1 routing-mark=to_ether2

You might also like