# Generat per a:
# RouterOSv2.9
:log info "Unsolclic for 2581-TorelloCalsAvisST going to be executed."
#
# Configuration for RouterOS > 2.9.50 or 3.4
# Trasto: 2581-TorelloCalsAvisST
#
# 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.
#
# Notes:
# -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=TorelloCalsAvisST
#
# DNS (client & server cache) zone: 2471
/ip dns set primary-dns=10.138.50.194 secondary-dns=10.138.25.68 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 2471
/system ntp client set enabled=yes mode=unicast primary-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="TorelloCalsAvis"
#
# 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 TorelloCalsAvisAP1
/interface wireless set wlan1 name="wlan1" \
radio-name="TorelloCalsAvisAP1" mode=ap-bridge ssid="guifi.net-TorelloCalsAvisAP1" \
band="2.4ghz-b" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=2422 \
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=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
# Type: wLan/Lan
/ip address
:foreach i in [find address="10.138.60.161/27"] do={remove $i}
/ ip address add address=10.138.60.161/27 network=10.138.60.160 broadcast=10.138.60.191 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.60.160/27] do={/routing ospf network remove $i;}
add network=10.138.60.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.60.162 mac-address=00:13:10:83:7B:2B client-id=TorelloQToneuRadio4 server=dhcp-wLan/Lan
add address=10.138.60.163 mac-address=00:16:01:AF:01:12 client-id=TorelloJaumeiNuriaRadio1 server=dhcp-wLan/Lan
add address=10.138.60.164 mac-address=00:14:BF:D2:72:9B client-id=torellogestsoftRadio1 server=dhcp-wLan/Lan
add address=10.138.60.165 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloMolinaRadio1 server=dhcp-wLan/Lan
add address=10.138.60.166 mac-address=CD:F9:0E:74:69:23 client-id=TorellolXPratdesabaRadio1 server=dhcp-wLan/Lan
add address=10.138.60.167 mac-address=00:18:39:AE:6E:3C client-id=TorelloEAlemanyRadio1 server=dhcp-wLan/Lan
add address=10.138.60.168 mac-address=00:18:39:AE:57:3B client-id=TorelloRMontoro server=dhcp-wLan/Lan
add address=10.138.60.169 mac-address=00:14:BF:16:04:85 client-id=TorelloJVivet server=dhcp-wLan/Lan
add address=10.138.60.170 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloSToneuRadio server=dhcp-wLan/Lan
add address=10.138.60.171 mac-address=00:16:B6:D9:08:D0 client-id=TorelloQBautistaRadio1 server=dhcp-wLan/Lan
add address=10.138.60.172 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloTECRadio1 server=dhcp-wLan/Lan
add address=10.138.60.173 mac-address=00:18:39:C6:83:05 client-id=TorelloGSolanoRadio1 server=dhcp-wLan/Lan
add address=10.138.60.174 mac-address=00:18:39:86:FA:55 client-id=FVaqueRadio1 server=dhcp-wLan/Lan
add address=10.138.60.175 mac-address=34:07:44:74:96:2A client-id=neguhouseRadio1 server=dhcp-wLan/Lan
add address=10.138.60.176 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloYRuizRadio1 server=dhcp-wLan/Lan
add address=10.138.60.177 mac-address=00:18:39:BB:FF:AB client-id=TorelloJuvantenyRadio server=dhcp-wLan/Lan
add address=10.138.60.178 mac-address=00:16:01:84:5F:0A client-id=TorelloIvankaRadio1 server=dhcp-wLan/Lan
add address=10.138.60.179 mac-address=00:18:F8:7A:3A:56 client-id=TorelloMarioRadio1 server=dhcp-wLan/Lan
add address=10.138.60.180 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloCampsPlaRadio1 server=dhcp-wLan/Lan
add address=10.138.60.181 mac-address=00:1A:70:7B:6E:5A client-id=TorelloCMolasRadio1 server=dhcp-wLan/Lan
add address=10.138.60.182 mac-address=00:18:39:AE:6E:36 client-id=TorelloCarreraRadio1 server=dhcp-wLan/Lan
add address=10.138.60.183 mac-address=00:16:01:4D:78:D8 client-id=TorelloBFontRadio1 server=dhcp-wLan/Lan
add address=10.138.60.184 mac-address=00:16:01:84:65:56 client-id=TorelloPuigdecanetRadio1 server=dhcp-wLan/Lan
add address=10.138.60.185 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloDaniIsus server=dhcp-wLan/Lan
add address=10.138.60.186 mac-address=00:14:BF:B2:16:B0 client-id=TorelloPVilaRadio1 server=dhcp-wLan/Lan
add address=10.138.60.187 mac-address=ff:ff:ff:ff:ff:ff client-id=torellocunillRadio1 server=dhcp-wLan/Lan
add address=10.138.60.188 mac-address=ff:ff:ff:ff:ff:ff client-id=TorellojcasasRadio1 server=dhcp-wLan/Lan
add address=10.138.60.189 mac-address=00:14:BF:D2:6C:DE client-id=DaniAnnaRadio1 server=dhcp-wLan/Lan
add address=10.138.60.190 mac-address=00:07:E9:D4:C4:CE client-id=TorelloSReixachRadio1 server=dhcp-wLan/Lan
:foreach i in [/ip dhcp-server network find address="10.138.60.160/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.60.190-10.138.60.190
/ip dhcp-server network add address=10.138.60.160/27 gateway=10.138.60.161 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: wLan
/ip address
:foreach i in [find address="10.138.136.129/27"] do={remove $i}
/ ip address add address=10.138.136.129/27 network=10.138.136.128 broadcast=10.138.136.159 interface=wlan1 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wlan1] do={/routing ospf interface remove $i;}
add interface=wlan1
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.136.128/27] do={/routing ospf network remove $i;}
add network=10.138.136.128/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.136.130 mac-address=00:1C:10:9A:0A:5C client-id=TorelloXeviRadio1 server=dhcp-wlan1
add address=10.138.136.131 mac-address=00:18:F8:F1:CD:A1 client-id=TorelloalbertsRadio2 server=dhcp-wlan1
add address=10.138.136.132 mac-address=00:18:39:AE:46:76 client-id=TorelloCanParrellaRadio1 server=dhcp-wlan1
add address=10.138.136.133 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloAngelRadio3 server=dhcp-wlan1
add address=10.138.136.134 mac-address=00:1D:7E:4B:74:8F client-id=TorelloEBardoletRadio1 server=dhcp-wlan1
add address=10.138.136.135 mac-address=00:16:01:16:12:68 client-id=TorelloAFerresRadio3 server=dhcp-wlan1
add address=10.138.136.136 mac-address=00:16:B6:D9:87:38 client-id=torelloMoreraRadio2 server=dhcp-wlan1
add address=10.138.136.137 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloVPerezRadio2 server=dhcp-wlan1
add address=10.138.136.138 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloAVallejoRadio1 server=dhcp-wlan1
add address=10.138.136.139 mac-address=00:0B:6B:81:CE:AB client-id=TorelloJVillarrazoRadio2 server=dhcp-wlan1
add address=10.138.136.140 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloHurtadoRadio1 server=dhcp-wlan1
add address=10.138.136.141 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloRuaRadio2 server=dhcp-wlan1
add address=10.138.136.142 mac-address=00:16:01:B0:39:C4 client-id=TorelloOXuclaRadio1 server=dhcp-wlan1
add address=10.138.136.143 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloMMorenoRadio1 server=dhcp-wlan1
:foreach i in [/ip dhcp-server network find address="10.138.136.128/27"] do={/ip dhcp-server network remove $i;}
:foreach i in [/ip pool find name=dhcp-wlan1] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan1 ranges=10.138.136.149-10.138.136.158
/ip dhcp-server network add address=10.138.136.128/27 gateway=10.138.136.129 domain=guifi.net comment=dhcp-wlan1
:foreach i in [/ip dhcp-server find name=dhcp-wlan1] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wlan1 interface=wlan1 address-pool=dhcp-wlan1 disabled=no
#
:delay 1
#
# Radio#: 1 TorelloCalsAvisAP2
/interface wireless set wlan2 name="wlan2" \
radio-name="TorelloCalsAvisAP2" mode=ap-bridge ssid="guifi.net-TorelloCalsAvisAP2" \
band="2.4ghz-b" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
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: 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
# Type: wLan
/ip address
:foreach i in [find address="10.138.60.193/27"] do={remove $i}
/ ip address add address=10.138.60.193/27 network=10.138.60.192 broadcast=10.138.60.223 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.60.192/27] do={/routing ospf network remove $i;}
add network=10.138.60.192/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.60.194 mac-address=00:16:01:AF:DC:84 client-id=TorelloJBalmesRadio1 server=dhcp-wlan2
add address=10.138.60.195 mac-address=00:1D:73:18:3E:03 client-id=TorelloToniARadio1 server=dhcp-wlan2
add address=10.138.60.196 mac-address=ff:ff:ff:ff:ff:ff client-id=TORELLOnatifloresRadio1 server=dhcp-wlan2
add address=10.138.60.197 mac-address=00:14:BF:EF:2F:25 client-id=TorelloLGarciaRadio1 server=dhcp-wlan2
add address=10.138.60.198 mac-address=00:14:BF:EB:76:3B client-id=TorelloTSolaRadio1 server=dhcp-wlan2
add address=10.138.60.199 mac-address=00:16:01:4D:A5:94 client-id=TorelloJEscobarRadio1 server=dhcp-wlan2
add address=10.138.60.200 mac-address=00:14:BF:EB:6C:6F client-id=TorelloVergesCRadio1 server=dhcp-wlan2
add address=10.138.60.201 mac-address=00:16:01:16:7E:B2 client-id=TorelloToniCubiRadio1 server=dhcp-wlan2
add address=10.138.60.202 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloCarbones server=dhcp-wlan2
add address=10.138.60.203 mac-address=00:12:17:15:EC:5F client-id=TorelloMarcRadio1 server=dhcp-wlan2
add address=10.138.60.204 mac-address=00:14:BF:C9:10:1D client-id=TorelloRPujolaRadio1 server=dhcp-wlan2
add address=10.138.60.205 mac-address=00:16:01:16:12:68 client-id=TorelloAFerresRadio1 server=dhcp-wlan2
add address=10.138.60.206 mac-address=00:16:B6:11:3C:00 client-id=TorelloLLSabates server=dhcp-wlan2
add address=10.138.60.207 mac-address=00:14:BF:D2:6C:BD client-id=TorelloSGonzalezRadio2 server=dhcp-wlan2
add address=10.138.60.208 mac-address=00:16:01:16:91:E8 client-id=TorelloJQuelRadio1 server=dhcp-wlan2
add address=10.138.60.209 mac-address=00:18:39:C6:82:EF client-id=TorelloJMBartrinaRadio1 server=dhcp-wlan2
add address=10.138.60.210 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloFranciscoFernandez server=dhcp-wlan2
add address=10.138.60.211 mac-address=00:16:01:16:8C:DC client-id=TorelloParcRadio1 server=dhcp-wlan2
add address=10.138.60.212 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloEsturi server=dhcp-wlan2
add address=10.138.60.213 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloMariaRadio1 server=dhcp-wlan2
add address=10.138.60.214 mac-address=00:18:39:C6:82:F9 client-id=TorelloPratdesabaRadio2 server=dhcp-wlan2
add address=10.138.60.215 mac-address=00:18:39:86:F2:78 client-id=TorelloJAvilesRadio1 server=dhcp-wlan2
add address=10.138.60.216 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloSobremuntRadio1 server=dhcp-wlan2
add address=10.138.60.217 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloParcDinouRadio1 server=dhcp-wlan2
add address=10.138.60.218 mac-address=00:16:B6:11:45:E5 client-id=TorelloSAparicioRadio2 server=dhcp-wlan2
add address=10.138.60.219 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloJVidal server=dhcp-wlan2
add address=10.138.60.220 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloGomez server=dhcp-wlan2
add address=10.138.60.221 mac-address=00:1D:7E:BC:30:B8 client-id=ConanglellXTrucharteRadio1 server=dhcp-wlan2
add address=10.138.60.222 mac-address=00:16:B6:C7:D3:5C client-id=TorelloDGodayolRadio1 server=dhcp-wlan2
:foreach i in [/ip dhcp-server network find address="10.138.60.192/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.60.222-10.138.60.222
/ip dhcp-server network add address=10.138.60.192/27 gateway=10.138.60.193 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: wLan
/ip address
:foreach i in [find address="10.138.136.161/27"] do={remove $i}
/ ip address add address=10.138.136.161/27 network=10.138.136.160 broadcast=10.138.136.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.136.160/27] do={/routing ospf network remove $i;}
add network=10.138.136.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.136.162 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloSellesRadio1 server=dhcp-wlan2
add address=10.138.136.163 mac-address=00:16:01:AF:50:7E client-id=TorelloDSanchezRadio1 server=dhcp-wlan2
add address=10.138.136.164 mac-address=00:16:01:F4:B4:DB client-id=TorelloMariaSanchezRadio1 server=dhcp-wlan2
:foreach i in [/ip dhcp-server network find address="10.138.136.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.136.170-10.138.136.190
/ip dhcp-server network add address=10.138.136.160/27 gateway=10.138.136.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=no
#
:delay 1
#
# Radio#: 2 TorelloCalsAvisAP3
/interface wireless set wlan3 name="wlan3" \
radio-name="TorelloCalsAvisAP3" mode=ap-bridge ssid="guifi.net-TorelloCalsAvisAP3" \
band="2.4ghz-b" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=2472 \
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;}
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.60.225/27"] do={remove $i}
/ ip address add address=10.138.60.225/27 network=10.138.60.224 broadcast=10.138.60.255 interface=wlan3 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wlan3] do={/routing ospf interface remove $i;}
add interface=wlan3
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.60.224/27] do={/routing ospf network remove $i;}
add network=10.138.60.224/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.60.226 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloJOliva server=dhcp-wlan3
add address=10.138.60.227 mac-address=ff:ff:ff:ff:ff:ff client-id=TorellofurtetRadio1 server=dhcp-wlan3
add address=10.138.60.228 mac-address=00:18:39:AE:4A:0F client-id=TorelloMPresseguerRadio1 server=dhcp-wlan3
add address=10.138.60.229 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloAdolf server=dhcp-wlan3
add address=10.138.60.230 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloJoaniNuria server=dhcp-wlan3
add address=10.138.60.231 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloVigueRadio1 server=dhcp-wlan3
add address=10.138.60.232 mac-address=00:16:B6:D9:01:17 client-id=TorelloMRuiz server=dhcp-wlan3
add address=10.138.60.233 mac-address=00:16:01:16:12:68 client-id=TorelloAFerresRadio2 server=dhcp-wlan3
add address=10.138.60.234 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloegravolosaRadio1 server=dhcp-wlan3
add address=10.138.60.235 mac-address=00:16:B6:11:42:9D client-id=OrisJCarreraRadio1 server=dhcp-wlan3
add address=10.138.60.236 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloMontserratCRadio3 server=dhcp-wlan3
add address=10.138.60.237 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloJMoraRadio3 server=dhcp-wlan3
add address=10.138.60.238 mac-address=ff:ff:ff:ff:ff:ff client-id=jmcaballeriaRadio1 server=dhcp-wlan3
add address=10.138.60.240 mac-address=00:16:01:4D:8A:8C client-id=TorelloNVicenteRadio1 server=dhcp-wlan3
add address=10.138.60.241 mac-address=00:16:01:4D:86:24 client-id=TorelloTSanchezRadio1 server=dhcp-wlan3
add address=10.138.60.242 mac-address=ff:ff:ff:ff:ff:ff client-id=ParicioRadio1 server=dhcp-wlan3
add address=10.138.60.243 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloAparicio2 server=dhcp-wlan3
add address=10.138.60.244 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloAparicioRadio2 server=dhcp-wlan3
add address=10.138.60.245 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloJoanCapdevilaRadio2 server=dhcp-wlan3
add address=10.138.60.246 mac-address=00:18:39:C6:28:36 client-id=TorelloMag_1 server=dhcp-wlan3
add address=10.138.60.247 mac-address=00:1A:70:4F:0D:11 client-id=TorelloRGarciaRadio1 server=dhcp-wlan3
add address=10.138.60.248 mac-address=00:18:39:C6:4A:59 client-id=SVDTPujadas server=dhcp-wlan3
add address=10.138.60.249 mac-address=00:18:39:AE:6E:33 client-id=TorelloMMonteroRadio1 server=dhcp-wlan3
add address=10.138.60.250 mac-address=00:16:01:4D:A8:47 client-id=TorelloSJufreRadio1 server=dhcp-wlan3
add address=10.138.60.251 mac-address=00:16:01:4D:87:14 client-id=torelloalbertrdRadio1 server=dhcp-wlan3
add address=10.138.60.252 mac-address=00:14:BF:77:9C:B7 client-id=TorelloDataxipRadio2 server=dhcp-wlan3
add address=10.138.60.253 mac-address=00:16:B6:D9:00:36 client-id=TorelloABCRadio1 server=dhcp-wlan3
add address=10.138.60.254 mac-address=00:1A:70:D6:CE:A5 client-id=TorelloMComellasRadio1 server=dhcp-wlan3
:foreach i in [/ip dhcp-server network find address="10.138.60.224/27"] do={/ip dhcp-server network remove $i;}
:foreach i in [/ip pool find name=dhcp-wlan3] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan3 ranges=10.138.60.254-10.138.60.254
/ip dhcp-server network add address=10.138.60.224/27 gateway=10.138.60.225 domain=guifi.net comment=dhcp-wlan3
:foreach i in [/ip dhcp-server find name=dhcp-wlan3] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wlan3 interface=wlan3 address-pool=dhcp-wlan3 disabled=yes
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.136.193/27"] do={remove $i}
/ ip address add address=10.138.136.193/27 network=10.138.136.192 broadcast=10.138.136.223 interface=wlan3 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wlan3] do={/routing ospf interface remove $i;}
add interface=wlan3
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.136.192/27] do={/routing ospf network remove $i;}
add network=10.138.136.192/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.136.194 mac-address=00:16:01:ED:FB:07 client-id=TorelloSolanichRadio1 server=dhcp-wlan3
add address=10.138.136.195 mac-address=00:1D:7E:E3:91:2A client-id=TorelloFMorenoRadio1 server=dhcp-wlan3
add address=10.138.136.196 mac-address=00:16:01:AF:C1:84 client-id=TorelloETubauRadio1 server=dhcp-wlan3
add address=10.138.136.197 mac-address=00:16:01:F4:BE:29 client-id=TorelloBrugueraDachsRadio1 server=dhcp-wlan3
add address=10.138.136.198 mac-address=00:16:01:F4:B1:91 client-id=TorelloTSolerRadio1 server=dhcp-wlan3
add address=10.138.136.200 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloCExcTorelloRadio1 server=dhcp-wlan3
add address=10.138.136.201 mac-address=00:18:39:AE:4B:20 client-id=MdVJMontoroRadio1 server=dhcp-wlan3
add address=10.138.136.202 mac-address=00:16:01:ED:F6:09 client-id=TorelloAlbertPRadio1 server=dhcp-wlan3
:foreach i in [/ip dhcp-server network find address="10.138.136.192/27"] do={/ip dhcp-server network remove $i;}
:foreach i in [/ip pool find name=dhcp-wlan3] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan3 ranges=10.138.136.208-10.138.136.222
/ip dhcp-server network add address=10.138.136.192/27 gateway=10.138.136.193 domain=guifi.net comment=dhcp-wlan3
:foreach i in [/ip dhcp-server find name=dhcp-wlan3] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wlan3 interface=wlan3 address-pool=dhcp-wlan3 disabled=no
#
:delay 1
#
# Radio#: 3 TorelloCalsAvisDip
/interface wireless set wlan4 name="wlan4" \
radio-name="TorelloCalsAvisDip" mode=ap-bridge ssid="guifi.net-TorelloCalsAvisDip" \
band="5ghz" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=5520 \
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=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_TorelloDipSudST1" master-interface=wlan4 wds-address=00:0B:6B:4E:D4:5A disabled=no
/ ip address add address=172.25.16.6/30 network=172.25.16.4 broadcast=172.25.16.7 interface=wds_TorelloDipSudST1 disabled=no comment="wds_TorelloDipSudST1"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_TorelloDipSudST1] do={/routing ospf interface remove $i;}
add interface=wds_TorelloDipSudST1
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.16.4/30] do={/routing ospf network remove $i;}
add network=172.25.16.4/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=TorelloDipSudST1] do={/routing bgp peer remove $i;}
add name="TorelloDipSudST1" instance=default remote-address=172.25.16.5 remote-as=2582 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=no
#
:delay 1
#
# Routed device
#
# Other cable connections
#
# 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.136.193 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.136.193 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=2581 router-id=10.138.136.193 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.136.193 redistribute-connected=as-type-1 redistribute-static=as-type-1 redistribute-bgp=as-type-1
#
:log info "Unsolclic for 2581-TorelloCalsAvisST executed."
/