# Generado por:
# RouterOSv2.9
:log info "Unsolclic for 115-GurbCEPAST2 going to be executed."
#
# Configuration for RouterOS > 2.9.51 or 3.x
# Device: 115-GurbCEPAST2
#
# WARNING: Beta version
#
# Methods to upload/execute this script:
# 1.-As a script. Upload this output as a script either with:
# a.Winbox (with Linux, wine required)
# b.Terminal (telnet, ssh...)
# Then execute the script with:
# > /system script run script_name
# 2.-Imported file:
# Save this output to a file, then upload it to the router
# using ftp using a name like "script_name.rsc".
# (note that extension ".rsc" is required)
# Run the import file using the command:
# > /import script_name
# 3.-Telnet cut&paste:
# Open a terminal session, and cut&paste this output
# directly on the terminal input.
#
# Notas:
# -routing-test package is required, be sure you have it enabled at system packages
# -wlans should be enabled manually, be sure to set the correct antenna (a or b)
# according in how did you connect the cable to the miniPCI. Keep the
# power at the minimum possible and check the channel.
# -The script doesn't reset the router, you might have to do it manually
# -You must have write access to the router
# -MAC access (winbox, MAC telnet...) method is recommended
# (the script reconfigures some IP addresses, so communication can be lost)
# -No changes are done in user passwords on the device
# -A Read Only guest account with no password will be created to allow guest access
# to the router with no danger of damage but able to see the config.
# -Be sure that all packages are activated.
# -Don't run the script from telnet and being connected through an IP connection at
# the wLan/Lan interface: This interface will be destroyed during the script.
#
/ system identity set name=GurbCEPAST2
#
# DNS (client & server cache) zone: 2451
/ip dns set primary-dns=10.138.25.68 secondary-dns=10.138.0.2 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 2451
/system ntp client set enabled=yes mode=unicast primary-ntp=10.138.15.130 secondary-ntp=10.138.15.130
/system ntp server set manycast=no enabled=yes
:delay 1
#
# Bandwidth-server
/ tool bandwidth-server set enabled=yes authenticate=no allocate-udp-ports-from=2000
#
# SNMP
/snmp set contact="guifi@guifi.net" enabled=yes location="GurbCEPA"
#
# 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
#
# Graphing
/tool graphing interface add
# Remove current wLan/Lan bridge if exists
: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;}
# Construct main bridge on wlan1 & 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 GurbCEPAPonent
/interface wireless set wlan1 name="wlan1" \
radio-name="GurbCEPAPonent" mode=ap-bridge ssid="guifi.net-GurbCEPAPonent" \
band="2.4ghz-b" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=2432 \
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.12.97/27"] do={remove $i}
/ ip address add address=10.138.12.97/27 network=10.138.12.96 broadcast=10.138.12.127 interface=wLan/Lan 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.12.96/27] do={/routing ospf network remove $i;}
add network=10.138.12.96/27 area=backbone disabled=no
:delay 1
#
# DHCP
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.12.98 mac-address=00:12:17:C7:DB:BC client-id=GurbJVerdaguer server=dhcp-wLan/Lan
add address=10.138.12.99 mac-address=00:14:BF:16:11:3D client-id=GurbSarreta server=dhcp-wLan/Lan
add address=10.138.12.100 mac-address=00:18:39:CE:CB:AD client-id=GurbCFloresRadio1 server=dhcp-wLan/Lan
add address=10.138.12.101 mac-address=00:12:16:FF:FF:FF client-id=GurbRojo server=dhcp-wLan/Lan
add address=10.138.12.102 mac-address=00:12:17:49:87:6D client-id=GurbCanBorra server=dhcp-wLan/Lan
add address=10.138.12.103 mac-address=ff:ff:ff:ff:ff:ff client-id=GurbQuatecasas server=dhcp-wLan/Lan
add address=10.138.12.104 mac-address=ff:ff:ff:ff:ff:ff client-id=GurbjmdevesaRadio2 server=dhcp-wLan/Lan
add address=10.138.12.105 mac-address=00:12:17:BC:F1:C0 client-id=GurbJMora server=dhcp-wLan/Lan
add address=10.138.12.106 mac-address=00:12:17:B7:FC:6E client-id=GurbGNovellas server=dhcp-wLan/Lan
add address=10.138.12.107 mac-address=00:16:B6:D8:EF:E3 client-id=GurbMontserrat22 server=dhcp-wLan/Lan
add address=10.138.12.108 mac-address=00:14:BF:EB:93:C2 client-id=GurbMedina server=dhcp-wLan/Lan
add address=10.138.12.109 mac-address=00:12:17:B7:FC:59 client-id=GurbMSalaRadio1 server=dhcp-wLan/Lan
add address=10.138.12.110 mac-address=00:15:6D:A7:B8:5B client-id=GurbDavRosRd1 server=dhcp-wLan/Lan
add address=10.138.12.111 mac-address=ff:ff:ff:ff:ff:ff client-id=GurbFrancescXavierRadio1 server=dhcp-wLan/Lan
add address=10.138.12.112 mac-address=00:16:01:AE:34:A0 client-id=GurbSussannaRadio1 server=dhcp-wLan/Lan
add address=10.138.12.113 mac-address=00:16:01:AF:D5:84 client-id=GurbJforcadaRadio1 server=dhcp-wLan/Lan
add address=10.138.12.114 mac-address=00:16:B6:11:47:FD client-id=gurbbadosaRadio1 server=dhcp-wLan/Lan
add address=10.138.12.115 mac-address=00:0D:0B:FD:5B:5D client-id=GurbMasElGornalRadio1 server=dhcp-wLan/Lan
add address=10.138.12.116 mac-address=00:15:6D:A7:B8:61 client-id=GurbMGarridoRadio1 server=dhcp-wLan/Lan
add address=10.138.12.117 mac-address=00:13:02:3C:E5:58 client-id=GurbBordallo server=dhcp-wLan/Lan
add address=10.138.12.118 mac-address=00:18:39:AE:6C:E9 client-id=GurbCesarRadio1 server=dhcp-wLan/Lan
add address=10.138.12.119 mac-address=00:16:B6:39:8F:3B client-id=GurbCastellsVicSLRadio1 server=dhcp-wLan/Lan
add address=10.138.12.120 mac-address=ff:ff:ff:ff:ff:ff client-id=GurbMVerdaguerRadio1 server=dhcp-wLan/Lan
add address=10.138.12.122 mac-address=00:18:39:C6:26:8D client-id=GurbPlanellRadio1 server=dhcp-wLan/Lan
add address=10.138.12.123 mac-address=00:16:01:92:67:3A client-id=GurbVilaroTarresRadio1 server=dhcp-wLan/Lan
add address=10.138.12.124 mac-address=00:13:10:7A:DC:0E client-id=GurbMuntadaRadio1 server=dhcp-wLan/Lan
add address=10.138.12.125 mac-address=00:18:F8:F1:9C:6D client-id=GurbRonRadio1 server=dhcp-wLan/Lan
add address=10.138.12.126 mac-address=00:13:10:7B:1A:1D client-id=GurbDeToro server=dhcp-wLan/Lan
:foreach i in [/ip dhcp-server network find address="10.138.12.96/27"] do={/ip dhcp-server network remove $i;}
: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.12.126-10.138.12.126
/ip dhcp-server network add address=10.138.12.96/27 gateway=10.138.12.97 domain=guifi.net comment=dhcp-wLan/Lan
: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=yes
#
:delay 1
# Type: wds/p2p
# Remove all existing wds interfaces
: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;}
/ interface wireless wds
add name="wds_GurbCanFalgueras" master-interface=wlan1 wds-address=00:0F:66:51:9F:D3 disabled=no
/ ip address add address=172.25.0.49/30 network=172.25.0.48 broadcast=172.25.0.51 interface=wds_GurbCanFalgueras disabled=no comment="wds_GurbCanFalgueras"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_GurbCanFalgueras] do={/routing ospf interface remove $i;}
add interface=wds_GurbCanFalgueras
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.0.48/30] do={/routing ospf network remove $i;}
add network=172.25.0.48/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=GurbCanFalgueras] do={/routing bgp peer remove $i;}
add name="GurbCanFalgueras" instance=default remote-address=172.25.0.50 remote-as=17 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=yes
/ interface wireless wds
add name="wds_GurbCamprodon" master-interface=wlan1 wds-address=00:12:17:07:53:99 disabled=no
/ ip address add address=172.25.0.193/30 network=172.25.0.192 broadcast=172.25.0.195 interface=wds_GurbCamprodon disabled=no comment="wds_GurbCamprodon"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_GurbCamprodon] do={/routing ospf interface remove $i;}
add interface=wds_GurbCamprodon
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.0.192/30] do={/routing ospf network remove $i;}
add network=172.25.0.192/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=GurbCamprodon] do={/routing bgp peer remove $i;}
add name="GurbCamprodon" instance=default remote-address=172.25.0.194 remote-as=67 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=yes
/ interface wireless wds
add name="wds_GurbConcepcio" master-interface=wlan1 wds-address=00:12:17:15:DD:4D disabled=no
/ ip address add address=172.25.0.253/30 network=172.25.0.252 broadcast=172.25.0.255 interface=wds_GurbConcepcio disabled=no comment="wds_GurbConcepcio"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_GurbConcepcio] do={/routing ospf interface remove $i;}
add interface=wds_GurbConcepcio
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.0.252/30] do={/routing ospf network remove $i;}
add network=172.25.0.252/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=GurbConcepcio] do={/routing bgp peer remove $i;}
add name="GurbConcepcio" instance=default remote-address=172.25.0.254 remote-as=84 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=yes
/ interface wireless wds
add name="wds_GurbJSoler" master-interface=wlan1 wds-address=00:12:17:15:E5:A8 disabled=no
/ ip address add address=172.25.1.1/30 network=172.25.1.0 broadcast=172.25.1.3 interface=wds_GurbJSoler disabled=no comment="wds_GurbJSoler"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_GurbJSoler] do={/routing ospf interface remove $i;}
add interface=wds_GurbJSoler
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.1.0/30] do={/routing ospf network remove $i;}
add network=172.25.1.0/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=GurbJSoler] do={/routing bgp peer remove $i;}
add name="GurbJSoler" instance=default remote-address=172.25.1.2 remote-as=85 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=yes
/ interface wireless wds
add name="wds_GurbPCosta" master-interface=wlan1 wds-address=00:12:17:49:7D:48 disabled=no
/ ip address add address=172.25.1.61/30 network=172.25.1.60 broadcast=172.25.1.63 interface=wds_GurbPCosta disabled=no comment="wds_GurbPCosta"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_GurbPCosta] do={/routing ospf interface remove $i;}
add interface=wds_GurbPCosta
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.1.60/30] do={/routing ospf network remove $i;}
add network=172.25.1.60/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=GurbPCosta] do={/routing bgp peer remove $i;}
add name="GurbPCosta" instance=default remote-address=172.25.1.62 remote-as=98 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=yes
/ interface wireless wds
add name="wds_CanTio" master-interface=wlan1 wds-address=00:0F:66:D9:B9:3F disabled=no
/ ip address add address=172.25.1.77/30 network=172.25.1.76 broadcast=172.25.1.79 interface=wds_CanTio disabled=no comment="wds_CanTio"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_CanTio] do={/routing ospf interface remove $i;}
add interface=wds_CanTio
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.1.76/30] do={/routing ospf network remove $i;}
add network=172.25.1.76/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=CanTio] do={/routing bgp peer remove $i;}
add name="CanTio" instance=default remote-address=172.25.1.78 remote-as=103 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=yes
/ interface wireless wds
add name="wds_GurbCMundo" master-interface=wlan1 wds-address=00:12:17:49:C7:A6 disabled=no
/ ip address add address=172.25.1.81/30 network=172.25.1.80 broadcast=172.25.1.83 interface=wds_GurbCMundo disabled=no comment="wds_GurbCMundo"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_GurbCMundo] do={/routing ospf interface remove $i;}
add interface=wds_GurbCMundo
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.1.80/30] do={/routing ospf network remove $i;}
add network=172.25.1.80/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=GurbCMundo] do={/routing bgp peer remove $i;}
add name="GurbCMundo" instance=default remote-address=172.25.1.82 remote-as=104 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=yes
#
:delay 1
#
# Radio#: 1 APCepaNord
/interface wireless set wlan2 name="wlan2" \
radio-name="APCepaNord" mode=ap-bridge ssid="guifi.net-APCepaNord" \
band="2.4ghz-b" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
dfs-mode=radar-detect \
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.12.161/27"] do={remove $i}
/ ip address add address=10.138.12.161/27 network=10.138.12.160 broadcast=10.138.12.191 interface=wlan2 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.12.160/27] do={/routing ospf network remove $i;}
add network=10.138.12.160/27 area=backbone disabled=no
:delay 1
#
# DHCP
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.12.162 mac-address=00:16:01:84:5A:AC client-id=GurbSantRoc20 server=dhcp-wlan2
add address=10.138.12.163 mac-address=ff:ff:ff:ff:ff:ff client-id=GurbComellesRadio1 server=dhcp-wlan2
add address=10.138.12.164 mac-address=ff:ff:ff:ff:ff:ff client-id=alcalaradio1 server=dhcp-wlan2
add address=10.138.12.165 mac-address=00:12:17:DE:0D:82 client-id=VicGafonalRadio1 server=dhcp-wlan2
add address=10.138.12.166 mac-address=00:16:01:16:70:A5 client-id=GurbCEIPLesEscolesRadio1 server=dhcp-wlan2
add address=10.138.12.167 mac-address=00:18:39:AE:63:ED client-id=GurbIBassaganaRadio1 server=dhcp-wlan2
add address=10.138.12.168 mac-address=00:18:F8:F1:C4:A8 client-id=GurbJosepBlancafortRadio1 server=dhcp-wlan2
add address=10.138.12.169 mac-address=ff:ff:ff:ff:ff:ff client-id=GurbDMRadio1 server=dhcp-wlan2
add address=10.138.12.170 mac-address=00:18:F8:F2:2B:4D client-id=GurbJSubiranaRadio2 server=dhcp-wlan2
add address=10.138.12.171 mac-address=00:16:01:F2:14:3E client-id=GurbTriniRadio1 server=dhcp-wlan2
add address=10.138.12.172 mac-address=00:16:01:AE:2C:36 client-id=GurbForjaRadio1 server=dhcp-wlan2
add address=10.138.12.173 mac-address=00:18:39:AE:64:8E client-id=GurbAutoElectricRadio1 server=dhcp-wlan2
add address=10.138.12.174 mac-address=00:16:01:8C:06:3C client-id=GurbLluisNRadio1 server=dhcp-wlan2
add address=10.138.12.175 mac-address=00:16:01:F2:13:FA client-id=GurbFerryRadio1 server=dhcp-wlan2
add address=10.138.12.176 mac-address=00:18:39:BF:B4:29 client-id=GurbCCano server=dhcp-wlan2
add address=10.138.12.177 mac-address=00:19:E0:67:56:F7 client-id=GurbIRoviraRadio1 server=dhcp-wlan2
add address=10.138.12.178 mac-address=00:16:01:4D:7A:D4 client-id=GurbCanSegalesRadio1 server=dhcp-wlan2
add address=10.138.12.179 mac-address=00:16:01:AD:C6:AE client-id=GurbCCrivilleRadio1 server=dhcp-wlan2
add address=10.138.12.180 mac-address=00:80:48:4E:FF:AA client-id=GurbAdelaidaRadio1 server=dhcp-wlan2
add address=10.138.12.181 mac-address=00:16:01:AE:EF:08 client-id=GurbVerdaguerRadio42 server=dhcp-wlan2
add address=10.138.12.182 mac-address=00:1C:10:44:2E:8C client-id=GurbDeveBetRadio1 server=dhcp-wlan2
add address=10.138.12.183 mac-address=00:16:B6:D9:14:A0 client-id=GurbFerranSarriRadio1 server=dhcp-wlan2
add address=10.138.12.184 mac-address=00:16:01:AF:E2:BE client-id=GurbMangelsRadio1 server=dhcp-wlan2
add address=10.138.12.185 mac-address=00:16:01:AF:BD:FC client-id=GurbpuigmalRadio1 server=dhcp-wlan2
add address=10.138.12.186 mac-address=00:16:01:F2:3D:C4 client-id=GurbEduBertaRadio1 server=dhcp-wlan2
add address=10.138.12.187 mac-address=00:13:10:7B:1A:06 client-id=GurbRauliPilarRadio1 server=dhcp-wlan2
add address=10.138.12.188 mac-address=00:15:6D:A6:93:74 client-id=GurbJoanBlancafort server=dhcp-wlan2
add address=10.138.12.189 mac-address=00:16:01:B0:5A:D2 client-id=GurbJoanVRadio1 server=dhcp-wlan2
add address=10.138.12.190 mac-address=00:16:01:84:72:B6 client-id=DavidHomsRadio server=dhcp-wlan2
:foreach i in [/ip dhcp-server network find address="10.138.12.160/27"] do={/ip dhcp-server network remove $i;}
:foreach i in [/ip pool find name=dhcp-wlan2] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan2 ranges=10.138.12.190-10.138.12.190
/ip dhcp-server network add address=10.138.12.160/27 gateway=10.138.12.161 domain=guifi.net comment=dhcp-wlan2
: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=yes
#
:delay 1
# Type: wds/p2p
# Remove all existing wds interfaces
: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 GurbCEPAjuntament
/interface wireless set wlan3 name="wlan3" \
radio-name="GurbCEPAjuntament" mode=ap-bridge ssid="guifi.net-GurbCEPAjuntament" \
band="5ghz" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=5560 \
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
# Remove all existing wds interfaces
: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_STEsperanca" master-interface=wlan3 wds-address=00:0C:42:05:4F:51 disabled=no
/ ip address add address=172.25.4.217/30 network=172.25.4.216 broadcast=172.25.4.219 interface=wds_STEsperanca disabled=no comment="wds_STEsperanca"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_STEsperanca] do={/routing ospf interface remove $i;}
add interface=wds_STEsperanca
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.4.216/30] do={/routing ospf network remove $i;}
add network=172.25.4.216/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=STEsperanca] do={/routing bgp peer remove $i;}
add name="STEsperanca" instance=default remote-address=172.25.4.218 remote-as=2385 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=no
#
:delay 1
#
# Radio#: 3 GurbCepa5GHzAP1
/interface wireless set wlan4 name="wlan4" \
radio-name="GurbCepa5GHzAP1" mode=ap-bridge ssid="guifi.net-GurbCepa5GHzAP1" \
band="5ghz" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=5240 \
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.0.65/27"] do={remove $i}
/ ip address add address=10.138.0.65/27 network=10.138.0.64 broadcast=10.138.0.95 interface=wlan4 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wlan4] do={/routing ospf interface remove $i;}
add interface=wlan4
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.0.64/27] do={/routing ospf network remove $i;}
add network=10.138.0.64/27 area=backbone disabled=no
:delay 1
#
# DHCP
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.0.66 mac-address=00:0C:42:15:BA:21 client-id=GurbquatresalaRadio1 server=dhcp-wlan4
add address=10.138.0.67 mac-address=00:13:10:3F:A8:93 client-id=Pujolassos server=dhcp-wlan4
add address=10.138.0.68 mac-address=00:16:E6:34:D5:57 client-id=GurbAmasRadio1 server=dhcp-wlan4
add address=10.138.0.69 mac-address=00:15:6D:B6:69:43 client-id=GurbBielRadio1 server=dhcp-wlan4
add address=10.138.0.70 mac-address=00:15:6D:B6:B6:15 client-id=GurbJMauriRadio2 server=dhcp-wlan4
add address=10.138.0.71 mac-address=00:15:6D:B6:B8:65 client-id=GurbManuRadio1 server=dhcp-wlan4
add address=10.138.0.72 mac-address=00:15:6D:B7:6A:43 client-id=GurbMRieraRadio2 server=dhcp-wlan4
add address=10.138.0.73 mac-address=00:15:6D:B9:11:59 client-id=GurbERoviro server=dhcp-wlan4
add address=10.138.0.74 mac-address=00:16:E6:34:D5:57 client-id=GurbvilaroRd1 server=dhcp-wlan4
add address=10.138.0.75 mac-address=00:15:6D:BA:45:23 client-id=GurbPereRd1 server=dhcp-wlan4
add address=10.138.0.76 mac-address=00:15:6D:B9:44:B9 client-id=GrblvrBlscRd2 server=dhcp-wlan4
add address=10.138.0.78 mac-address=00:15:6D:BA:45:13 client-id=gurbelsolerpi18Rd1 server=dhcp-wlan4
:foreach i in [/ip dhcp-server network find address="10.138.0.64/27"] do={/ip dhcp-server network remove $i;}
:foreach i in [/ip pool find name=dhcp-wlan4] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan4 ranges=10.138.0.84-10.138.0.94
/ip dhcp-server network add address=10.138.0.64/27 gateway=10.138.0.65 domain=guifi.net comment=dhcp-wlan4
:foreach i in [/ip dhcp-server find name=dhcp-wlan4] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wlan4 interface=wlan4 address-pool=dhcp-wlan4 disabled=no
#
:delay 1
# Type: wds/p2p
# Remove all existing wds interfaces
: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_GurbSEsteveAPsud" master-interface=wlan4 wds-address=00:0C:42:05:4F:4E disabled=no
/ ip address add address=172.25.6.129/30 network=172.25.6.128 broadcast=172.25.6.131 interface=wds_GurbSEsteveAPsud disabled=no comment="wds_GurbSEsteveAPsud"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_GurbSEsteveAPsud] do={/routing ospf interface remove $i;}
add interface=wds_GurbSEsteveAPsud
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.6.128/30] do={/routing ospf network remove $i;}
add network=172.25.6.128/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=GurbSEsteveAPsud] do={/routing bgp peer remove $i;}
add name="GurbSEsteveAPsud" instance=default remote-address=172.25.6.130 remote-as=271 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=no
#
:delay 1
#
# Routed device
#
# Other cable connections
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=ether3] do={/routing ospf interface remove $i;}
add interface=ether3
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.4.192/30] do={/routing ospf network remove $i;}
add network=172.25.4.192/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=GurbCEPAST1] do={/routing bgp peer remove $i;}
add name="GurbCEPAST1" instance=default remote-address=172.25.4.193 remote-as=113 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=no
:foreach i in [/ip address find address="172.25.4.194/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.4.194/30 network=172.25.4.192 broadcast=172.25.4.195 interface=ether3 disabled=no comment="GurbCEPAST1"
#
# Internal addresses NAT
:foreach i in [/ip firewall nat find src-address="172.25.0.0/16"] 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.0.65 to-ports=0-65535 comment="" disabled=no
add chain=srcnat src-address="172.25.0.0/16" dst-address=!172.25.0.0/16 protocol=!ospf action=src-nat to-addresses=10.138.0.65 to-ports=0-65535 comment="" disabled=no
#
# BGP Routing
# 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;}
/ routing filter
add chain=ospf-out prefix=10.0.0.0/8 prefix-length=8-32 invert-match=no action=accept comment="" disabled=no
add chain=ospf-out invert-match=no action=discard comment="" disabled=no
add chain=ospf-in prefix=10.0.0.0/8 prefix-length=8-32 invert-match=no action=accept comment="" disabled=no
add chain=ospf-in invert-match=no action=reject comment="" disabled=no
#
# BGP instance
/ routing bgp instance
set default name="default" as=115 router-id=10.138.0.65 redistribute-static=yes \
redistribute-connected=yes redistribute-rip=yes redistribute-ospf=yes \
redistribute-other-bgp=yes out-filter=ospf-out \
client-to-client-reflection=yes comment="" disabled=no
#
# OSPF Routing
/routing ospf set router-id=10.138.0.65 redistribute-connected=as-type-1 redistribute-static=as-type-1 redistribute-bgp=as-type-1
#
:log info "Unsolclic for 115-GurbCEPAST2 executed."
/