You are on page 1of 2

/ip address

add address=192.168.90.2/24 interface=ether1


add address=192.168.91.2/24 interface=ether2
add address=192.168.92.2/24 interface=ether3
add address=192.168.5.1/24 interface=ether5
/ip firewall nat
add chain=srcnat out-interface=ether1 action=masquerade
add chain=srcnat out-interface=ether2 action=masquerade
add chain=srcnat out-interface=ether3 action=masquerade
/ip route
add gateway=192.168.90.1 check-gateway=ping distance=1
add gateway=192.168.91.1 check-gateway=ping distance=2
add gateway=192.168.92.1 check-gateway=ping distance=3
/ip firewall mangle
add chain=prerouting in-interface=ether1 connection-state=new new-connection-
mark=ether1_conn action=mark-connection passthrough=yes
add chain=prerouting in-interface=ether2 connection-state=new new-connection-
mark=ether2_conn action=mark-connection passthrough=yes
add chain=prerouting in-interface=ether3 connection-state=new new-connection-
mark=ether3_conn action=mark-connection passthrough=yes
add chain=prerouting in-interface=ether4 connection-state=new new-connection-
mark=ether4_conn action=mark-connection passthrough=yes
add chain=output connection-mark=ether1_conn new-routing-mark=to_ether1
action=mark-routing passthrough=yes
add chain=output connection-mark=ether2_conn new-routing-mark=to_ether2
action=mark-routing passthrough=yes
add chain=output connection-mark=ether3_conn new-routing-mark=to_ether3
action=mark-routing passthrough=yes
add chain=output connection-mark=ether4_conn new-routing-mark=to_ether4
action=mark-routing passthrough=yes
/ip firewall mangle
add chain=prerouting in-interface=ether5 connection-state=new dst-address-type=!
local per-connection-classifier=both-addresses:4/0 action=mark-connection new-
connection-mark=ether1_conn passthrough=yes
add chain=prerouting in-interface=ether5 connection-state=new dst-address-type=!
local per-connection-classifier=both-addresses:4/1 action=mark-connection new-
connection-mark=ether2_conn passthrough=yes
add chain=prerouting in-interface=ether5 connection-state=new dst-address-type=!
local per-connection-classifier=both-addresses:4/2 action=mark-connection new-
connection-mark=ether3_conn passthrough=yes
add chain=prerouting in-interface=ether5 connection-state=new dst-address-type=!
local per-connection-classifier=both-addresses:4/2 action=mark-connection new-
connection-mark=ether4_conn passthrough=yes
add chain=prerouting in-interface=ether5 connection-mark=ether1_conn action=mark-
routing new-routing-mark=to_ether1 passthrough=yes
add chain=prerouting in-interface=ether5 connection-mark=ether2_conn action=mark-
routing new-routing-mark=to_ether2 passthrough=yes
add chain=prerouting in-interface=ether5 connection-mark=ether3_conn action=mark-
routing new-routing-mark=to_ether3 passthrough=yes
add chain=prerouting in-interface=ether5 connection-mark=ether4_conn action=mark-
routing new-routing-mark=to_ether3 passthrough=yes

/ip firewall mangle


add chain=prerouting dst-address=192.168.90.0/24 action=accept in-interface=ether5
add chain=prerouting dst-address=192.168.91.0/24 action=accept in-interface=ether5
add chain=prerouting dst-address=192.168.23.0/24 action=accept in-interface=ether5
add chain=prerouting dst-address=192.168.23.0/24 action=accept in-interface=ether5
/ip route
add gateway=192.168.21.1 routing-mark=to_ether1 check-gateway=ping
add gateway=192.168.22.1 routing-mark=to_ether2 check-gateway=ping
add gateway=192.168.23.1 routing-mark=to_ether3 check-gateway=ping

https://www.youtube.com/watch?v=j5BMO82dGBw

https://www.youtube.com/watch?v=3hco1ebiqo8

https://www.youtube.com/watch?v=fT8GbK8yAgw

You might also like