0% found this document useful (0 votes)
126 views

Script Balanceo PCC Dos Lineas de Pesos Iguales

This document configures IP addresses, DNS, NAT, and routing on a router with two WAN connections. It assigns IP addresses to the router's interfaces, enables DNS lookups to public servers, sets up NAT and firewall rules to pass traffic between the LANs and WANs, and configures routing and connection marking to load balance traffic across the two WAN connections.

Uploaded by

Omar Antonio
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)
126 views

Script Balanceo PCC Dos Lineas de Pesos Iguales

This document configures IP addresses, DNS, NAT, and routing on a router with two WAN connections. It assigns IP addresses to the router's interfaces, enables DNS lookups to public servers, sets up NAT and firewall rules to pass traffic between the LANs and WANs, and configures routing and connection marking to load balance traffic across the two WAN connections.

Uploaded by

Omar Antonio
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/ 1

/ip address

add address=192.168.10.1/24 interface=ether1wan1 network=192.168.10.0


add address=192.168.11.1/24 interface=ether2wan2 network=192.168.11.0
add address=192.168.20.1/30 interface=LAN network=192.168.20.0

/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4

/ip firewall nat


add action=masquerade chain=srcnat comment="NAT LINEA 1" out-interface=ether1wan1
add action=masquerade chain=srcnat comment="NAT LINEA 2" out-interface=ether2wan2

/ip firewall mangle


add action=accept chain=prerouting dst-address=192.168.10.0/24 in-interface=LAN
add action=accept chain=prerouting dst-address=192.168.11.0/24 in-interface=LAN
add action=mark-connection chain=prerouting connection-mark=no-mark connection-
state=new in-interface=ether1wan1 new-connection-mark=ISP1_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark connection-
state=new in-interface=ether2wan2 new-connection-mark=ISP2_conn passthrough=yes
add action=mark-connection chain=prerouting connection-mark=no-mark connection-
state=new dst-address-type=!local in-interface=LAN new-connection-mark=ISP1_conn
passthrough=yes per-connection-classifier=both-addresses:2/0
add action=mark-connection chain=prerouting connection-mark=no-mark connection-
state=new dst-address-type=!local in-interface=LAN new-connection-mark=ISP2_conn
passthrough=yes per-connection-classifier=both-addresses:2/1
add action=mark-routing chain=prerouting connection-mark=ISP1_conn in-interface=LAN
new-routing-mark=to_ISP1 passthrough=yes
add action=mark-routing chain=prerouting connection-mark=ISP2_conn in-interface=LAN
new-routing-mark=to_ISP2 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP1_conn new-routing-
mark=to_ISP1 passthrough=yes
add action=mark-routing chain=output connection-mark=ISP2_conn new-routing-
mark=to_ISP2 passthrough=yes

/ip route
add check-gateway=ping distance=1 gateway=8.8.8.8 routing-mark=to_ISP1
add check-gateway=ping distance=2 gateway=1.1.1.1 routing-mark=to_ISP2

add check-gateway=ping distance=1 gateway=8.8.8.8


add check-gateway=ping distance=2 gateway=1.1.1.1

#####FAILOVER#######
add distance=1 dst-address=8.8.8.8/32 gateway=10.0.0.1 scope=10
add distance=2 dst-address=1.1.1.1/32 gateway=10.0.2.1 scope=10

You might also like