# Generated for:
# RouterOSv4.7+
:log info "Unsolclic for 4850-TorelloDipSudST4 going to be executed."
#
# Configuration for RouterOS 4.7 and newer 4.x
# Device: 4850-TorelloDipSudST4
#
# 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 if you use RouterOSv2.9 , 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=TorelloDipSudST4
#
# DNS (client & server cache) zone: 2471
/ip dns set servers=10.138.50.194,10.138.0.2 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 2471
/system ntp client set enabled=yes mode=unicast primary-ntp=10.138.0.2 secondary-ntp=10.138.0.2
: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="TorelloDipSud"
#
# 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 TorelloDipSud5GAP5
/interface wireless set wlan1 name="wlan1" \
radio-name="TorelloDipSud5GAP5" mode=ap-bridge ssid="guifi.net-TorelloDipSud5GAP5" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=5300 \
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.61.33/27"] do={remove $i}
/ ip address add address=10.138.61.33/27 network=10.138.61.32 broadcast=10.138.61.63 interface=wLan/Lan disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.61.32/27] do={/routing bgp network remove $i;}
add network=10.138.61.32/27 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.61.32/27] do={/routing ospf network remove $i;}
add network=10.138.61.32/27 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.61.39-10.138.61.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.61.32/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.61.32/27 gateway=10.138.61.33 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.61.34 mac-address=ff:ff:ff:ff:ff:ff client-id=TorellorobiretesRadio1 server=dhcp-wLan/Lan
add address=10.138.61.35 mac-address=00:0C:42:11:AD:07 client-id=TorelloARubiejoRadio1 server=dhcp-wLan/Lan
add address=10.138.61.36 mac-address=00:0C:42:11:AD:09 client-id=TorelloASantiagoRadio1 server=dhcp-wLan/Lan
add address=10.138.61.37 mac-address=00:15:6D:5E:11:4C client-id=TorelloPSandiaRd2 server=dhcp-wLan/Lan
add address=10.138.61.38 mac-address=00:15:6D:D3:54:C7 client-id=acc68Rd1 server=dhcp-wLan/Lan
add address=10.138.61.39 mac-address=00:15:6D:B5:69:2A client-id=TorelloJFornielesRadio1 server=dhcp-wLan/Lan
add address=10.138.61.40 mac-address=00:15:6D:B5:69:28 client-id=TorelloMALETRd1 server=dhcp-wLan/Lan
add address=10.138.61.41 mac-address=00:15:6D:BE:A8:18 client-id=TorelloTDDiegoRd1 server=dhcp-wLan/Lan
add address=10.138.61.42 mac-address=00:15:6D:D0:B2:0D client-id=SpdtCarmeRd2 server=dhcp-wLan/Lan
add address=10.138.61.43 mac-address=00:15:6D:BD:F7:03 client-id=TorelloAnnaSolaRd1 server=dhcp-wLan/Lan
add address=10.138.61.44 mac-address=00:15:6D:3A:A7:7D client-id=TorelloBrahimRd1 server=dhcp-wLan/Lan
add address=10.138.61.45 mac-address=00:15:6D:D3:55:F6 client-id=TorelloXrubiio2Rd1 server=dhcp-wLan/Lan
add address=10.138.61.46 mac-address=00:15:6D:EC:75:2E client-id=TorelloEMateuRd1 server=dhcp-wLan/Lan
add address=10.138.61.47 mac-address=00:27:22:18:80:8C client-id=TorelloJosepGRd1 server=dhcp-wLan/Lan
add address=10.138.61.48 mac-address=00:15:6D:E8:E0:1A client-id=TorelloRSaboritRd2 server=dhcp-wLan/Lan
add address=10.138.61.49 mac-address=00:15:6D:B6:B6:5C client-id=TorelloKPollakRd1 server=dhcp-wLan/Lan
add address=10.138.61.50 mac-address=00:16:6D:F2:3B:13 client-id=TorelloCVilaRd1 server=dhcp-wLan/Lan
add address=10.138.61.51 mac-address=00:15:6D:DD:68:B7 client-id=TorelloNadiaRd1 server=dhcp-wLan/Lan
add address=10.138.61.52 mac-address=00:15:6D:E8:E0:F7 client-id=TorelloJSalaRd1 server=dhcp-wLan/Lan
add address=10.138.61.53 mac-address=00:15:6D:F7:CB:7E client-id=TorelloSAllouchRd1 server=dhcp-wLan/Lan
add address=10.138.61.54 mac-address=00:18:39:C0:68:31 client-id=TorelloPacoRd1 server=dhcp-wLan/Lan
add address=10.138.61.55 mac-address=00:15:6D:F2:39:ED client-id=TorelloCongostRd2 server=dhcp-wLan/Lan
add address=10.138.61.56 mac-address=00:15:6D:F2:3B:62 client-id=TorelloAARd1 server=dhcp-wLan/Lan
add address=10.138.61.57 mac-address=00:15:6D:EB:ED:7F client-id=TorelloJoanSRd1 server=dhcp-wLan/Lan
add address=10.138.61.58 mac-address=00:15:6D:DC:68:8D client-id=TorelloERouraRd2 server=dhcp-wLan/Lan
add address=10.138.61.59 mac-address=00:0C:42:88:A6:F7 client-id=TorelloEcubiRd2 server=dhcp-wLan/Lan
add address=10.138.61.60 mac-address=00:0C:42:88:DF:53 client-id=TorellotarumiRd1 server=dhcp-wLan/Lan
add address=10.138.61.61 mac-address=00:15:6D:80:EA:B6 client-id=TorelloAAmadorRd1 server=dhcp-wLan/Lan
add address=10.138.61.62 mac-address=00:27:22:18:3F:78 client-id=TorelloJudRoviraRd1 server=dhcp-wLan/Lan
#
: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
#
# Radio#: 1 TorelloDipSud5GAP6
/interface wireless set wlan2 name="wlan2" \
radio-name="TorelloDipSud5GAP6" mode=ap-bridge ssid="guifi.net-TorelloDipSud5GAP6" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=18 \
frequency=5320 \
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.61.97/27"] do={remove $i}
/ ip address add address=10.138.61.97/27 network=10.138.61.96 broadcast=10.138.61.127 interface=wlan2 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.61.96/27] do={/routing bgp network remove $i;}
add network=10.138.61.96/27 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.61.96/27] do={/routing ospf network remove $i;}
add network=10.138.61.96/27 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.61.103-10.138.61.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.61.96/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.61.96/27 gateway=10.138.61.97 domain=guifi.net comment=dhcp-wlan2
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.61.98 mac-address=00:0C:42:18:2B:D9 client-id=TorelloJparejaRadio1 server=dhcp-wlan2
add address=10.138.61.99 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloPuigVinyesRadio1 server=dhcp-wlan2
add address=10.138.61.100 mac-address=FF:FF:FF:FF:FF:FF client-id=TorelloManelRadio1 server=dhcp-wlan2
add address=10.138.61.101 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloContraixRadio2 server=dhcp-wlan2
add address=10.138.61.102 mac-address=00:0C:42:11:3F:28 client-id=TorelloJCampsRadio1 server=dhcp-wlan2
add address=10.138.61.103 mac-address=00:0B:6B:56:24:EF client-id=TorelloRuizTorresRadio1 server=dhcp-wlan2
add address=10.138.61.104 mac-address=00:0B:6B:2C:3A:77 client-id=TorelloGemma server=dhcp-wlan2
add address=10.138.61.105 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloEUtreroRadio1 server=dhcp-wlan2
add address=10.138.61.106 mac-address=00:15:6D:B5:62:B1 client-id=TorelloMComasRadio1 server=dhcp-wlan2
add address=10.138.61.107 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloBombRadio1 server=dhcp-wlan2
add address=10.138.61.108 mac-address=00:15:6D:B5:67:FD client-id=TorelloJCasalsRadio1 server=dhcp-wlan2
add address=10.138.61.109 mac-address=00:15:6D:B5:62:50 client-id=TorelloASoldevilaRadio3 server=dhcp-wlan2
add address=10.138.61.110 mac-address=00:15:6D:B5:B8:85 client-id=TorelloEnMartiRadio1 server=dhcp-wlan2
add address=10.138.61.111 mac-address=00:15:6D:B6:B6:5D client-id=TorelloJRosellRadio1 server=dhcp-wlan2
add address=10.138.61.112 mac-address=00:1A:4D:21:0F:C0 client-id=TorelloDCastellsRd1 server=dhcp-wlan2
add address=10.138.61.113 mac-address=00:15:6D:D6:54:20 client-id=TorelloVPerezRadio2 server=dhcp-wlan2
add address=10.138.61.114 mac-address=00:1A:4D:21:0F:C0 client-id=TorelloPFontsRd2 server=dhcp-wlan2
add address=10.138.61.115 mac-address=00:16:B6:D9:14:A3 client-id=TorelloAlbertCampsRadio1 server=dhcp-wlan2
add address=10.138.61.116 mac-address=00:15:6D:B5:B6:53 client-id=TrllGlRd1 server=dhcp-wlan2
add address=10.138.61.117 mac-address=00:1A:4D:21:0F:C0 client-id=TorelloVTorresRd2 server=dhcp-wlan2
add address=10.138.61.118 mac-address=00:15:6D:B9:10:9A client-id=TorelloDRomeroRd2 server=dhcp-wlan2
add address=10.138.61.119 mac-address=00:15:6D:BA:44:90 client-id=TorelloPLopezRd1 server=dhcp-wlan2
add address=10.138.61.120 mac-address=00:0C:42:39:B3:AC client-id=TorelloGTanyaRd2 server=dhcp-wlan2
add address=10.138.61.122 mac-address=00:15:6D:B9:44:8D client-id=TorelloJMFrancosRd1 server=dhcp-wlan2
add address=10.138.61.123 mac-address=00:15:6D:BE:8A:AE client-id=TorelloJaumeRifaRd1 server=dhcp-wlan2
add address=10.138.61.124 mac-address=00:15:6D:BB:9D:CA client-id=SPDTJFreixerRd1 server=dhcp-wlan2
add address=10.138.61.125 mac-address=00:15:6D:D3:55:5F client-id=TorelloSCRd1 server=dhcp-wlan2
add address=10.138.61.126 mac-address=00:15:6D:BE:FF:43 client-id=TorelloTEsturiRd2 server=dhcp-wlan2
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.137.65/27"] do={remove $i}
/ ip address add address=10.138.137.65/27 network=10.138.137.64 broadcast=10.138.137.95 interface=wlan2 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.137.64/27] do={/routing bgp network remove $i;}
add network=10.138.137.64/27 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.137.64/27] do={/routing ospf network remove $i;}
add network=10.138.137.64/27 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.137.71-10.138.137.94
: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.137.64/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.137.64/27 gateway=10.138.137.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.137.66 mac-address=00:0C:42:39:B3:B0 client-id=TorelloDisemPlaquesRd1 server=dhcp-wlan2
add address=10.138.137.67 mac-address=00:15:6D:D0:93:8A client-id=DSolerRd1 server=dhcp-wlan2
add address=10.138.137.68 mac-address=00:15:6D:DD:7E:E2 client-id=TorelloAlexanderRd1 server=dhcp-wlan2
add address=10.138.137.69 mac-address=00:15:6D:EC:74:9A client-id=TorelloMSurribasRd1 server=dhcp-wlan2
add address=10.138.137.70 mac-address=00:15:6D:ED:D7:0B client-id=TorelloNandoRd1 server=dhcp-wlan2
add address=10.138.137.71 mac-address=00:15:6D:EF:05:52 client-id=TorelloMunellsRd1 server=dhcp-wlan2
add address=10.138.137.72 mac-address=00:15:6D:E2:E5:7D client-id=TorelloMarcRd2 server=dhcp-wlan2
add address=10.138.137.73 mac-address=00:15:6D:E6:1B:7B client-id=TorelloEdBassasRd1 server=dhcp-wlan2
add address=10.138.137.74 mac-address=00:15:6D:ED:D5:9E client-id=TorelloConsol9Rd1 server=dhcp-wlan2
add address=10.138.137.75 mac-address=00:15:6D:EC:75:9C client-id=TorelloMSanchezRd1 server=dhcp-wlan2
add address=10.138.137.76 mac-address=00:15:6D:ED:D7:A3 client-id=TorelloPradosRd1 server=dhcp-wlan2
add address=10.138.137.77 mac-address=00:15:6D:EF:04:B3 client-id=TorelloRaichidRd1 server=dhcp-wlan2
add address=10.138.137.78 mac-address=00:15:6D:EF:05:31 client-id=TorelloAlineRd1 server=dhcp-wlan2
add address=10.138.137.79 mac-address=00:15:6D:EF:04:CB client-id=TorelloRachid2Rd1 server=dhcp-wlan2
add address=10.138.137.80 mac-address=00:15:6D:EE:04:73 client-id=TorelloMAngelsRd1 server=dhcp-wlan2
add address=10.138.137.81 mac-address=00:15:6D:ED:D4:4C client-id=TorelloRachid3Rd1 server=dhcp-wlan2
add address=10.138.137.82 mac-address=00:15:6D:ED:D6:C6 client-id=Torellorachid5Rd1 server=dhcp-wlan2
add address=10.138.137.83 mac-address=00:15:6D:ED:D5:0D client-id=Torellorachid4Rd1 server=dhcp-wlan2
add address=10.138.137.84 mac-address=00:15:6D:F7:C1:69 client-id=TorelloSTorresRd2 server=dhcp-wlan2
add address=10.138.137.85 mac-address=00:15:6D:EF:04:F0 client-id=Torellorachid6Rd1 server=dhcp-wlan2
add address=10.138.137.86 mac-address=00:15:6D:EE:03:03 client-id=TorelloJFontRd1 server=dhcp-wlan2
add address=10.138.137.87 mac-address=00:15:6D:FE:BF:A0 client-id=TorelloPauRifaRd1 server=dhcp-wlan2
add address=10.138.137.88 mac-address=00:15:6D:FF:BF:A0 client-id=TorelloDavidSRd1 server=dhcp-wlan2
add address=10.138.137.89 mac-address=00:15:6D:AA:2E:24 client-id=TorelloDSerratosaRd1 server=dhcp-wlan2
add address=10.138.137.90 mac-address=00:15:6D:F2:3A:24 client-id=TorelloCtoneuRd1 server=dhcp-wlan2
add address=10.138.137.91 mac-address=00:12:17:C7:DB:DD client-id=TorelloImmaRd1 server=dhcp-wlan2
add address=10.138.137.92 mac-address=00:16:B6:11:46:B4 client-id=torelloMolina13Radio1 server=dhcp-wlan2
add address=10.138.137.93 mac-address=00:15:6D:F7:C0:72 client-id=TorelloALorenteRd1 server=dhcp-wlan2
add address=10.138.137.94 mac-address=00:15:6D:EE:02:AA client-id=TorelloVictoriaRd1 server=dhcp-wlan2
#
: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 TorelloDipSud5GAP7
/interface wireless set wlan3 name="wlan3" \
radio-name="TorelloDipSud5GAP7" mode=ap-bridge ssid="guifi.net-TorelloDipSud5GAP7" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=18 \
frequency=5280 \
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.61.161/27"] do={remove $i}
/ ip address add address=10.138.61.161/27 network=10.138.61.160 broadcast=10.138.61.191 interface=wlan3 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.61.160/27] do={/routing bgp network remove $i;}
add network=10.138.61.160/27 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.61.160/27] do={/routing ospf network remove $i;}
add network=10.138.61.160/27 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wlan3] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan3 ranges=10.138.61.167-10.138.61.190
: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
:foreach i in [/ip dhcp-server network find address="10.138.61.160/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.61.160/27 gateway=10.138.61.161 domain=guifi.net comment=dhcp-wlan3
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.61.162 mac-address=00:0B:6B:81:CD:CA client-id=TorelloEmiRadio2 server=dhcp-wlan3
add address=10.138.61.163 mac-address=00:1A:4D:21:0D:2B client-id=TorelloMMataRadio1 server=dhcp-wlan3
add address=10.138.61.164 mac-address=00:15:6D:F2:3B:53 client-id=SVDTJRvrRd1 server=dhcp-wlan3
add address=10.138.61.165 mac-address=00:15:6D:B5:B8:88 client-id=TorelloAPijoanRd1 server=dhcp-wlan3
add address=10.138.61.166 mac-address=00:15:6D:D3:55:4D client-id=TorelloADomingoRd1 server=dhcp-wlan3
add address=10.138.61.167 mac-address=00:15:6D:D3:55:E1 client-id=TorelloRVerdaguerRd1 server=dhcp-wlan3
add address=10.138.61.168 mac-address=00:15:6D:BD:8A:01 client-id=TorelloLSanglasRd2 server=dhcp-wlan3
add address=10.138.61.169 mac-address=00:15:6D:BD:FE:A4 client-id=TorelloQSerradellRd2 server=dhcp-wlan3
add address=10.138.61.170 mac-address=00:15:6D:BD:FF:FE client-id=TorelloMGomaRd1 server=dhcp-wlan3
add address=10.138.61.171 mac-address=00:15:6D:D6:53:32 client-id=TorelloTSolaRd1 server=dhcp-wlan3
add address=10.138.61.172 mac-address=00:15:6D:BD:4A:ED client-id=TorelloAArasanzRd1 server=dhcp-wlan3
add address=10.138.61.173 mac-address=00:15:6D:BE:F6:6E client-id=TorelloMaiteRd1 server=dhcp-wlan3
add address=10.138.61.174 mac-address=00:15:6D:BD:D5:8F client-id=TorelloSLopezRd1 server=dhcp-wlan3
add address=10.138.61.175 mac-address=00:15:6D:FA:92:59 client-id=TorelloPepCorominolaRd1 server=dhcp-wlan3
add address=10.138.61.176 mac-address=00:15:6D:D6:53:60 client-id=TorelloFusosRd1 server=dhcp-wlan3
add address=10.138.61.177 mac-address=00:00:00:00:00:00 client-id=TorelloIzquierdoRd1 server=dhcp-wlan3
add address=10.138.61.178 mac-address=00:15:6D:DA:71:7E client-id=TorelloSVicencnano server=dhcp-wlan3
add address=10.138.61.179 mac-address=00:15:6D:DA:70:83 client-id=TorelloMGRAURd1 server=dhcp-wlan3
add address=10.138.61.180 mac-address=00:0C:42:39:B3:AC client-id=TorelloDisemEmpresaRd1 server=dhcp-wlan3
add address=10.138.61.181 mac-address=00:15:6D:E2:33:7A client-id=TorelloATorresRd1 server=dhcp-wlan3
add address=10.138.61.182 mac-address=00:15:6D:F2:3B:15 client-id=TorelloMAlzinaRd1 server=dhcp-wlan3
add address=10.138.61.183 mac-address=00:0C:42:39:94:6F client-id=TorelloJRomaEmpresaRd1 server=dhcp-wlan3
add address=10.138.61.184 mac-address=FF:FF:10:00:00:00 client-id=TorelloJordiPRd2 server=dhcp-wlan3
add address=10.138.61.185 mac-address=00:15:6D:E2:33:88 client-id=TorelloXColomerRd2 server=dhcp-wlan3
add address=10.138.61.186 mac-address=00:15:6D:E2:33:8B client-id=TorelloCarreraRd2 server=dhcp-wlan3
add address=10.138.61.187 mac-address=00:15:6D:DA:35:13 client-id=TorelloBFontRadio1 server=dhcp-wlan3
add address=10.138.61.188 mac-address=00:15:D6:A0:25:71 client-id=TorelloRouraRadio2 server=dhcp-wlan3
add address=10.138.61.189 mac-address=00:15:6D:BD:FD:9E client-id=TorelloYSerratRd1 server=dhcp-wlan3
add address=10.138.61.190 mac-address=00:15:6D:F2:3A:34 client-id=TorelloProtecCivilRd1 server=dhcp-wlan3
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.60.65/27"] do={remove $i}
/ ip address add address=10.138.60.65/27 network=10.138.60.64 broadcast=10.138.60.95 interface=wlan3 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.60.64/27] do={/routing bgp network remove $i;}
add network=10.138.60.64/27 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.64/27] do={/routing ospf network remove $i;}
add network=10.138.60.64/27 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wlan3] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan3 ranges=10.138.60.71-10.138.60.94
: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
:foreach i in [/ip dhcp-server network find address="10.138.60.64/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.60.64/27 gateway=10.138.60.65 domain=guifi.net comment=dhcp-wlan3
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.60.66 mac-address=00:00:00:00:00:01 client-id=TorelloSTMiquelASBRd1 server=dhcp-wlan3
add address=10.138.60.67 mac-address=00:15:6D:B0:3F:5D client-id=TorelloJuliaJRd4 server=dhcp-wlan3
add address=10.138.60.68 mac-address=00:0C:42:4D:1F:36 client-id=TorelloDTanyaPRd1 server=dhcp-wlan3
add address=10.138.60.69 mac-address=00:15:6D:30:00:01 client-id=TorelloHellenRd1 server=dhcp-wlan3
add address=10.138.60.70 mac-address=00:0C:42:87:DE:DB client-id=TorelloFerrerRouraRd1 server=dhcp-wlan3
add address=10.138.60.71 mac-address=00:0C:42:64:C2:1D client-id=TorelloAuroraRd1 server=dhcp-wlan3
add address=10.138.60.72 mac-address=00:00:00:00:00:01 client-id=TorelloSFlontaRd1 server=dhcp-wlan3
add address=10.138.60.73 mac-address=00:0C:42:88:AA:DD client-id=TorelloKhudoleyRd1 server=dhcp-wlan3
add address=10.138.60.74 mac-address=00:0C:42:88:27:79 client-id=TorelloPNoguerRd2 server=dhcp-wlan3
add address=10.138.60.75 mac-address=FF:FF:10:00:00:00 client-id=TorelloDamians135Rd1 server=dhcp-wlan3
add address=10.138.60.76 mac-address=00:0C:42:87:EF:5F client-id=TorelloEsRouraRd1 server=dhcp-wlan3
add address=10.138.60.77 mac-address=00:27:22:18:81:57 client-id=TorelloJosep2Rd3 server=dhcp-wlan3
add address=10.138.60.78 mac-address=00:0C:42:CD:36:09 client-id=MdVManVanRd1 server=dhcp-wlan3
add address=10.138.60.80 mac-address=00:15:6D:70:4F:88 client-id=TorelloMcampsRd2 server=dhcp-wlan3
#
: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
#
# Radio#: 3 TorelloDipSudST4-Joanot
/interface wireless set wlan4 name="wlan4" \
radio-name="TorelloDipSudST4-Joanot" mode=ap-bridge ssid="guifi.net-TorelloDipSudST4-Joanot" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=21 \
frequency=5700 \
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_TorelloJoanotST" master-interface=wlan4 wds-address=00:0C:42:64:C2:1F disabled=no
/ ip address add address=172.25.16.46/30 network=172.25.16.44 broadcast=172.25.16.47 interface=wds_TorelloJoanotST disabled=no comment="wds_TorelloJoanotST"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_TorelloJoanotST] do={/routing ospf interface remove $i;}
add interface=wds_TorelloJoanotST
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.16.44/30] do={/routing ospf network remove $i;}
add network=172.25.16.44/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=TorelloJoanotST] do={/routing bgp peer remove $i;}
add name="TorelloJoanotST" instance=default remote-address=172.25.16.45 remote-as=4853 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 4 TorelloDipSudAP1
/interface wireless set wlan5 name="wlan5" \
radio-name="TorelloDipSudAP1" mode=ap-bridge ssid="guifi.net-TorelloDipSudAP1" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=12 \
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: Wan
/ip address
:foreach i in [find interface=wlan5] do={remove $i}
:foreach i in [find address="10.138.50.2/27"] do={remove $i}
/ ip address add address=10.138.50.2/27 network=10.138.50.0 broadcast=10.138.50.31 interface=wlan5 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.50.0/27] do={/routing bgp network remove $i;}
add network=10.138.50.0/27 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wlan5] do={/routing ospf interface remove $i;}
add interface=wlan5
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.50.0/27] do={/routing ospf network remove $i;}
add network=10.138.50.0/27 area=backbone disabled=no
:delay 1
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.50.33/27"] do={remove $i}
/ ip address add address=10.138.50.33/27 network=10.138.50.32 broadcast=10.138.50.63 interface=wlan5 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.50.32/27] do={/routing bgp network remove $i;}
add network=10.138.50.32/27 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wlan5] do={/routing ospf interface remove $i;}
add interface=wlan5
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.50.32/27] do={/routing ospf network remove $i;}
add network=10.138.50.32/27 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wlan5] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan5 ranges=10.138.50.39-10.138.50.62
:foreach i in [/ip dhcp-server find name=dhcp-wlan5] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wlan5 interface=wlan5 address-pool=dhcp-wlan5 disabled=no
:foreach i in [/ip dhcp-server network find address="10.138.50.32/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.50.32/27 gateway=10.138.50.33 domain=guifi.net comment=dhcp-wlan5
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.50.34 mac-address=00:16:01:F2:22:15 client-id=TorelloLuciaFernandezRd1 server=dhcp-wlan5
add address=10.138.50.35 mac-address=00:18:39:C6:83:08 client-id=TorelloJPuigRadio1 server=dhcp-wlan5
add address=10.138.50.36 mac-address=00:12:17:C7:98:12 client-id=TorelloGonzalezTorre2 server=dhcp-wlan5
add address=10.138.50.38 mac-address=00:14:BF:2F:43:0D client-id=TorelloPNoguerRadio1 server=dhcp-wlan5
add address=10.138.50.39 mac-address=00:14:BF:C9:10:15 client-id=TorelloJMarti server=dhcp-wlan5
add address=10.138.50.40 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloCescSad server=dhcp-wlan5
add address=10.138.50.41 mac-address=00:14:BF:D2:72:9B client-id=TorellollFabrell server=dhcp-wlan5
add address=10.138.50.42 mac-address=00:14:BF:2F:43:04 client-id=TorelloQSerradellRadio1 server=dhcp-wlan5
add address=10.138.50.43 mac-address=00:14:BF:D2:6D:E8 client-id=TorelloDavid server=dhcp-wlan5
add address=10.138.50.44 mac-address=00:15:6D:AC:F5:68 client-id=TorelloMarcDRd1 server=dhcp-wlan5
add address=10.138.50.45 mac-address=00:15:6D:A9:2E:DD client-id=TorelloNuriaColl server=dhcp-wlan5
add address=10.138.50.46 mac-address=00:16:B6:40:F9:A9 client-id=TorelloEstamRadio2 server=dhcp-wlan5
add address=10.138.50.47 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloBalmes23 server=dhcp-wlan5
add address=10.138.50.48 mac-address=00:15:6D:AC:F4:00 client-id=TorelloMTanyaRd1 server=dhcp-wlan5
add address=10.138.50.49 mac-address=00:16:01:B0:71:13 client-id=TorelloManelCRd2 server=dhcp-wlan5
add address=10.138.50.50 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloDRomeroRadio1 server=dhcp-wlan5
add address=10.138.50.51 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloJCalonge server=dhcp-wlan5
add address=10.138.50.52 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloPLLach server=dhcp-wlan5
add address=10.138.50.53 mac-address=00:1C:10:36:47:1F client-id=TorelloMCarmeRadio1 server=dhcp-wlan5
add address=10.138.50.54 mac-address=00:1D:7E:28:1B:05 client-id=TorelloRokiLujan2Rd1 server=dhcp-wlan5
add address=10.138.50.55 mac-address=00:14:BF:BF:D0:86 client-id=TorelloJMorenoRadio1 server=dhcp-wlan5
add address=10.138.50.56 mac-address=00:14:BF:EF:2F:1B client-id=TorelloXColomerRadio1 server=dhcp-wlan5
add address=10.138.50.57 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloJBarcons server=dhcp-wlan5
add address=10.138.50.58 mac-address=00:15:6D:1E:48:25 client-id=TorelloAMariaRd1 server=dhcp-wlan5
add address=10.138.50.59 mac-address=00:15:6D:D7:96:D6 client-id=TorelloManoliRd1 server=dhcp-wlan5
add address=10.138.50.60 mac-address=00:15:6D:1A:01:80 client-id=ManlleuDavidNano2 server=dhcp-wlan5
add address=10.138.50.61 mac-address=00:14:BF:EF:36:62 client-id=TorelloConxiDome server=dhcp-wlan5
add address=10.138.50.62 mac-address=00:21:29:A1:EB:6D client-id=TorelloBlancheRd1 server=dhcp-wlan5
#
:delay 1
# Type: wds/p2p
# Remove all existing wds interfaces
:foreach i in [/interface wireless wds find master-interface=wlan5] \
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
#
# 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.17.224/27] do={/routing ospf network remove $i;}
add network=172.25.17.224/27 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=TorelloDipSudPC] do={/routing bgp peer remove $i;}
add name="TorelloDipSudPC" instance=default remote-address=172.25.17.225 remote-as=34079 \
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.17.231/27"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.17.231/27 network=172.25.17.224 broadcast=172.25.17.255 interface=ether3 disabled=no comment="TorelloDipSudPC"
#
# Internal addresses NAT
: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.61.33 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.61.33 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;}
: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
#
# BGP instance
/ routing bgp instance
set default name="default" as=4850 router-id=10.138.61.33 \
redistribute-connected=no redistribute-static=no redistribute-rip=no \
redistribute-ospf=yes redistribute-other-bgp=yes out-filter=ebgp-out \
client-to-client-reflection=yes comment="" disabled=no
#
# OSPF Routing
/routing ospf instance set default name=default router-id=10.138.61.33 comment="" disabled=no distribute-default=never \
redistribute-bgp=as-type-1 redistribute-connected=no redistribute-other-ospf=no redistribute-rip=no redistribute-static=no in-filter=ospf-in out-filter=ospf-out
#
:log info "Unsolclic for 4850-TorelloDipSudST4 executed."
/