# Generated for:
# RouterOSv3.x
:log info "Unsolclic for 45-MasiesVGlevaDipST going to be executed."
#
# Configuration for RouterOSv3.x
# Device: 45-MasiesVGlevaDipST
#
# 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=MasiesVGlevaDipST
#
# DNS (client & server cache) zone: 2457
/ip dns set primary-dns=10.138.20.101 secondary-dns=10.138.0.2 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 2457
/system ntp client set enabled=yes mode=unicast primary-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="VoltregaGlevaDiposit"
#
# 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 MasiesVGlevaDipAP
/interface wireless set wlan1 name="wlan1" \
radio-name="MasiesVGlevaDipAP" mode=ap-bridge ssid="guifi.net-MasiesVGlevaDipAP" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=2 \
frequency=2427 \
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.8.65/27"] do={remove $i}
/ ip address add address=10.138.8.65/27 network=10.138.8.64 broadcast=10.138.8.95 interface=wLan/Lan disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.8.64/27] do={/routing bgp network remove $i;}
add network=10.138.8.64/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.8.64/27] do={/routing ospf network remove $i;}
add network=10.138.8.64/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.8.71-10.138.8.94
: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.8.64/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.8.64/27 gateway=10.138.8.65 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.8.66 mac-address=00:14:BF:D2:72:A1 client-id=StHipolitPradell server=dhcp-wLan/Lan
add address=10.138.8.67 mac-address=00:1D:7E:28:0C:0B client-id=ShvenricRadio1 server=dhcp-wLan/Lan
add address=10.138.8.68 mac-address=00:12:17:49:94:E2 client-id=StHipRequerens server=dhcp-wLan/Lan
add address=10.138.8.69 mac-address=00:12:17:D5:3A:17 client-id=StHipJAlcantara server=dhcp-wLan/Lan
add address=10.138.8.70 mac-address=00:14:BF:D2:76:5E client-id=SHVRiveroRadio server=dhcp-wLan/Lan
add address=10.138.8.71 mac-address=00:13:10:E5:75:42 client-id=SHVCanSila server=dhcp-wLan/Lan
add address=10.138.8.72 mac-address=00:13:10:7B:1A:24 client-id=MasiesVJCasanovasRadio server=dhcp-wLan/Lan
add address=10.138.8.73 mac-address=00:14:BF:EB:72:A4 client-id=MdVGutierrez server=dhcp-wLan/Lan
add address=10.138.8.75 mac-address=00:18:F8:F2:69:AD client-id=SHVFBalandrauRd1 server=dhcp-wLan/Lan
add address=10.138.8.76 mac-address=00:14:BF:EB:86:A2 client-id=MasiesVRuiz server=dhcp-wLan/Lan
add address=10.138.8.77 mac-address=00:18:39:BC:0A:3C client-id=MasiesTAmblas server=dhcp-wLan/Lan
add address=10.138.8.78 mac-address=00:16:01:84:7B:1C client-id=MasiesVJSolerRadio1 server=dhcp-wLan/Lan
add address=10.138.8.79 mac-address=00:14:BF:D2:72:A4 client-id=StHipAlberttRadio1 server=dhcp-wLan/Lan
add address=10.138.8.80 mac-address=00:14:BF:C9:10:27 client-id=StHipMSerraRadio1 server=dhcp-wLan/Lan
add address=10.138.8.81 mac-address=00:14:BF:EB:86:8D client-id=MdVPere server=dhcp-wLan/Lan
add address=10.138.8.82 mac-address=00:14:BF:3C:98:FC client-id=StHipMRabionetRadio1 server=dhcp-wLan/Lan
add address=10.138.8.83 mac-address=00:27:22:2C:26:CE client-id=MDVJoanRamonRd1 server=dhcp-wLan/Lan
add address=10.138.8.84 mac-address=00:16:B6:40:EA:B1 client-id=SHVVentura server=dhcp-wLan/Lan
add address=10.138.8.85 mac-address=00:18:39:C6:83:0E client-id=SHVRafaRadio1 server=dhcp-wLan/Lan
add address=10.138.8.86 mac-address=00:15:6D:D2:DF:BD client-id=MareDeDeuDeLaGlevaRd1 server=dhcp-wLan/Lan
add address=10.138.8.87 mac-address=00:18:39:AE:46:88 client-id=MdVCanoRadio1 server=dhcp-wLan/Lan
add address=10.138.8.88 mac-address=00:16:B6:1F:F5:13 client-id=SHVMunoz server=dhcp-wLan/Lan
add address=10.138.8.89 mac-address=00:16:01:AE:E7:5D client-id=SHVgenRadio1 server=dhcp-wLan/Lan
add address=10.138.8.90 mac-address=00:14:BF:EB:70:9E client-id=MdVMerin server=dhcp-wLan/Lan
add address=10.138.8.91 mac-address=ff:ff:ff:ff:ff:ff client-id=StHipBalmesRadio1 server=dhcp-wLan/Lan
add address=10.138.8.92 mac-address=00:16:B6:C9:29:05 client-id=EscarraRadio1 server=dhcp-wLan/Lan
add address=10.138.8.93 mac-address=00:16:B6:11:3F:CA client-id=ManlleuNuriaCRadio1 server=dhcp-wLan/Lan
add address=10.138.8.94 mac-address=00:16:01:AF:EC:B2 client-id=LaGlevaJordiLRadio1 server=dhcp-wLan/Lan
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.100.129/27"] do={remove $i}
/ ip address add address=10.138.100.129/27 network=10.138.100.128 broadcast=10.138.100.159 interface=wlan1 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.100.128/27] do={/routing bgp network remove $i;}
add network=10.138.100.128/27 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.100.128/27] do={/routing ospf network remove $i;}
add network=10.138.100.128/27 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wlan1] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan1 ranges=10.138.100.135-10.138.100.158
: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
:foreach i in [/ip dhcp-server network find address="10.138.100.128/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.100.128/27 gateway=10.138.100.129 domain=guifi.net comment=dhcp-wlan1
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.38.142.161 mac-address=00:0C:42:BD:6E:5F client-id=SHVAToledanoRd2 server=dhcp-wlan1
add address=10.138.100.130 mac-address=00:15:6D:A9:2C:CD client-id=SHVJosepLLMRd1 server=dhcp-wlan1
add address=10.138.100.131 mac-address=00:1D:73:55:6C:C3 client-id=MDVJoanRieraRd1 server=dhcp-wlan1
add address=10.138.100.132 mac-address=00:15:6D:AD:DA:4A client-id=SHVRosamliraRd1 server=dhcp-wlan1
add address=10.138.100.133 mac-address=00:15:6D:AE:0C:35 client-id=masiesvgajaRd1 server=dhcp-wlan1
add address=10.138.100.134 mac-address=00:15:6D:1A:67:60 client-id=SHVJoanAlbertNRd1 server=dhcp-wlan1
add address=10.138.100.135 mac-address=00:15:6D:D5:77:66 client-id=SHVMontseRd4 server=dhcp-wlan1
add address=10.138.100.136 mac-address=00:15:6D:AD:EE:20 client-id=StHplxTjrRd1 server=dhcp-wlan1
add address=10.138.100.137 mac-address=00:15:6D:5E:89:DD client-id=MasiesVAaramRd1 server=dhcp-wlan1
add address=10.138.100.138 mac-address=00:16:01:8C:60:23 client-id=SHVAToledanoRd2 server=dhcp-wlan1
add address=10.138.100.139 mac-address=00:1C:10:36:4D:C0 client-id=StHipolitMonRd3 server=dhcp-wlan1
add address=10.138.100.140 mac-address=00:15:6D:E8:CC:3C client-id=MdVJordiRd2 server=dhcp-wlan1
add address=10.138.100.142 mac-address=00:15:6D:DA:16:1E client-id=MDVPirineu18Rd1 server=dhcp-wlan1
add address=10.138.100.143 mac-address=00:15:6D:D8:17:27 client-id=StHipAlberttRd2 server=dhcp-wlan1
add address=10.138.100.144 mac-address=00:25:9C:42:26:FF client-id=SHDVAMoraledaRd1 server=dhcp-wlan1
add address=10.138.100.145 mac-address=00:16:01:B0:84:F3 client-id=GurbJordiBRd2 server=dhcp-wlan1
add address=10.138.100.146 mac-address=00:15:6D:EE:5B:4A client-id=SHVMNogueRd1 server=dhcp-wlan1
add address=10.138.100.147 mac-address=00:15:6D:D6:95:EE client-id=ShipalfonsRd2 server=dhcp-wlan1
add address=10.138.100.148 mac-address=00:15:6D:EE:D2:86 client-id=SHVMerceCRd1 server=dhcp-wlan1
add address=10.138.100.149 mac-address=00:15:6D:F8:31:5F client-id=SHVJBoyRd1 server=dhcp-wlan1
add address=10.138.100.150 mac-address=00:27:22:14:0C:E1 client-id=MdVMontseny35Rd1 server=dhcp-wlan1
add address=10.138.100.151 mac-address=00:15:6D:EE:5B:D6 client-id=mikelromannANO22 server=dhcp-wlan1
add address=10.138.100.152 mac-address=00:15:6D:F6:7D:53 client-id=SHVImmaMRd1 server=dhcp-wlan1
add address=10.138.100.153 mac-address=00:15:6D:F2:5F:09 client-id=MDVCaneliasRd1 server=dhcp-wlan1
add address=10.138.100.154 mac-address=00:15:6D:D7:95:EB client-id=StHipJazzRd2 server=dhcp-wlan1
add address=10.138.100.155 mac-address=00:15:6D:F2:B1:68 client-id=SHVISanchezRd1 server=dhcp-wlan1
add address=10.138.100.156 mac-address=00:15:6D:DF:EB:AE client-id=MDVCarrilloRd1 server=dhcp-wlan1
add address=10.138.100.157 mac-address=00:15:6D:A8:B3:CA client-id=MDVLluisPRd2 server=dhcp-wlan1
add address=10.138.100.158 mac-address=00:15:6D:D6:93:46 client-id=SHVTSerraRd1 server=dhcp-wlan1
#
: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_MasiesVGlevaEscoles" master-interface=wlan1 wds-address=00:0F:66:D9:B9:42 disabled=no
/ ip address add address=172.25.0.149/30 network=172.25.0.148 broadcast=172.25.0.151 interface=wds_MasiesVGlevaEscoles disabled=no comment="wds_MasiesVGlevaEscoles"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_MasiesVGlevaEscoles] do={/routing ospf interface remove $i;}
add interface=wds_MasiesVGlevaEscoles
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.0.148/30] do={/routing ospf network remove $i;}
add network=172.25.0.148/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=MasiesVGlevaEscoles] do={/routing bgp peer remove $i;}
add name="MasiesVGlevaEscoles" instance=default remote-address=172.25.0.150 remote-as=48 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_MasiesVGuarderia" master-interface=wlan1 wds-address=00:0F:66:D9:B8:F1 disabled=no
/ ip address add address=172.25.0.153/30 network=172.25.0.152 broadcast=172.25.0.155 interface=wds_MasiesVGuarderia disabled=no comment="wds_MasiesVGuarderia"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_MasiesVGuarderia] do={/routing ospf interface remove $i;}
add interface=wds_MasiesVGuarderia
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.0.152/30] do={/routing ospf network remove $i;}
add network=172.25.0.152/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=MasiesVGuarderia] do={/routing bgp peer remove $i;}
add name="MasiesVGuarderia" instance=default remote-address=172.25.0.154 remote-as=53 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_MasiesVGaieta" master-interface=wlan1 wds-address=00:12:17:15:ED:DF disabled=no
/ ip address add address=172.25.0.213/30 network=172.25.0.212 broadcast=172.25.0.215 interface=wds_MasiesVGaieta disabled=no comment="wds_MasiesVGaieta"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_MasiesVGaieta] do={/routing ospf interface remove $i;}
add interface=wds_MasiesVGaieta
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.0.212/30] do={/routing ospf network remove $i;}
add network=172.25.0.212/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=MasiesVGaieta] do={/routing bgp peer remove $i;}
add name="MasiesVGaieta" instance=default remote-address=172.25.0.214 remote-as=69 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_MasiesVGil" master-interface=wlan1 wds-address=00:12:17:B7:6F:08 disabled=no
/ ip address add address=172.25.1.9/30 network=172.25.1.8 broadcast=172.25.1.11 interface=wds_MasiesVGil disabled=no comment="wds_MasiesVGil"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_MasiesVGil] do={/routing ospf interface remove $i;}
add interface=wds_MasiesVGil
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.1.8/30] do={/routing ospf network remove $i;}
add network=172.25.1.8/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=MasiesVGil] do={/routing bgp peer remove $i;}
add name="MasiesVGil" instance=default remote-address=172.25.1.10 remote-as=86 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_MasiesVCPalou" master-interface=wlan1 wds-address=00:12:17:07:53:8A disabled=no
/ ip address add address=172.25.1.29/30 network=172.25.1.28 broadcast=172.25.1.31 interface=wds_MasiesVCPalou disabled=no comment="wds_MasiesVCPalou"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_MasiesVCPalou] do={/routing ospf interface remove $i;}
add interface=wds_MasiesVCPalou
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.1.28/30] do={/routing ospf network remove $i;}
add network=172.25.1.28/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=MasiesVCPalou] do={/routing bgp peer remove $i;}
add name="MasiesVCPalou" instance=default remote-address=172.25.1.30 remote-as=88 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_StHipCanPany" master-interface=wlan1 wds-address=00:12:17:2D:55:44 disabled=no
/ ip address add address=172.25.1.33/30 network=172.25.1.32 broadcast=172.25.1.35 interface=wds_StHipCanPany disabled=no comment="wds_StHipCanPany"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_StHipCanPany] do={/routing ospf interface remove $i;}
add interface=wds_StHipCanPany
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.1.32/30] do={/routing ospf network remove $i;}
add network=172.25.1.32/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=StHipCanPany] do={/routing bgp peer remove $i;}
add name="StHipCanPany" instance=default remote-address=172.25.1.34 remote-as=89 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_StHipMiquel" master-interface=wlan1 wds-address=00:12:17:B7:74:5A disabled=no
/ ip address add address=172.25.1.53/30 network=172.25.1.52 broadcast=172.25.1.55 interface=wds_StHipMiquel disabled=no comment="wds_StHipMiquel"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_StHipMiquel] do={/routing ospf interface remove $i;}
add interface=wds_StHipMiquel
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.1.52/30] do={/routing ospf network remove $i;}
add network=172.25.1.52/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=StHipMiquel] do={/routing bgp peer remove $i;}
add name="StHipMiquel" instance=default remote-address=172.25.1.54 remote-as=96 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_MdVoltregaBalsa" master-interface=wlan1 wds-address=00:13:10:E5:8A:E2 disabled=no
/ ip address add address=172.25.3.150/30 network=172.25.3.148 broadcast=172.25.3.151 interface=wds_MdVoltregaBalsa disabled=no comment="wds_MdVoltregaBalsa"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_MdVoltregaBalsa] do={/routing ospf interface remove $i;}
add interface=wds_MdVoltregaBalsa
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.3.148/30] do={/routing ospf network remove $i;}
add network=172.25.3.148/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=MdVoltregaBalsa] do={/routing bgp peer remove $i;}
add name="MdVoltregaBalsa" instance=default remote-address=172.25.3.149 remote-as=655 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 1 MasiesVGlevaDipAP2
/interface wireless set wlan2 name="wlan2" \
radio-name="MasiesVGlevaDipAP2" mode=ap-bridge ssid="guifi.net-MasiesVGlevaDipAP2" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=2 \
frequency=2452 \
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.8.33/27"] do={remove $i}
/ ip address add address=10.138.8.33/27 network=10.138.8.32 broadcast=10.138.8.63 interface=wlan2 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.8.32/27] do={/routing bgp network remove $i;}
add network=10.138.8.32/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.8.32/27] do={/routing ospf network remove $i;}
add network=10.138.8.32/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.8.39-10.138.8.62
: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.8.32/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.8.32/27 gateway=10.138.8.33 domain=guifi.net comment=dhcp-wlan2
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.8.34 mac-address=00:16:01:8E:DB:F1 client-id=MDVVictoriaRd1 server=dhcp-wlan2
add address=10.138.8.35 mac-address=00:15:6D:D6:93:46 client-id=SHVTSerraRd2 server=dhcp-wlan2
add address=10.138.8.36 mac-address=00:16:01:8E:D2:1D client-id=MDVBaroiRadio1 server=dhcp-wlan2
add address=10.138.8.37 mac-address=00:80:48:4F:0B:B7 client-id=MasiesPereRRadio2 server=dhcp-wlan2
add address=10.138.8.38 mac-address=00:19:3B:80:E0:AF client-id=SHVPrimsRd1 server=dhcp-wlan2
add address=10.138.8.39 mac-address=00:16:01:AD:E0:6B client-id=SHVGuzmanRadio1 server=dhcp-wlan2
add address=10.138.8.40 mac-address=00:15:6D:A7:AB:F7 client-id=LaGlevaSantiTRadio1 server=dhcp-wlan2
add address=10.138.8.41 mac-address=00:15:6D:E0:DE:8A client-id=SHVEliRadio1 server=dhcp-wlan2
add address=10.138.8.42 mac-address=ff:ff:ff:ff:ff:ff client-id=SHVPousRadio2 server=dhcp-wlan2
add address=10.138.8.43 mac-address=00:16:01:F2:13:3C client-id=MdVArumiRadio1 server=dhcp-wlan2
add address=10.138.8.44 mac-address=00:15:6D:DE:EB:66 client-id=MDVGarridoRd1 server=dhcp-wlan2
add address=10.138.8.45 mac-address=00:15:6D:A6:DE:C1 client-id=MDVLluisPRd3 server=dhcp-wlan2
add address=10.138.8.46 mac-address=00:16:01:AF:38:1A client-id=MDVFerrerRadio1 server=dhcp-wlan2
add address=10.138.8.47 mac-address=ff:ff:ff:ff:ff:ff client-id=EsquirolSusRadio1 server=dhcp-wlan2
add address=10.138.8.48 mac-address=00:15:6D:E0:DD:D5 client-id=VoltregaGuarderiaCanRibaRd2 server=dhcp-wlan2
add address=10.138.8.49 mac-address=00:15:6D:7C:D8:29 client-id=SHVHassanTRd1 server=dhcp-wlan2
add address=10.138.8.50 mac-address=00:1D:7E:30:BB:0D client-id=MSVJTorresRadio2 server=dhcp-wlan2
add address=10.138.8.51 mac-address=00:16:01:B0:04:4D client-id=SHVpocaRadio1 server=dhcp-wlan2
add address=10.138.8.52 mac-address=00:15:6D:D4:F4:E2 client-id=MDVSergiRd1 server=dhcp-wlan2
add address=10.138.8.53 mac-address=ff:ff:ff:ff:ff:ff client-id=StHipCapiRadio1 server=dhcp-wlan2
add address=10.138.8.54 mac-address=00:1D:0F:AF:24:67 client-id=MasiesMalciorRd2 server=dhcp-wlan2
add address=10.138.8.55 mac-address=00:1D:73:05:1E:27 client-id=MDVXRuizRd2 server=dhcp-wlan2
add address=10.138.8.56 mac-address=00:15:6D:A7:C0:A5 client-id=MSVmonicaRd2 server=dhcp-wlan2
add address=10.138.8.57 mac-address=08:36:00:15:DA:93 client-id=sthipolitcxandriRd1 server=dhcp-wlan2
add address=10.138.8.58 mac-address=00:16:01:B0:68:57 client-id=MDVACuberoRd1 server=dhcp-wlan2
add address=10.138.8.59 mac-address=00:16:01:AF:F3:EF client-id=MDVToniRomaRadio1 server=dhcp-wlan2
add address=10.138.8.60 mac-address=00:16:01:F2:29:B7 client-id=SHVMilioRadio1 server=dhcp-wlan2
add address=10.138.8.61 mac-address=00:15:6D:AA:BD:FB client-id=MDVAnnaJRd1 server=dhcp-wlan2
add address=10.138.8.62 mac-address=00:15:6D:D3:E2:E7 client-id=StHipolitAnaTPRd1 server=dhcp-wlan2
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.100.193/27"] do={remove $i}
/ ip address add address=10.138.100.193/27 network=10.138.100.192 broadcast=10.138.100.223 interface=wlan2 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.100.192/27] do={/routing bgp network remove $i;}
add network=10.138.100.192/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.100.192/27] do={/routing ospf network remove $i;}
add network=10.138.100.192/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.100.199-10.138.100.222
: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.100.192/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.100.192/27 gateway=10.138.100.193 domain=guifi.net comment=dhcp-wlan2
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.100.194 mac-address=00:27:22:4C:4F:32 client-id=MDVEColomRd2 server=dhcp-wlan2
add address=10.138.100.195 mac-address=00:15:6D:AB:67:5E client-id=SVHJIHRd1 server=dhcp-wlan2
add address=10.138.100.196 mac-address=99:99:99:99:99:9A client-id=SHVAbatOliba5Rd1 server=dhcp-wlan2
add address=10.138.100.197 mac-address=00:15:6D:DE:CF:76 client-id=MDVJllimosRd1 server=dhcp-wlan2
add address=10.138.100.198 mac-address=00:15:6D:AA:BA:24 client-id=MDVRodriguezRd1 server=dhcp-wlan2
add address=10.138.100.199 mac-address=00:15:6D:AA:BA:9C client-id=MDVduranRd2 server=dhcp-wlan2
add address=10.138.100.200 mac-address=00:15:6D:AB:67:8A client-id=elrefugiRd1 server=dhcp-wlan2
add address=10.138.100.201 mac-address=00:15:6D:AC:FC:86 client-id=StHipMRocaRd1 server=dhcp-wlan2
add address=10.138.100.202 mac-address=00:1D:73:55:4E:F9 client-id=MDVTSolerRd1 server=dhcp-wlan2
add address=10.138.100.203 mac-address=00:16:01:ED:C8:63 client-id=SHVJSolerRd1 server=dhcp-wlan2
add address=10.138.100.204 mac-address=00:15:6D:AC:99:A7 client-id=MdVJAHernandezRd1 server=dhcp-wlan2
add address=10.138.100.205 mac-address=00:14:BF:77:75:20 client-id=MasiesJacint server=dhcp-wlan2
add address=10.138.100.206 mac-address=00:15:6D:AD:D7:D4 client-id=SHVClaraFRd1 server=dhcp-wlan2
add address=10.138.100.207 mac-address=00:15:6D:AB:99:A8 client-id=MDVJHernandezRd1 server=dhcp-wlan2
add address=10.138.100.208 mac-address=00:15:D6:A0:25:67 client-id=MDVEsteveCasasRd1 server=dhcp-wlan2
add address=10.138.100.209 mac-address=00:15:6D:D4:77:6F client-id=MDVCostaRd1 server=dhcp-wlan2
add address=10.138.100.210 mac-address=00:1C:10:36:4D:C0 client-id=StHipolitMonRd2 server=dhcp-wlan2
add address=10.138.100.211 mac-address=00:15:6D:8C:52:7E client-id=SantHipHananRd1 server=dhcp-wlan2
add address=10.138.100.212 mac-address=00:15:6D:AB:DE:9D client-id=SHVMJubesRd1 server=dhcp-wlan2
add address=10.138.100.213 mac-address=00:15:6D:DA:15:5D client-id=MDVCPulidoRd1 server=dhcp-wlan2
add address=10.138.100.214 mac-address=00:15:6D:D3:E0:D2 client-id=MasiesToniCariRd1 server=dhcp-wlan2
add address=10.138.100.215 mac-address=00:15:6D:D2:E0:9E client-id=MDVJdelacruzRd1 server=dhcp-wlan2
add address=10.138.100.216 mac-address=00:15:6D:EE:5D:B6 client-id=SHVMRBertransRd1 server=dhcp-wlan2
add address=10.138.100.217 mac-address=00:15:6D:D7:96:FA client-id=MasiesCarlosARd1 server=dhcp-wlan2
add address=10.138.100.218 mac-address=00:16:B6:D9:E9:84 client-id=MDVLladoRd1 server=dhcp-wlan2
add address=10.138.100.219 mac-address=00:15:6D:E5:F0:3D client-id=MasiesFSantaRd1 server=dhcp-wlan2
add address=10.138.100.220 mac-address=00:15:6D:D7:96:D4 client-id=SHVMariaBRd1 server=dhcp-wlan2
add address=10.138.100.221 mac-address=00:15:6D:A6:DD:87 client-id=SHVMarcPRd1 server=dhcp-wlan2
add address=10.138.100.222 mac-address=00:16:01:8E:DB:F1 client-id=MDVJMatavacasRd2 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 MdVDipGlevaSHV
/interface wireless set wlan3 name="wlan3" \
radio-name="MdVDipGlevaSHV" mode=ap-bridge ssid="guifi.net-MdVDipGlevaSHV" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=21 \
frequency=5680 \
dfs-mode=none \
antenna-mode=ant-a 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_SHVDipositsST1" master-interface=wlan3 wds-address=00:0B:6B:DA:A4:08 disabled=no
/ ip address add address=172.25.0.66/30 network=172.25.0.64 broadcast=172.25.0.67 interface=wds_SHVDipositsST1 disabled=no comment="wds_SHVDipositsST1"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_SHVDipositsST1] do={/routing ospf interface remove $i;}
add interface=wds_SHVDipositsST1
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.0.64/30] do={/routing ospf network remove $i;}
add network=172.25.0.64/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=SHVDipositsST1] do={/routing bgp peer remove $i;}
add name="SHVDipositsST1" instance=default remote-address=172.25.0.65 remote-as=2825 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 3 MdVMssVGlvDpminiSTaRoca
/interface wireless set wlan4 name="wlan4" \
radio-name="MdVMssVGlvDpminiSTaRoca" mode=ap-bridge ssid="guifi.net-MdVMssVGlvDpminiSTaRoca" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=5180 \
dfs-mode=none \
antenna-mode=ant-b 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_ShvRocaMiniSTRd1" master-interface=wlan4 wds-address=00:0C:42:05:4F:4F disabled=no
/ ip address add address=172.25.0.126/30 network=172.25.0.124 broadcast=172.25.0.127 interface=wds_ShvRocaMiniSTRd1 disabled=no comment="wds_ShvRocaMiniSTRd1"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_ShvRocaMiniSTRd1] do={/routing ospf interface remove $i;}
add interface=wds_ShvRocaMiniSTRd1
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.0.124/30] do={/routing ospf network remove $i;}
add network=172.25.0.124/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=ShvRocaMiniSTRd1] do={/routing bgp peer remove $i;}
add name="ShvRocaMiniSTRd1" instance=default remote-address=172.25.0.125 remote-as=12677 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Routed device
#
# Other cable connections
#
# 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.8.65 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.8.65 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=45 router-id=10.138.8.65 \
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
#
# OSPF Routing
/routing ospf set router-id=10.138.8.65 distribute-default=never redistribute-connected=no \
redistribute-static=no redistribute-rip=no redistribute-bgp=as-type-1
#
:log info "Unsolclic for 45-MasiesVGlevaDipST executed."
/