# Generated for:
# RouterOSv3.x
:log info "Unsolclic for 2557-VicHabitatST2 going to be executed."
#
# Configuration for RouterOSv3.x
# Device: 2557-VicHabitatST2
#
# 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=VicHabitatST2
#
# DNS (client & server cache) zone: 27557
/ip dns set primary-dns=10.138.160.98 secondary-dns=10.138.0.2 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 27557
/system ntp client set enabled=yes mode=unicast primary-ntp=10.138.160.98 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="VicHabitat"
#
# 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 VicHabitatST2-Omni
/interface wireless set wlan1 name="wlan1" \
radio-name="VicHabitatST2-Omni" mode=ap-bridge ssid="guifi.net-VicHabitatST2-Omni" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=18 \
frequency=5620 \
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: wLan/Lan
/ip address
:foreach i in [find address="10.138.160.129/27"] do={remove $i}
/ ip address add address=10.138.160.129/27 network=10.138.160.128 broadcast=10.138.160.159 interface=wLan/Lan disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.160.128/27] do={/routing bgp network remove $i;}
add network=10.138.160.128/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.160.128/27] do={/routing ospf network remove $i;}
add network=10.138.160.128/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.160.135-10.138.160.158
: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.160.128/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.160.128/27 gateway=10.138.160.129 domain=guifi.net comment=dhcp-wLan/Lan
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
#
: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_VicEraSellesST" master-interface=wlan1 wds-address=00:0C:42:2B:9F:72 disabled=no
/ ip address add address=172.25.10.18/30 network=172.25.10.16 broadcast=172.25.10.19 interface=wds_VicEraSellesST disabled=no comment="wds_VicEraSellesST"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicEraSellesST] do={/routing ospf interface remove $i;}
add interface=wds_VicEraSellesST
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.16/30] do={/routing ospf network remove $i;}
add network=172.25.10.16/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicEraSellesST] do={/routing bgp peer remove $i;}
add name="VicEraSellesST" instance=default remote-address=172.25.10.17 remote-as=17349 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_VicEntitats" master-interface=wlan1 wds-address=00:0C:42:0C:11:AA disabled=no
/ ip address add address=172.25.10.129/30 network=172.25.10.128 broadcast=172.25.10.131 interface=wds_VicEntitats disabled=no comment="wds_VicEntitats"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicEntitats] do={/routing ospf interface remove $i;}
add interface=wds_VicEntitats
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.128/30] do={/routing ospf network remove $i;}
add network=172.25.10.128/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicEntitats] do={/routing bgp peer remove $i;}
add name="VicEntitats" instance=default remote-address=172.25.10.130 remote-as=2676 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_VicCentreObert" master-interface=wlan1 wds-address=00:0C:42:0C:11:9A disabled=no
/ ip address add address=172.25.10.133/30 network=172.25.10.132 broadcast=172.25.10.135 interface=wds_VicCentreObert disabled=no comment="wds_VicCentreObert"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicCentreObert] do={/routing ospf interface remove $i;}
add interface=wds_VicCentreObert
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.132/30] do={/routing ospf network remove $i;}
add network=172.25.10.132/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicCentreObert] do={/routing bgp peer remove $i;}
add name="VicCentreObert" instance=default remote-address=172.25.10.134 remote-as=2677 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_VicTMTRadio1" master-interface=wlan1 wds-address=00:0B:6B:81:46:C7 disabled=no
/ ip address add address=172.25.10.158/30 network=172.25.10.156 broadcast=172.25.10.159 interface=wds_VicTMTRadio1 disabled=no comment="wds_VicTMTRadio1"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicTMTRadio1] do={/routing ospf interface remove $i;}
add interface=wds_VicTMTRadio1
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.156/30] do={/routing ospf network remove $i;}
add network=172.25.10.156/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicTMTRadio1] do={/routing bgp peer remove $i;}
add name="VicTMTRadio1" instance=default remote-address=172.25.10.157 remote-as=6871 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 1 VicHabitatST2-Placa
/interface wireless set wlan2 name="wlan2" \
radio-name="VicHabitatST2-Placa" mode=ap-bridge ssid="guifi.net-VicHabitatST2-Placa" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=12 \
frequency=5180 \
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=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;}
/ interface wireless wds
add name="wds_VicPlacaEnllacos" master-interface=wlan2 wds-address=00:0B:6B:4F:7A:EB disabled=no
/ ip address add address=172.25.10.126/30 network=172.25.10.124 broadcast=172.25.10.127 interface=wds_VicPlacaEnllacos disabled=no comment="wds_VicPlacaEnllacos"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicPlacaEnllacos] do={/routing ospf interface remove $i;}
add interface=wds_VicPlacaEnllacos
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.124/30] do={/routing ospf network remove $i;}
add network=172.25.10.124/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicPlacaEnllacos] do={/routing bgp peer remove $i;}
add name="VicPlacaEnllacos" instance=default remote-address=172.25.10.125 remote-as=2707 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 2 VicHabitatST2-APsud
/interface wireless set wlan3 name="wlan3" \
radio-name="VicHabitatST2-APsud" mode=ap-bridge ssid="guifi.net-VicHabitatST2-APsud" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=2452 \
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: wLan
/ip address
:foreach i in [find address="10.138.162.1/27"] do={remove $i}
/ ip address add address=10.138.162.1/27 network=10.138.162.0 broadcast=10.138.162.31 interface=wlan3 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.162.0/27] do={/routing bgp network remove $i;}
add network=10.138.162.0/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.162.0/27] do={/routing ospf network remove $i;}
add network=10.138.162.0/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.162.7-10.138.162.30
: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.162.0/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.162.0/27 gateway=10.138.162.1 domain=guifi.net comment=dhcp-wlan3
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.162.2 mac-address=00:14:BF:D2:72:8A client-id=VicLluisSucreRadio2 server=dhcp-wlan3
add address=10.138.162.3 mac-address=00:27:22:2A:A8:8E client-id=Vicbayes52Rd1 server=dhcp-wlan3
add address=10.138.162.4 mac-address=00:18:39:D4:4B:11 client-id=VicVilartaClient server=dhcp-wlan3
add address=10.138.162.5 mac-address=00:18:39:AE:4C:6A client-id=VicJAlmatoRadio1 server=dhcp-wlan3
add address=10.138.162.6 mac-address=00:15:6D:A7:C2:76 client-id=VicCanadell2Rd3 server=dhcp-wlan3
add address=10.138.162.7 mac-address=00:18:F8:E5:F3:CB client-id=VicDestonecaisRadio1 server=dhcp-wlan3
add address=10.138.162.8 mac-address=00:16:01:B0:7B:07 client-id=VicyaacoubiRadio1 server=dhcp-wlan3
add address=10.138.162.9 mac-address=00:18:39:C6:82:F6 client-id=VicJFluviaRadio1 server=dhcp-wlan3
add address=10.138.162.10 mac-address=00:15:6D:D8:0A:0B client-id=VicElhamRd1 server=dhcp-wlan3
add address=10.138.162.11 mac-address=00:18:F8:F2:6B:A3 client-id=VicTorrentsSoleRadio1 server=dhcp-wlan3
add address=10.138.162.12 mac-address=00:15:6D:D8:23:9D client-id=VicVirreiAviles23Rd1 server=dhcp-wlan3
add address=10.138.162.13 mac-address=00:15:6D:5E:75:CF client-id=VicAbouchebatRd1 server=dhcp-wlan3
add address=10.138.162.14 mac-address=00:18:F8:E5:FB:FF client-id=VicsantmarcRadio3 server=dhcp-wlan3
add address=10.138.162.16 mac-address=00:15:6D:DA:A1:74 client-id=Victonip server=dhcp-wlan3
add address=10.138.162.17 mac-address=00:1A:70:4F:44:D0 client-id=VicJRRadio1 server=dhcp-wlan3
add address=10.138.162.18 mac-address=00:27:22:4C:49:9D client-id=VICSoumiaRd1 server=dhcp-wlan3
add address=10.138.162.19 mac-address=00:1C:10:91:47:BC client-id=VicJosepMParesRadio1 server=dhcp-wlan3
add address=10.138.162.20 mac-address=00:15:6D:DA:15:E3 client-id=VicBotanicRadio1 server=dhcp-wlan3
add address=10.138.162.21 mac-address=00:0B:6B:2C:38:1F client-id=VicSatRemeiRadio server=dhcp-wlan3
add address=10.138.162.22 mac-address=00:1C:10:14:13:6B client-id=VicRammsteinRadio1 server=dhcp-wlan3
add address=10.138.162.23 mac-address=00:80:48:4F:0C:0C client-id=VicBayes server=dhcp-wlan3
add address=10.138.162.24 mac-address=00:1D:7E:27:F0:7C client-id=VicJOliverRadio1 server=dhcp-wlan3
add address=10.138.162.25 mac-address=10:20:30:46:50:71 client-id=VicJordiCORd1 server=dhcp-wlan3
add address=10.138.162.26 mac-address=00:1A:70:4F:43:C8 client-id=VicJoanCRadio1 server=dhcp-wlan3
add address=10.138.162.27 mac-address=ff:ff:ff:ff:ff:ff client-id=VicSerrabassaRadio1 server=dhcp-wlan3
add address=10.138.162.28 mac-address=ff:ff:ff:ff:ff:ff client-id=VicGalanRadio1 server=dhcp-wlan3
add address=10.138.162.29 mac-address=00:15:6D:A6:DD:8C client-id=VicAbdelmonaimARd2 server=dhcp-wlan3
add address=10.138.162.30 mac-address=00:1D:7E:28:1B:38 client-id=VicManelRemeiRadio1 server=dhcp-wlan3
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.11.193/27"] do={remove $i}
/ ip address add address=10.138.11.193/27 network=10.138.11.192 broadcast=10.138.11.223 interface=wlan3 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.11.192/27] do={/routing bgp network remove $i;}
add network=10.138.11.192/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.11.192/27] do={/routing ospf network remove $i;}
add network=10.138.11.192/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.11.199-10.138.11.222
: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.11.192/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.11.192/27 gateway=10.138.11.193 domain=guifi.net comment=dhcp-wlan3
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.11.194 mac-address=00:15:6D:D4:7E:52 client-id=VicYawNkansahRd1 server=dhcp-wlan3
add address=10.138.11.195 mac-address=00:14:BF:D2:64:01 client-id=VicMonRadio2 server=dhcp-wlan3
add address=10.138.11.196 mac-address=00:15:6D:EA:90:6B client-id=VicMartaTortRd1 server=dhcp-wlan3
add address=10.138.11.197 mac-address=00:1D:73:05:05:BF client-id=VicJCumerasRd1 server=dhcp-wlan3
add address=10.138.11.198 mac-address=00:19:E0:67:1B:E3 client-id=VicPLEGTRd2 server=dhcp-wlan3
add address=10.138.11.200 mac-address=00:16:B6:D8:EF:E5 client-id=VicProvidencia41 server=dhcp-wlan3
add address=10.138.11.201 mac-address=00:15:6D:F8:31:D8 client-id=VicComLluisVilaAbadaRd2 server=dhcp-wlan3
add address=10.138.11.203 mac-address=00:15:6D:A8:C2:44 client-id=VicIrmaRd1 server=dhcp-wlan3
add address=10.138.11.204 mac-address=00:15:6D:AB:FD:15 client-id=VicMateoLRd1 server=dhcp-wlan3
add address=10.138.11.205 mac-address=00:15:6D:A9:2A:76 client-id=VicFerranPelegrinaRd1 server=dhcp-wlan3
add address=10.138.11.206 mac-address=00:15:6D:A9:BC:D9 client-id=VicLuisAnchaliRd1 server=dhcp-wlan3
add address=10.138.11.207 mac-address=00:16:01:8C:70:0B client-id=VicNaniRadio1 server=dhcp-wlan3
add address=10.138.11.208 mac-address=00:16:01:ED:70:18 client-id=VicBaldufaRd1 server=dhcp-wlan3
add address=10.138.11.209 mac-address=00:15:6D:AC:FC:99 client-id=VicSantPereRd1 server=dhcp-wlan3
add address=10.138.11.210 mac-address=00:15:6D:AC:98:00 client-id=vicismaelRd2 server=dhcp-wlan3
add address=10.138.11.211 mac-address=00:15:6D:AB:69:0A client-id=VicjaumarRd1 server=dhcp-wlan3
add address=10.138.11.212 mac-address=00:0C:42:22:65:BF client-id=ViCOrtizRd3 server=dhcp-wlan3
add address=10.138.11.213 mac-address=00:1D:73:55:4D:0D client-id=VicTfontRd1 server=dhcp-wlan3
add address=10.138.11.214 mac-address=00:15:6D:A9:BD:96 client-id=VicRemeiMiquelRd2 server=dhcp-wlan3
add address=10.138.11.215 mac-address=00:0C:42:25:42:D6 client-id=VicJFreixesRd1 server=dhcp-wlan3
add address=10.138.11.216 mac-address=00:15:00:8D:7B:51 client-id=VicJosepMTorrasRd1 server=dhcp-wlan3
add address=10.138.11.217 mac-address=00:1D:7E:C6:D1:AB client-id=VicelbergosPT server=dhcp-wlan3
add address=10.138.11.218 mac-address=00:15:6D:AC:F2:D1 client-id=VicDavidPRd1 server=dhcp-wlan3
add address=10.138.11.219 mac-address=00:15:6D:AC:67:96 client-id=SilviaRd1 server=dhcp-wlan3
add address=10.138.11.220 mac-address=00:15:6D:AB:C7:7B client-id=VICJosepParesRd2 server=dhcp-wlan3
add address=10.138.11.221 mac-address=00:15:6D:AE:0A:7E client-id=VicjbouRd1 server=dhcp-wlan3
add address=10.138.11.222 mac-address=00:15:6D:AD:0A:1D client-id=viclbouRd1 server=dhcp-wlan3
#
:delay 1
#
# Radio#: 3 VicHabitatST2-setup
/interface wireless set wlan4 name="wlan4" \
radio-name="VicHabitatST2-setup" mode=ap-bridge ssid="guifi.net-VicHabitatST2-setup" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=21 \
frequency=5260 \
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=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;}
#
: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_VicSetupST" master-interface=wlan4 wds-address=00:0B:6B:81:3F:F1 disabled=no
/ ip address add address=172.25.10.138/30 network=172.25.10.136 broadcast=172.25.10.139 interface=wds_VicSetupST disabled=no comment="wds_VicSetupST"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicSetupST] do={/routing ospf interface remove $i;}
add interface=wds_VicSetupST
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.136/30] do={/routing ospf network remove $i;}
add network=172.25.10.136/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicSetupST] do={/routing bgp peer remove $i;}
add name="VicSetupST" instance=default remote-address=172.25.10.137 remote-as=5589 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 4 VicHabitatST2-VicVictoria532
/interface wireless set wlan5 name="wlan5" \
radio-name="VicHabitatST2-VicVictoria532" mode=ap-bridge ssid="guifi.net-VicHabitatST2-VicVictoria532" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=5560 \
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=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;}
/ interface wireless wds
add name="wds_VicVictoriaST532" master-interface=wlan5 wds-address=00:C0:CA:1A:6B:51 disabled=no
/ ip address add address=172.25.11.90/30 network=172.25.11.88 broadcast=172.25.11.91 interface=wds_VicVictoriaST532 disabled=no comment="wds_VicVictoriaST532"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicVictoriaST532] do={/routing ospf interface remove $i;}
add interface=wds_VicVictoriaST532
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.11.88/30] do={/routing ospf network remove $i;}
add network=172.25.11.88/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicVictoriaST532] do={/routing bgp peer remove $i;}
add name="VicVictoriaST532" instance=default remote-address=172.25.11.89 remote-as=9009 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 5 VicHabitatST2-APsud5G
/interface wireless set wlan6 name="wlan6" \
radio-name="VicHabitatST2-APsud5G" mode=ap-bridge ssid="guifi.net-VicHabitatST2-APsud5G" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=5540 \
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: wLan
/ip address
:foreach i in [find address="10.138.167.33/27"] do={remove $i}
/ ip address add address=10.138.167.33/27 network=10.138.167.32 broadcast=10.138.167.63 interface=wlan6 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.167.32/27] do={/routing bgp network remove $i;}
add network=10.138.167.32/27 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wlan6] do={/routing ospf interface remove $i;}
add interface=wlan6
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.167.32/27] do={/routing ospf network remove $i;}
add network=10.138.167.32/27 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wlan6] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan6 ranges=10.138.167.39-10.138.167.62
:foreach i in [/ip dhcp-server find name=dhcp-wlan6] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wlan6 interface=wlan6 address-pool=dhcp-wlan6 disabled=no
:foreach i in [/ip dhcp-server network find address="10.138.167.32/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.167.32/27 gateway=10.138.167.33 domain=guifi.net comment=dhcp-wlan6
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.167.34 mac-address=00:15:6D:F2:3C:68 client-id=VicPiusXIIN52 server=dhcp-wlan6
add address=10.138.167.35 mac-address=00:12:2D:01:E2:F1 client-id=vicpaucasalsdRd1 server=dhcp-wlan6
add address=10.138.167.36 mac-address=00:15:6D:E5:49:EC client-id=VicYou2Rd1 server=dhcp-wlan6
add address=10.138.167.37 mac-address=00:27:22:18:3F:53 client-id=VicPoriolRd2 server=dhcp-wlan6
add address=10.138.167.38 mac-address=00:15:6D:E5:49:DF client-id=VicRiberaRd1N5 server=dhcp-wlan6
add address=10.138.167.39 mac-address=00:15:6D:31:1A:A2 client-id=VicAlejandroIgRd1 server=dhcp-wlan6
add address=10.138.167.40 mac-address=00:15:6D:D9:0B:F4 client-id=VicEmilifRd3 server=dhcp-wlan6
add address=10.138.167.41 mac-address=00:0C:42:BD:7E:7B client-id=VicOmnium842Rd1 server=dhcp-wlan6
add address=10.138.167.42 mac-address=00:15:6D:3A:05:45 client-id=VicIsaacEmRd1 server=dhcp-wlan6
add address=10.138.167.43 mac-address=00:15:6D:10:FA:C9 client-id=VicElsValenciansRTRd1 server=dhcp-wlan6
add address=10.138.167.44 mac-address=00:15:6D:10:FB:12 client-id=VicElsValenciansCBRd1 server=dhcp-wlan6
add address=10.138.167.45 mac-address=00:15:6D:B6:B8:7E client-id=VicJVerdaguerRd2 server=dhcp-wlan6
add address=10.138.167.46 mac-address=00:15:6D:D8:0C:6D client-id=VicMohaboudraRd2 server=dhcp-wlan6
add address=10.138.167.47 mac-address=00:15:6D:B0:2B:5A client-id=VicIsmaelMMRd1 server=dhcp-wlan6
add address=10.138.167.48 mac-address=00:15:6D:60:B4:F7 client-id=VicECapdevilaRd1 server=dhcp-wlan6
add address=10.138.167.49 mac-address=99:99:99:99:99:9A client-id=VicSantPere25Rd1 server=dhcp-wlan6
add address=10.138.167.50 mac-address=00:0C:42:83:0B:D1 client-id=VicBousianRd1 server=dhcp-wlan6
add address=10.138.167.51 mac-address=00:15:6D:EC:53:C2 client-id=VicAhmidaARd2 server=dhcp-wlan6
add address=10.138.167.52 mac-address=00:15:6D:3E:82:26 client-id=VicKarimaRd2 server=dhcp-wlan6
add address=10.138.167.53 mac-address=00:15:6D:3E:83:13 client-id=VicFStPereRd1 server=dhcp-wlan6
add address=10.138.167.54 mac-address=00:15:6D:5E:10:E7 client-id=VicAssensRd2 server=dhcp-wlan6
add address=10.138.167.55 mac-address=00:15:6D:5E:17:01 client-id=VicTamanantRd1 server=dhcp-wlan6
add address=10.138.167.56 mac-address=FF:FF:10:00:00:00 client-id=VicVivoRd2 server=dhcp-wlan6
add address=10.138.167.57 mac-address=00:15:6D:3A:A0:00 client-id=VicLluisSucreRd2 server=dhcp-wlan6
add address=10.138.167.58 mac-address=00:0C:42:E0:18:CD client-id=VicCandiBayes93Rd2 server=dhcp-wlan6
add address=10.138.167.59 mac-address=00:15:6D:D0:93:24 client-id=MallaElPlaRd1 server=dhcp-wlan6
add address=10.138.167.60 mac-address=00:15:6D:B0:2B:79 client-id=VicGuixa6Rd1 server=dhcp-wlan6
add address=10.138.167.61 mac-address=00:15:6D:3E:83:12 client-id=VicKarrauchRd2 server=dhcp-wlan6
add address=10.138.167.62 mac-address=00:15:6D:60:B5:6E client-id=VicSusanard1 server=dhcp-wlan6
#
:delay 1
# Type: wds/p2p
# Remove all existing wds interfaces
:foreach i in [/interface wireless wds find master-interface=wlan6] \
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=ether2] do={/routing ospf interface remove $i;}
add interface=ether2
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.72/30] do={/routing ospf network remove $i;}
add network=172.25.10.72/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicHabitatST] do={/routing bgp peer remove $i;}
add name="VicHabitatST" instance=default remote-address=172.25.10.74 remote-as=2007 \
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.10.73/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.10.73/30 network=172.25.10.72 broadcast=172.25.10.75 interface=ether2 disabled=no comment="VicHabitatST"
#
# 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.160.129 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.160.129 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=2557 router-id=10.138.160.129 \
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.160.129 distribute-default=never redistribute-connected=no \
redistribute-static=no redistribute-rip=no redistribute-bgp=as-type-1
#
:log info "Unsolclic for 2557-VicHabitatST2 executed."
/