Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /interface bridge
- add comment="Red Local" name=bridgeLAN
- /interface ethernet
- set [ find default-name=ether1 ] comment="WAN ISP1"
- set [ find default-name=ether2 ] comment="WAN ISP2"
- set [ find default-name=ether3 ] comment="En bridgeLAN"
- set [ find default-name=ether4 ] comment="En bridgeLAN"
- set [ find default-name=ether5 ] comment="En bridgeLAN"
- # Crear listas de interfaces.
- /interface list
- add name=WANs
- add name=LANs
- # Pool y DHCP para semento LAN, si requieres un semento LAN diferente, asegurese de
- # cambiarlo en todos los apartados donde se haga referencia.
- /ip pool
- add name=dhcp_pool0 ranges=192.168.100.1-192.168.100.253
- /ip dhcp-server
- add address-pool=dhcp_pool0 interface=bridgeLAN lease-time=10m name=dhcp1
- # Creacion de tablas de Ruteo.
- /routing table
- add comment="Tabla de Ruteo para ISP1" disabled=no fib name=rtTo-ISP1
- add comment="Tabla de Ruteo para ISP2" disabled=no fib name=rtTo-ISP2
- /interface bridge port
- add bridge=bridgeLAN interface=ether3
- add bridge=bridgeLAN interface=ether4
- add bridge=bridgeLAN disabled=yes interface=ether5
- /interface list member
- add interface=ether1 list=WANs
- add interface=ether2 list=WANs
- add interface=ether3 list=LANs
- add interface=ether4 list=LANs
- add interface=ether5 list=LANs
- /ip address
- # Cambiar el segmento de red poe el segmento que les entrega su proveedor ISP1.
- add address=192.168.10.10/24 comment=ISP1 interface=ether1 network=192.168.10.0
- # Cambiar el segmento de red poe el segmento que les entrega su proveedor ISP1.
- add address=192.168.20.20/24 comment=ISP2 interface=ether2 network=192.168.20.0
- # Si requieres un semento LAN diferente, asegurese de
- # cambiarlo en todos los apartados donde se haga referencia.
- add address=192.168.100.254/24 comment=bridgeLAN interface=bridgeLAN network=192.168.100.0
- /ip cloud
- set ddns-enabled=yes ddns-update-interval=10m
- /ip dhcp-server network
- add address=192.168.100.0/24 dns-server=192.168.100.254,8.8.4.4 gateway=192.168.100.254
- # Si requiere usar los DNS de su proveedor, puede cambiarlos aqui.
- /ip dns
- set allow-remote-requests=yes cache-size=12048KiB servers=8.8.8.8,1.1.1.1
- /ip firewall address-list
- # Sementros de IPs Privadas indicados en RFC1918.
- add address=10.0.0.0/8 comment="Segmento de IPs Privadas" list="RFC 1918"
- add address=172.16.0.0/12 comment="Segmento de IPs Privadas" list="RFC 1918"
- add address=192.168.0.0/16 comment="Segmento de IPs Privadas" list="RFC 1918"
- # Algunas reglas basicas de Firewall para proteger un poco el equipo.
- /ip firewall filter
- add action=accept chain=input comment="Aceptar Trafico ICMP" protocol=icmp
- add action=drop chain=input comment="Rechazar DNS desde WANs" dst-port=53 in-interface-list=WANs protocol=udp
- add action=drop chain=input comment="Rechazar DNS desde WANs" dst-port=53 in-interface-list=WANs protocol=tcp
- add action=accept chain=input comment="IN Aceptar Conexiones Establecida y Relacionadas" connection-state=established,related
- add action=drop chain=input comment="IN Rechazar Conexiones Invalidas" connection-state=invalid
- add action=accept chain=input comment="Aceptar la Administracion desde segmento LAN" src-address=192.168.100.0/24
- add action=drop chain=input comment="IN Bloquear el Resto" disabled=yes
- add action=accept chain=forward comment="FW Aceptar Conexiones Establecida y Relacionadas" connection-state=established,related
- add action=drop chain=forward comment="FW Rechazar Conexiones Invalidas" connection-state=invalid
- add action=accept chain=output comment="OUT Aceptar Conexiones Establecida y Relacionadas" connection-state=established,related
- add action=drop chain=output comment="OUT Rechazar Conexiones Invalidas" connection-state=invalid
- /ip firewall mangle
- # Evitar el balanceo del trafico local.
- add action=accept chain=prerouting comment="No Balancear Trafico Local" dst-address-list="RFC 1918" src-address-list="RFC 1918"
- # Aqui Comienza lña confiuacion de PCC
- # Permitir trafico hacia las WAN ISP
- add action=accept chain=prerouting comment="Permitir Trafico hacia WAN ISPs" dst-address=192.168.5.0/24 in-interface-list=LANs
- add action=accept chain=prerouting dst-address=192.168.2.0/24 in-interface-list=LANs
- # Marcado de conexiones que se originan en internet a nuestro router
- add action=mark-connection chain=prerouting comment="Marcar Conexiones Originadas en Internet" connection-mark=no-mark in-interface=ether1 new-connection-mark=to_ISP1_conn passthrough=yes
- add action=mark-connection chain=prerouting connection-mark=no-mark in-interface=ether2 new-connection-mark=to_ISP2_conn passthrough=yes
- # Marcado de respuestas desde el router a las peticiones de internet
- add action=mark-routing chain=output comment="Marcar Conexiones de Respuesta" connection-mark=to_ISP1_conn new-routing-mark=rtTo-ISP1 passthrough=no
- add action=mark-routing chain=output connection-mark=to_ISP2_conn new-routing-mark=rtTo-ISP2 passthrough=no
- # Marcado de conexiones desde LAN, por defecto el clasificador de conexiones se
- # a configurado para 2 proveedores de la misma velocidad (1:1), ademas esta
- # seleccionado el clasificador boot-address pero se puede usar el src-address
- # contacte al creador por una configuracion adaptada a sus necesidades.
- add action=mark-connection chain=prerouting comment="Marcar Conexiones desde LAN (Clasificador de Conexiones)" connection-mark=no-mark in-interface-list=LANs new-connection-mark=to_ISP1_conn passthrough=yes per-connection-classifier=both-addresses:2/0
- add action=mark-connection chain=prerouting connection-mark=no-mark in-interface-list=LANs new-connection-mark=to_ISP2_conn passthrough=yes per-connection-classifier=both-addresses:2/1
- # Marcado de rutas por la cual saldran las conexiones marcadas previamente
- add action=mark-routing chain=prerouting comment="Marcar Rutas para Conexiones Previamente Marcadas" connection-mark=to_ISP1_conn in-interface-list=LANs new-routing-mark=rtTo-ISP1 passthrough=no
- add action=mark-routing chain=prerouting connection-mark=to_ISP2_conn in-interface-list=LANs new-routing-mark=rtTo-ISP2 passthrough=no
- /ip firewall nat
- # DNS Transparente
- add action=redirect chain=dstnat comment="DNS Transparente" dst-port=53 protocol=udp to-ports=53
- # NAT Mascarade
- add action=masquerade chain=srcnat comment="Enmascaramiento a Internet WANs" out-interface-list=WANs
- /ip firewall service-port
- set ftp disabled=yes
- set tftp disabled=yes
- set h323 disabled=yes
- set sip disabled=yes
- set pptp disabled=yes
- /ip route
- # Rutas Recursivas a DNSs, aqui tambien debera agregar el gateway de su proveedor.
- add comment="Route Recursive To Quad9 ISP1" disabled=no distance=1 dst-address=9.9.9.9/32 gateway=192.168.5.254 pref-src="" routing-table=main scope=10 suppress-hw-offload=no target-scope=10
- add comment="Route Recursive To ControlD ISP2" disabled=no distance=1 dst-address=76.76.2.0/32 gateway=192.168.2.254 pref-src="" routing-table=main scope=10 suppress-hw-offload=no target-scope=10
- # Rutas para PCC y Failover.
- add check-gateway=ping comment="Ruta con MARCAS ISP2" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=9.9.9.9 pref-src="" routing-table=rtTo-ISP1 scope=30 suppress-hw-offload=no target-scope=11
- add check-gateway=ping comment="Ruta con MARCAS ISP2" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=76.76.2.0 pref-src="" routing-table=rtTo-ISP2 scope=30 suppress-hw-offload=no target-scope=11
- add check-gateway=ping comment="Ruta main ISP1" disabled=no distance=1 dst-address=0.0.0.0/0 gateway=9.9.9.9 pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=11
- add check-gateway=ping comment="Default BackUp Route marca ISP1 " disabled=no distance=2 dst-address=0.0.0.0/0 gateway=76.76.2.0 pref-src="" routing-table=rtTo-ISP1 scope=30 suppress-hw-offload=no target-scope=11
- add check-gateway=ping comment="Ruta main ISP2" disabled=no distance=2 dst-address=0.0.0.0/0 gateway=76.76.2.0 pref-src="" routing-table=main scope=30 suppress-hw-offload=no target-scope=11
- add check-gateway=ping comment="Default Backup Route marca ISP2" disabled=no distance=2 dst-address=0.0.0.0/0 gateway=9.9.9.9 pref-src="" routing-table=rtTo-ISP2 scope=30 suppress-hw-offload=no target-scope=11
- /ip service
- set telnet disabled=yes
- set ftp disabled=yes
- set www disabled=yes
- set ssh disabled=yes
- set api disabled=yes
- set api-ssl disabled=yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement