# Generado por:
# RouterOSv2.9
:log info "Unsolclic for 5515-MontesquiuCampanarST1 going to be executed."
#
# Configuration for RouterOSv2.9
# Dispositivo: 5515-MontesquiuCampanarST1
#
# Métodos para subir/ejecutar este script:
# 1.-Como un script. Sube este texto como un script bien con:
# a.Winbox (con Linux es necesario wine)
# b.Terminal (telnet, ssh...)
# Entonces ejecuta el script con:
# > /system script run nombre_del_script
# 2.-Fichero importado:
# Guarda este texto en un fichero, luego súbelo al router
# utilizando ftp con un nombre como "script_name.rsc".
# (ten en cuenta que la extensión ".rsc" es necesaria)
# Ejecuta el fichero importado utilizando el comando:
# > /import nombre_del_script
# 3.-Telnet copiar&pegar:
# Abre una sesión de terminal, y copia y pega el texto
# directamente en la ventana de la terminal.
#
# Notas:
# -routing-test package is required if you use RouterOSv2.9 , be sure you have it enabled at system packages
# -las wlans deberían activarse de forma manual. Asegúrate de que están establecidas en la antena correcta (a/b)
# de acuerdo con cómo has conectado el cable a la miniPCI. Mantén la
# potencia al mínimo posible y comprueba el canal.
# -El script no reinicia el router. Quizá tengas que hacerlo de forma manual
# -Debes tener acceso de escritura al router
# -Se recomienda el método de acceso por MAC (winbox, telnet a la MAC...)
# (el script reconfigura algunas direcciones IP, así que se puede perder la comunicación)
# -No se realizan cambios en las contraseñas de usuario del dispositivo
# -Se creará una cuenta de invitado de Sólo Lectura para permitir el acceso de invitados
# al router sin riesgo de daño pero con capacidad para ver la configuración.
# -Asegúrate de que todos los paquetes están activados.
# -No ejecutes el script desde telnet si estás conectado mediante una conexión IP en
# la interfaz: Esta interfaz será desctruida durante la ejecución del script.
#
/ system identity set name=MontesquiuCampanarST1
#
# DNS (client & server cache) zone: 2670
/ip dns set primary-dns=10.138.195.74 secondary-dns=10.138.0.2 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 2670
/system ntp client set enabled=yes mode=unicast primary-ntp=10.138.0.2
/system ntp server set manycast=no enabled=yes
:delay 1
#
# Servidor de ancho de banda
/ tool bandwidth-server set enabled=yes authenticate=no allocate-udp-ports-from=2000
#
# SNMP
/snmp set contact="guifi@guifi.net" enabled=yes location="MontesquiuCampanar"
#
# Guest user
/user
:foreach i in [find group=read] do={/user remove $i;}
add name="guest" group=read address=0.0.0.0/0 comment="" disabled=no
#
# Gráficas
/tool graphing interface add
# Eliminar el puente (bridge) actual wLan/Lan si existe
:foreach i in [/interface bridge find name=wLan/Lan] \
do={:foreach i in [/interface bridge port find bridge=wLan/Lan] \
do={/interface bridge port remove $i; \
:foreach i in [/ip address find interface=wLan/Lan] \
do={/ip address remove $i;};};
/interface bridge remove $i;}
# Crear puente (bridge) principal entre wlan1 y ether1
/ interface bridge
add name="wLan/Lan"
/ interface bridge port
add interface=ether1 bridge=wLan/Lan
add interface=wlan1 bridge=wLan/Lan
:delay 1
#
# Radio#: 0 MontesquiuAP1
/interface wireless set wlan1 name="wlan1" \
radio-name="MontesquiuAP1" mode=ap-bridge ssid="guifi.net-MontesquiuAP1" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=2462 \
dfs-mode=none \
wds-mode=static wds-default-bridge=none wds-default-cost=100 \
wds-cost-range=50-150 wds-ignore-ssid=yes hide-ssid=no
:delay 1
# Type: wLan/Lan
/ip address
:foreach i in [find address="10.138.194.1/26"] do={remove $i}
/ ip address add address=10.138.194.1/26 network=10.138.194.0 broadcast=10.138.194.63 interface=wLan/Lan disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.194.0/26] do={/routing bgp network remove $i;}
add network=10.138.194.0/26 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wLan/Lan] do={/routing ospf interface remove $i;}
add interface=wLan/Lan
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.194.0/26] do={/routing ospf network remove $i;}
add network=10.138.194.0/26 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wLan/Lan] do={/ip pool remove $i;}
/ip pool add name=dhcp-wLan/Lan ranges=10.138.194.7-10.138.194.62
:foreach i in [/ip dhcp-server find name=dhcp-wLan/Lan] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wLan/Lan interface=wLan/Lan address-pool=dhcp-wLan/Lan disabled=no
:foreach i in [/ip dhcp-server network find address="10.138.194.0/26"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.194.0/26 gateway=10.138.194.1 domain=guifi.net comment=dhcp-wLan/Lan
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.194.2 mac-address=00:16:01:AF:DE:B4 client-id=MTQJPortellRadio1 server=dhcp-wLan/Lan
add address=10.138.194.3 mac-address=00:16:01:F2:07:B9 client-id=MTQrafaRadio1 server=dhcp-wLan/Lan
add address=10.138.194.4 mac-address=ff:ff:ff:ff:ff:ff client-id=MTQPsgTerRadio1 server=dhcp-wLan/Lan
add address=10.138.194.5 mac-address=ff:ff:ff:ff:ff:ff client-id=MTQJMCastanyRadio1 server=dhcp-wLan/Lan
add address=10.138.194.6 mac-address=00:1D:73:18:0B:E6 client-id=SQBDavidMRadio1 server=dhcp-wLan/Lan
add address=10.138.194.7 mac-address=ff:ff:ff:ff:ff:ff client-id=MTQFouziaRadio1 server=dhcp-wLan/Lan
add address=10.138.194.8 mac-address=ff:ff:ff:ff:ff:ff client-id=MTQcomasfajuRadio2 server=dhcp-wLan/Lan
add address=10.138.194.9 mac-address=00:15:6D:E5:7B:95 client-id=MTQlluismonRd1 server=dhcp-wLan/Lan
add address=10.138.194.10 mac-address=00:15:6D:A7:B8:8B client-id=SQBPilarSalRd1 server=dhcp-wLan/Lan
add address=10.138.194.11 mac-address=00:0B:6B:4E:5D:30 client-id=MontesquiuCarolinaRd1 server=dhcp-wLan/Lan
add address=10.138.194.12 mac-address=00:0B:6B:4E:5D:30 client-id=MTQVFrauRd1 server=dhcp-wLan/Lan
add address=10.138.194.13 mac-address=00:15:6D:AA:CC:03 client-id=MtqBobyRd1 server=dhcp-wLan/Lan
add address=10.138.194.14 mac-address=00:15:6D:AA:2C:ED client-id=SQBPrRvrRd1 server=dhcp-wLan/Lan
add address=10.138.194.15 mac-address=00:15:6D:A9:BB:6D client-id=MTQMiquelAngelRd1 server=dhcp-wLan/Lan
add address=10.138.194.16 mac-address=00:15:6D:AB:68:31 client-id=SQDBAlbertiMarta server=dhcp-wLan/Lan
add address=10.138.194.17 mac-address=00:15:6D:AC:68:B3 client-id=MTQdaniRd1 server=dhcp-wLan/Lan
add address=10.138.194.18 mac-address=00:15:6D:AA:BB:57 client-id=VillaRd1 server=dhcp-wLan/Lan
add address=10.138.194.19 mac-address=00:15:6D:AD:5D:D4 client-id=MTQdavidmechanRd1 server=dhcp-wLan/Lan
add address=10.138.194.20 mac-address=00:15:6D:AC:F3:FC client-id=MTQdavidRd1 server=dhcp-wLan/Lan
add address=10.138.194.21 mac-address=00:22:6B:56:06:4A client-id=apujolRd1 server=dhcp-wLan/Lan
add address=10.138.194.22 mac-address=00:15:6D:3A:64:C4 client-id=MTQPerePRd1 server=dhcp-wLan/Lan
add address=10.138.194.23 mac-address=00:23:69:2F:46:D4 client-id=SQBapiRd1 server=dhcp-wLan/Lan
add address=10.138.194.24 mac-address=00:15:6D:D3:E7:1E client-id=SQBOscarDRd1 server=dhcp-wLan/Lan
add address=10.138.194.25 mac-address=00:15:6D:AE:EC:D4 client-id=mtqrossinyol19Rd1 server=dhcp-wLan/Lan
add address=10.138.194.26 mac-address=00:15:6D:D6:95:2F client-id=MTQCarlesMRd1 server=dhcp-wLan/Lan
add address=10.138.194.27 mac-address=00:15:6D:D6:96:24 client-id=MTQesmpaucas7Rd1 server=dhcp-wLan/Lan
add address=10.138.194.28 mac-address=00:23:69:CE:A5:6C client-id=MTQJoPlansRd2 server=dhcp-wLan/Lan
add address=10.138.194.29 mac-address=00:15:6D:E5:EF:A9 client-id=MTQmserradellRd1 server=dhcp-wLan/Lan
add address=10.138.194.30 mac-address=00:15:6D:EB:92:26 client-id=MTQEstherCRd1 server=dhcp-wLan/Lan
add address=10.138.194.31 mac-address=00:15:6D:F2:B3:40 client-id=MTQJFabregaRd1 server=dhcp-wLan/Lan
add address=10.138.194.32 mac-address=00:15:6D:F2:69:68 client-id=SQBCtraVidra34Rd1 server=dhcp-wLan/Lan
add address=10.138.194.33 mac-address=00:15:6D:F3:68:BA client-id=MTQTorello34Rd1 server=dhcp-wLan/Lan
add address=10.138.194.34 mac-address=00:15:6D:F3:68:4A client-id=SQBYussefRd1 server=dhcp-wLan/Lan
add address=10.138.194.35 mac-address=00:15:6D:AD:D8:47 client-id=MTQPauRRd1 server=dhcp-wLan/Lan
add address=10.138.194.36 mac-address=00:15:6D:F2:B3:43 client-id=MTQSchanzengrafRd1 server=dhcp-wLan/Lan
add address=10.138.194.37 mac-address=00:15:6D:AB:F4:B3 client-id=MTQsolaRd1 server=dhcp-wLan/Lan
add address=10.138.194.38 mac-address=00:15:6D:E4:39:79 client-id=MTQJMartinezRd2 server=dhcp-wLan/Lan
add address=10.138.194.39 mac-address=00:15:6D:A9:BC:FB client-id=SQBnuriaRd1 server=dhcp-wLan/Lan
add address=10.138.194.40 mac-address=00:15:6D:DB:C7:DA client-id=SQBBorisKRd1 server=dhcp-wLan/Lan
add address=10.138.194.41 mac-address=00:15:6D:5C:C1:BD client-id=SQBArmangolRd2 server=dhcp-wLan/Lan
add address=10.138.194.42 mac-address=00:15:6D:60:D5:DB client-id=SQBMelissaRRd1 server=dhcp-wLan/Lan
add address=10.138.194.43 mac-address=00:16:B6:DA:00:F2 client-id=MTQivlasRd2 server=dhcp-wLan/Lan
add address=10.138.194.44 mac-address=00:15:6D:EB:92:7B client-id=SQBMontseRRd1 server=dhcp-wLan/Lan
add address=10.138.194.45 mac-address=00:27:22:34:52:DB client-id=SQBFrancescERd1 server=dhcp-wLan/Lan
add address=10.138.194.46 mac-address=00:27:22:82:8F:26 client-id=MTQPSora5Rd1 server=dhcp-wLan/Lan
add address=10.138.194.47 mac-address=00:27:22:4C:2B:D9 client-id=MTQMireiaERd1 server=dhcp-wLan/Lan
#
:delay 1
# Type: wds/p2p
# Eliminar todas las interfaces wds existentes
:foreach i in [/interface wireless wds find master-interface=wlan1] \
do={:foreach n in [/interface wireless wds get $i name] \
do={:foreach inum in [/ip address find interface=$n] \
do={/ip address remove $inum;};}; \
/interface wireless wds remove $i;}
#
:delay 1
#
# Radio#: 1 MontesquiuAP2
/interface wireless set wlan2 name="wlan2" \
radio-name="MontesquiuAP2" mode=ap-bridge ssid="guifi.net-MontesquiuAP2" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=2442 \
dfs-mode=none \
wds-mode=static wds-default-bridge=none wds-default-cost=100 \
wds-cost-range=50-150 wds-ignore-ssid=yes hide-ssid=no
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.194.65/26"] do={remove $i}
/ ip address add address=10.138.194.65/26 network=10.138.194.64 broadcast=10.138.194.127 interface=wlan2 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.194.64/26] do={/routing bgp network remove $i;}
add network=10.138.194.64/26 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wlan2] do={/routing ospf interface remove $i;}
add interface=wlan2
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.194.64/26] do={/routing ospf network remove $i;}
add network=10.138.194.64/26 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wlan2] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan2 ranges=10.138.194.71-10.138.194.126
:foreach i in [/ip dhcp-server find name=dhcp-wlan2] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wlan2 interface=wlan2 address-pool=dhcp-wlan2 disabled=no
:foreach i in [/ip dhcp-server network find address="10.138.194.64/26"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.194.64/26 gateway=10.138.194.65 domain=guifi.net comment=dhcp-wlan2
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.194.66 mac-address=ff:ff:ff:ff:ff:ff client-id=MTQEsteveRadio1 server=dhcp-wlan2
add address=10.138.194.67 mac-address=ff:ff:ff:ff:ff:ff client-id=MTQnuriRadio1 server=dhcp-wlan2
add address=10.138.194.68 mac-address=ff:ff:ff:ff:ff:ff client-id=mtqoliverRadio1 server=dhcp-wlan2
add address=10.138.194.69 mac-address=00:16:01:AF:D8:2E client-id=MTQGrauSadurniRadio1 server=dhcp-wlan2
add address=10.138.194.70 mac-address=00:16:01:F2:0E:A6 client-id=MTQAngelyRadio1 server=dhcp-wlan2
add address=10.138.194.71 mac-address=00:1D:7E:E3:91:2D client-id=MontesquiuATorreguitRadio1 server=dhcp-wlan2
add address=10.138.194.72 mac-address=00:1D:7E:C6:D2:32 client-id=MTQrivesRadio1 server=dhcp-wlan2
add address=10.138.194.73 mac-address=ff:ff:ff:ff:ff:ff client-id=MtqVilarrasaRadio1 server=dhcp-wlan2
add address=10.138.194.74 mac-address=00:16:01:AF:E3:F8 client-id=MTQTRastrejoRadio1 server=dhcp-wlan2
add address=10.138.194.75 mac-address=ff:ff:ff:ff:ff:ff client-id=MtqCodinachRadio1 server=dhcp-wlan2
add address=10.138.194.76 mac-address=00:16:01:F2:08:32 client-id=MTQMerceRadio1 server=dhcp-wlan2
add address=10.138.194.77 mac-address=00:1D:7E:F1:03:B2 client-id=MTQAPortellRadio2 server=dhcp-wlan2
add address=10.138.194.78 mac-address=00:1D:7E:43:BD:83 client-id=MTQORuizRadio1 server=dhcp-wlan2
add address=10.138.194.79 mac-address=00:16:01:B0:62:B5 client-id=MQSSergiNuriRadio1 server=dhcp-wlan2
add address=10.138.194.80 mac-address=ff:ff:ff:ff:ff:ff client-id=MTQManuelGRadio1 server=dhcp-wlan2
add address=10.138.194.81 mac-address=00:16:01:B0:85:F4 client-id=MTQFrancescRRadio1 server=dhcp-wlan2
add address=10.138.194.82 mac-address=00:1E:E5:46:9B:05 client-id=pbmontesquiuRd1 server=dhcp-wlan2
add address=10.138.194.83 mac-address=00:15:6D:A7:C0:3E client-id=MTQSalamancaRd1 server=dhcp-wlan2
add address=10.138.194.84 mac-address=00:15:6D:A6:DE:FB client-id=MTQNuriaPRd1 server=dhcp-wlan2
add address=10.138.194.85 mac-address=00:15:6D:A9:BD:9A client-id=MTQAlternacRd1 server=dhcp-wlan2
add address=10.138.194.86 mac-address=00:14:BF:C9:10:1B client-id=MTQRpujolaRd1 server=dhcp-wlan2
add address=10.138.194.87 mac-address=00:22:6B:6D:FE:BD client-id=MTQARubioRd1 server=dhcp-wlan2
add address=10.138.194.88 mac-address=00:15:6D:AB:6A:2C client-id=MTSQJosepcomaarmRd1 server=dhcp-wlan2
add address=10.138.194.89 mac-address=00:21:29:A1:E9:E7 client-id=MTQCarmeMRd1 server=dhcp-wlan2
add address=10.138.194.90 mac-address=00:15:6D:10:55:BC client-id=MTSQCtraRibes20Rd1 server=dhcp-wlan2
add address=10.138.194.91 mac-address=00:15:6D:A6:9C:C0 client-id=mtqannahelenaRd1 server=dhcp-wlan2
add address=10.138.194.92 mac-address=00:15:6D:AB:70:C3 client-id=MTQIForteaRd1 server=dhcp-wlan2
add address=10.138.194.93 mac-address=00:15:6D:AB:62:D6 client-id=MTQlaferreriavellaRd1 server=dhcp-wlan2
add address=10.138.194.94 mac-address=00:15:6D:AA:BB:30 client-id=MtqPacoRd1 server=dhcp-wlan2
add address=10.138.194.95 mac-address=00:15:6D:A9:BE:11 client-id=MTQpujolRd1 server=dhcp-wlan2
add address=10.138.194.96 mac-address=00:15:6D:AD:5D:D7 client-id=MTQramonabusomsRd1 server=dhcp-wlan2
add address=10.138.194.97 mac-address=00:15:6D:AC:F3:85 client-id=MTQArxiuMunRd1 server=dhcp-wlan2
add address=10.138.194.98 mac-address=00:15:6D:D2:E0:39 client-id=MTQXavierGRd1 server=dhcp-wlan2
add address=10.138.194.99 mac-address=00:15:6D:AE:18:EE client-id=MTQnrcBlscRd1 server=dhcp-wlan2
add address=10.138.194.100 mac-address=00:15:6D:AD:D8:F8 client-id=MTQxavi920Rd1 server=dhcp-wlan2
add address=10.138.194.101 mac-address=00:15:6D:DB:16:E5 client-id=MTQcasaculturaRd1 server=dhcp-wlan2
add address=10.138.194.102 mac-address=00:15:6D:AB:F8:61 client-id=MTQesmsaboi26Rd1 server=dhcp-wlan2
add address=10.138.194.103 mac-address=00:15:6D:D6:96:24 client-id=MTQesmpaucas7Rd2 server=dhcp-wlan2
add address=10.138.194.104 mac-address=00:15:6D:AB:DE:D1 client-id=MTQXJoanFRd1 server=dhcp-wlan2
add address=10.138.194.105 mac-address=00:15:6D:DB:CE:20 client-id=MTQhortaRd1 server=dhcp-wlan2
add address=10.138.194.106 mac-address=00:15:6D:D8:16:F0 client-id=MTQEstefaniaHRd1 server=dhcp-wlan2
add address=10.138.194.107 mac-address=00:15:6D:DA:A6:EC client-id=MTQEPousRd1 server=dhcp-wlan2
add address=10.138.194.108 mac-address=00:15:6D:DB:BA:48 client-id=MontesquiuCristianZRd1 server=dhcp-wlan2
add address=10.138.194.109 mac-address=00:25:9C:42:27:E6 client-id=MTQJSantaolallaRd1 server=dhcp-wlan2
add address=10.138.194.110 mac-address=00:25:9C:42:29:7E client-id=MTQLluisRd1 server=dhcp-wlan2
add address=10.138.194.111 mac-address=00:15:6D:F8:36:36 client-id=MTQFGutierrezRd2 server=dhcp-wlan2
add address=10.138.194.112 mac-address=00:15:6D:73:9B:5D client-id=MTQACasasesRd1 server=dhcp-wlan2
add address=10.138.194.113 mac-address=00:15:6D:1F:48:3D client-id=MTGFIniestaRd1 server=dhcp-wlan2
add address=10.138.194.114 mac-address=00:15:6D:F2:B3:43 client-id=MTQSchanzengrafRd2 server=dhcp-wlan2
add address=10.138.194.115 mac-address=00:15:6D:F2:9C:12 client-id=MTQBertaORd1 server=dhcp-wlan2
add address=10.138.194.116 mac-address=00:15:6D:F2:9B:F8 client-id=MTQMontseSRd1 server=dhcp-wlan2
add address=10.138.194.117 mac-address=00:15:6D:AD:19:3B client-id=MTQJordiCRd1 server=dhcp-wlan2
add address=10.138.194.118 mac-address=00:15:6D:3A:64:CA client-id=MTQMartiSRd1 server=dhcp-wlan2
add address=10.138.194.119 mac-address=00:15:6D:9D:56:31 client-id=MTQolgaRd1 server=dhcp-wlan2
add address=10.138.194.120 mac-address=00:27:22:18:69:88 client-id=MTQOmarARd1 server=dhcp-wlan2
add address=10.138.194.121 mac-address=00:1C:10:BF:69:0C client-id=MTQHenryHRd1 server=dhcp-wlan2
#
:delay 1
# Type: wds/p2p
# Eliminar todas las interfaces wds existentes
:foreach i in [/interface wireless wds find master-interface=wlan2] \
do={:foreach n in [/interface wireless wds get $i name] \
do={:foreach inum in [/ip address find interface=$n] \
do={/ip address remove $inum;};}; \
/interface wireless wds remove $i;}
#
:delay 1
#
# Radio#: 2 MontesquiuBellmunt
/interface wireless set wlan3 name="wlan3" \
radio-name="MontesquiuBellmunt" mode=ap-bridge ssid="guifi.net-MontesquiuBellmunt" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=24 \
frequency=5660 \
dfs-mode=none \
wds-mode=static wds-default-bridge=none wds-default-cost=100 \
wds-cost-range=50-150 wds-ignore-ssid=yes hide-ssid=no
:delay 1
# Type: wds/p2p
# Eliminar todas las interfaces wds existentes
:foreach i in [/interface wireless wds find master-interface=wlan3] \
do={:foreach n in [/interface wireless wds get $i name] \
do={:foreach inum in [/ip address find interface=$n] \
do={/ip address remove $inum;};}; \
/interface wireless wds remove $i;}
/ interface wireless wds
add name="wds_BellmuntNord" master-interface=wlan3 wds-address=00:0B:6B:57:EE:65 disabled=no
/ ip address add address=172.25.224.14/30 network=172.25.224.12 broadcast=172.25.224.15 interface=wds_BellmuntNord disabled=no comment="wds_BellmuntNord"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_BellmuntNord] do={/routing ospf interface remove $i;}
add interface=wds_BellmuntNord
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.224.12/30] do={/routing ospf network remove $i;}
add network=172.25.224.12/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=BellmuntNord] do={/routing bgp peer remove $i;}
add name="BellmuntNord" instance=default remote-address=172.25.224.13 remote-as=4326 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 3 MontesquiuSQB
/interface wireless set wlan4 name="wlan4" \
radio-name="MontesquiuSQB" mode=ap-bridge ssid="guifi.net-MontesquiuSQB" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=24 \
frequency=5680 \
dfs-mode=none \
wds-mode=static wds-default-bridge=none wds-default-cost=100 \
wds-cost-range=50-150 wds-ignore-ssid=yes hide-ssid=no
:delay 1
# Type: wds/p2p
# Eliminar todas las interfaces wds existentes
:foreach i in [/interface wireless wds find master-interface=wlan4] \
do={:foreach n in [/interface wireless wds get $i name] \
do={:foreach inum in [/ip address find interface=$n] \
do={/ip address remove $inum;};}; \
/interface wireless wds remove $i;}
/ interface wireless wds
add name="wds_SQBRepetidor2" master-interface=wlan4 wds-address=00:0B:6B:81:CF:6B disabled=no
/ ip address add address=172.25.224.6/30 network=172.25.224.4 broadcast=172.25.224.7 interface=wds_SQBRepetidor2 disabled=no comment="wds_SQBRepetidor2"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_SQBRepetidor2] do={/routing ospf interface remove $i;}
add interface=wds_SQBRepetidor2
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.224.4/30] do={/routing ospf network remove $i;}
add network=172.25.224.4/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=SQBRepetidor2] do={/routing bgp peer remove $i;}
add name="SQBRepetidor2" instance=default remote-address=172.25.224.5 remote-as=2798 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Routed device
#
# Otra conexiones cableadas
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=ether2] do={/routing ospf interface remove $i;}
add interface=ether2
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.224.32/30] do={/routing ospf network remove $i;}
add network=172.25.224.32/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=MontesquiuCampanarST2] do={/routing bgp peer remove $i;}
add name="MontesquiuCampanarST2" instance=default remote-address=172.25.224.33 remote-as=9845 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
:foreach i in [/ip address find address="172.25.224.34/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.224.34/30 network=172.25.224.32 broadcast=172.25.224.35 interface=ether2 disabled=no comment="MontesquiuCampanarST2"
#
# NAT de direcciones internas
:foreach i in [/ip firewall nat find src-address="172.16.0.0/12"] do={/ip firewall nat remove $i;}
:foreach i in [/ip firewall nat find src-address="192.168.0.0/16"] do={/ip firewall nat remove $i;}
/ip firewall nat
add chain=srcnat src-address="192.168.0.0/16" dst-address=!192.168.0.0/16 action=src-nat to-addresses=10.138.194.1 to-ports=0-65535 comment="" disabled=no
add chain=srcnat src-address="172.16.0.0/12" dst-address=!172.16.0.0/12 protocol=!ospf action=src-nat to-addresses=10.138.194.1 to-ports=0-65535 comment="" disabled=no
#
# Enrutamiento BMP
# BGP & OSPF Filters
:foreach i in [/routing filter find chain=ospf-in] do={/routing filter remove $i;}
:foreach i in [/routing filter find chain=ospf-out] do={/routing filter remove $i;}
:foreach i in [/routing filter find chain=ebgp-in] do={/routing filter remove $i;}
:foreach i in [/routing filter find chain=ebgp-out] do={/routing filter remove $i;}
/ routing filter
add action=discard chain=ebgp-in comment="1. Discard insert non 10.x routes from BGP peer" disabled=no invert-match=no prefix=!10.0.0.0/8 prefix-length=!8-32
add action=discard chain=ebgp-out comment="2. Discard send non 10.x routes to BGP peer" disabled=no invert-match=no prefix=!10.0.0.0/8 prefix-length=!8-32
add action=accept chain=ospf-in comment="3. Accept insert 10.x routes from OSPF neighbor" disabled=no invert-match=no prefix=10.0.0.0/8 prefix-length=8-32
add action=accept chain=ospf-in comment="4. Accept insert 172.x routes from OSPF neighbor" disabled=no invert-match=no prefix=172.16.0.0/12 prefix-length=8-32
add action=discard chain=ospf-in comment="5. Discard insert non 10.x and 172.x from OSPF neighbor" disabled=no invert-match=no
add action=accept chain=ospf-out comment="6. Allow send 10.x routes to OSPF neighbor" disabled=no invert-match=no prefix=10.0.0.0/8 prefix-length=8-32
add action=accept chain=ospf-out comment="7. Allow send 172.x routes to OSPF neighbor" disabled=no invert-match=no prefix=172.16.0.0/12 prefix-length=8-32
add action=discard chain=ospf-out comment="8. Discard send non 10.x and 172.x to OSPF neighbor" disabled=no invert-match=no
#
# instancia BGP
/ routing bgp instance
set default name="default" as=5515 router-id=10.138.194.1 \
redistribute-connected=yes redistribute-static=yes redistribute-rip=yes \
redistribute-ospf=yes redistribute-other-bgp=yes out-filter=ebgp-out \
client-to-client-reflection=yes comment="" disabled=no
#
# Enrutamiento OSPF
/routing ospf set router-id=10.138.194.1 distribute-default=never redistribute-connected=no \
redistribute-static=no redistribute-rip=no redistribute-bgp=as-type-1
#
:log info "Unsolclic for 5515-MontesquiuCampanarST1 executed."
/