You are on page 1of 1

/ip address

add address=192.168.3.2/24 interface=ether3


add address=192.168.4.2/24 interface=ether4
add address=192.168.1.1/24 interface=ether1
/ip firewall nat
add chain=srcnat out-interface=ether3 action=masquerade
add chain=srcnat out-interface=ether4 action=masquerade
/ip route
add gateway=192.168.3.1 check-gateway=ping distance=1
add gateway=192.168.4.1 check-gateway=ping distance=2
/ip firewall mangle
add chain=prerouting in-interface=ether3 connection-state=new new-connection-mar
k=ether3_conn action=mark-connection passthrough=yes
add chain=prerouting in-interface=ether4 connection-state=new new-connection-mar
k=ether4_conn action=mark-connection passthrough=yes
add chain=output connection-mark=ether3_conn new-routing-mark=to_ether3 action=m
ark-routing passthrough=yes
add chain=output connection-mark=ether4_conn new-routing-mark=to_ether4 action=m
ark-routing passthrough=yes
/ip firewall mangle
add chain=prerouting in-interface=ether1 connection-state=new dst-address-type=!
local per-connection-classifier=both-addresses:2/0 action=mark-connection new-co
nnection-mark=ether3_conn passthrough=yes
add chain=prerouting in-interface=ether1 connection-state=new dst-address-type=!
local per-connection-classifier=both-addresses:2/1 action=mark-connection new-co
nnection-mark=ether4_conn passthrough=yes
add chain=prerouting in-interface=ether1 connection-mark=ether3_conn action=mark
-routing new-routing-mark=to_ether3 passthrough=yes
add chain=prerouting in-interface=ether1 connection-mark=ether4_conn action=mark
-routing new-routing-mark=to_ether4 passthrough=yes
/ip firewall mangle
add chain=prerouting dst-address=192.168.3.0/24 action=accept in-interface=ethe
r1
add chain=prerouting dst-address=192.168.4.0/24 action=accept in-interface=ethe
r1
/ip route
add gateway=192.168.3.1 routing-mark=to_ether3 check-gateway=ping
add gateway=192.168.4.1 routing-mark=to_ether4 check-gateway=ping

You might also like