Sie sind auf Seite 1von 2

/ip

add
add
add

address
address=192.168.1.2/24 interface=ether1
address=192.168.2.2/24 interface=ether2
address=192.168.3.2/24 interface=ether3

add address=192.168.5.1/24 interface=ether5


/ip
add
add
add

firewall nat
chain=srcnat out-interface=ether1 action=masquerade
chain=srcnat out-interface=ether2 action=masquerade
chain=srcnat out-interface=ether3 action=masquerade

/ip
add
add
add

route
gateway=192.168.1.1 check-gateway=ping distance=1
gateway=192.168.2.1 check-gateway=ping distance=2
gateway=192.168.3.1 check-gateway=ping distance=3

/ip firewall mangle


add chain=prerouting in-interface=ether1 connection-state=new new-connection-mar
k=ether1_conn action=mark-connection passthrough=yes
add chain=prerouting in-interface=ether2 connection-state=new new-connection-mar
k=ether2_conn action=mark-connection passthrough=yes
add chain=prerouting in-interface=ether3 connection-state=new new-connection-mar
k=ether3_conn action=mark-connection passthrough=yes
add chain=output connection-mark=ether1_conn new-routing-mark=to_ether1 action=m
ark-routing passthrough=yes
add chain=output connection-mark=ether2_conn new-routing-mark=to_ether2 action=m
ark-routing passthrough=yes
add chain=output connection-mark=ether3_conn new-routing-mark=to_ether3 action=m
ark-routing passthrough=yes
/ip firewall mangle
#Parte A
add chain=prerouting in-interface=ether5 connection-state=new dst-address-type=!
local per-connection-classifier=both-addresses:3/0 action=mark-connection new-co
nnection-mark=ether1_conn passthrough=yes
add chain=prerouting in-interface=ether5 connection-state=new dst-address-type=!
local per-connection-classifier=both-addresses:3/1 action=mark-connection new-co
nnection-mark=ether2_conn passthrough=yes
add chain=prerouting in-interface=ether5 connection-state=new dst-address-type=!
local per-connection-classifier=both-addresses:3/2 action=mark-connection new-co
nnection-mark=ether3_conn passthrough=yes
#Parte B
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
/ip firewall mangle
add chain=prerouting dst-address=192.168.1.0/24 action=accept in-interface=ethe
r5

add chain=prerouting dst-address=192.168.2.0/24 action=accept in-interface=ethe


r5
add chain=prerouting dst-address=192.168.3.0/24 action=accept in-interface=ethe
r5
/ip
add
add
add

route
gateway=192.168.1.1 routing-mark=to_ether1 check-gateway=ping
gateway=192.168.2.1 routing-mark=to_ether2 check-gateway=ping
gateway=192.168.3.1 routing-mark=to_ether2 check-gateway=ping

Das könnte Ihnen auch gefallen