0% found this document useful (0 votes)
27 views2 pages

Ip Firewall Mangle

Uploaded by

foashbond007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views2 pages

Ip Firewall Mangle

Uploaded by

foashbond007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

zorinos

face set ether1 name=W1


set ether2 name=W2
set ether3 name=W3
set ether4 name=W4
set ether5 name=L
/ ip address
add address=50.50.50.1/24 interface=L comment=L
add address=192.168.1.2/24 interface=W1 comment=1
add address=192.168.2.2/24 interface=W2 comment=2
add address=192.168.3.2/24 interface=W3 comment=3
add address=192.168.4.2/24 interface=W4 comment=4
/ ip firewall mangle
add chain=input in-interface=W1 action=mark-connection new-connection-mark=W1_conn
add chain=input in-interface=W2 action=mark-connection new-connection-mark=W2_conn
add chain=input in-interface=W3 action=mark-connection new-connection-mark=W3_conn
add chain=input in-interface=W4 action=mark-connection new-connection-mark=W4_conn
add chain=output connection-mark=W1_conn action=mark-routing new-routing-mark=W1
add chain=output connection-mark=W2_conn action=mark-routing new-routing-mark=W2
add chain=output connection-mark=W3_conn action=mark-routing new-routing-mark=W3
add chain=output connection-mark=W4_conn action=mark-routing new-routing-mark=W4
add chain=prerouting dst-address-type=!local in-interface=L per-connection-
classifier=both-addresses-and-ports:4/0 action=mark-connection new-connection-
mark=W1_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=L per-connection-
classifier=both-addresses-and-ports:4/1 action=mark-connection new-connection-
mark=W2_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=L per-connection-
classifier=both-addresses-and-ports:4/2 action=mark-connection new-connection-
mark=W3_conn passthrough=yes
add chain=prerouting dst-address-type=!local in-interface=L per-connection-
classifier=both-addresses-and-ports:4/3 action=mark-connection new-connection-
mark=W4_conn passthrough=yes
add chain=prerouting connection-mark=W1_conn in-interface=Local action=mark-routing
new-routing-mark=W1
add chain=prerouting connection-mark=W2_conn in-interface=Local action=mark-routing
new-routing-mark=W2
add chain=prerouting connection-mark=W3_conn in-interface=Local action=mark-routing
new-routing-mark=W3
add chain=prerouting connection-mark=W4_conn in-interface=Local action=mark-routing
new-routing-mark=W4
/ ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=W1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=W2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.3.1 routing-mark=W3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.4.1 routing-mark=W4 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.1.1 distance=1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 distance=2 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.3.1 distance=3 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.4.1 distance=4 check-gateway=ping
/ ip firewall nat
add chain=srcnat out-interface=W1 action=masquerade
add chain=srcnat out-interface=W2 action=masquerade
add chain=srcnat out-interface=W3 action=masquerade
add chain=srcnat out-interface=W4 action=masquerade
/ip dns
set allow-remote-requests=no cache-max-ttl=1w cache-size=2048KiB max-udp-packet-
size=512 servers=8.8.8.8,8.8.4.4
/ip pool
add name=POOL ranges=50.50.50.2-50.50.50.254
/ip dhcp-server
add address-pool=POOL authoritative=after-2sec-delay bootp-support=static
disabled=no interface=Local lease-time=3d name=DHCP
/ip dhcp-server config
set store-leases-disk=5m
/ip dhcp-server network
add address=50.50.50.0/24 comment="" dns-server=8.8.8.8,8.8.4.4 gateway=50.50.50.1
/queue type
set default-small kind=pcq name=default-small pcq-classifier=
src-address,dst-address pcq-limit=50 pcq-rate=0 pcq-total-limit=2000

You might also like