# Generated for:
# RouterOSv4.7+
:log info "Unsolclic for 2813-TorelloGestiomatST going to be executed."
#
# Configuration for RouterOS 4.7 and newer 4.x
# Device: 2813-TorelloGestiomatST
#
# 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=TorelloGestiomatST
#
# 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="TorelloGestiomat"
#
# 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 TorelloGestiomatAP
/interface wireless set wlan1 name="wlan1" \
radio-name="TorelloGestiomatAP" mode=ap-bridge ssid="guifi.net-TorelloGestiomatAP" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=12 \
frequency=2437 \
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.65/27"] do={remove $i}
/ ip address add address=10.138.61.65/27 network=10.138.61.64 broadcast=10.138.61.95 interface=wLan/Lan disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.61.64/27] do={/routing bgp network remove $i;}
add network=10.138.61.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.61.64/27] do={/routing ospf network remove $i;}
add network=10.138.61.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.61.71-10.138.61.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.61.64/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.61.64/27 gateway=10.138.61.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.61.66 mac-address=ff:ff:ff:ff:ff:ff client-id=TorellomakhustRadio1 server=dhcp-wLan/Lan
add address=10.138.61.67 mac-address=00:14:BF:EB:72:FC client-id=jordikokRadio1 server=dhcp-wLan/Lan
add address=10.138.61.68 mac-address=00:18:F8:F1:CD:DF client-id=TorelloMig19 server=dhcp-wLan/Lan
add address=10.138.61.69 mac-address=00:16:B6:D9:08:D6 client-id=TorelloVBassaganyaRadio1 server=dhcp-wLan/Lan
add address=10.138.61.70 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloJordiArcaronsRadio1 server=dhcp-wLan/Lan
add address=10.138.61.71 mac-address=00:22:6B:95:96:E7 client-id=TorelloNuriaRd1 server=dhcp-wLan/Lan
add address=10.138.61.72 mac-address=00:1D:73:18:05:77 client-id=TorelloLCampinsRd1 server=dhcp-wLan/Lan
add address=10.138.61.73 mac-address=00:15:6D:DB:A2:5B client-id=TorelloAnaGRd1 server=dhcp-wLan/Lan
add address=10.138.61.74 mac-address=00:15:6D:AD:5D:D7 client-id=TorelloMarionamadaulRd1 server=dhcp-wLan/Lan
add address=10.138.61.75 mac-address=00:15:6D:AE:5D:D8 client-id=TorelloJordiArgemiRd1 server=dhcp-wLan/Lan
add address=10.138.61.76 mac-address=00:18:39:AE:6E:4B client-id=TorelloALopezRadio1 server=dhcp-wLan/Lan
add address=10.138.61.77 mac-address=ff:ff:ff:ff:ff:ff client-id=TorellosergimartinezRadio1 server=dhcp-wLan/Lan
add address=10.138.61.78 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloPlatasRadio2 server=dhcp-wLan/Lan
add address=10.138.61.79 mac-address=00:15:6D:D6:96:64 client-id=TorelloPParesRd1 server=dhcp-wLan/Lan
add address=10.138.61.80 mac-address=00:1A:70:7B:6F:3B client-id=TorelloSCastellsRadio1 server=dhcp-wLan/Lan
add address=10.138.61.82 mac-address=00:18:39:C6:82:FC client-id=TorelloJTuneuRadio1 server=dhcp-wLan/Lan
add address=10.138.61.83 mac-address=00:18:39:C6:82:FF client-id=TorelloPGutierrezRadio1 server=dhcp-wLan/Lan
add address=10.138.61.84 mac-address=00:1A:70:7B:6F:1F client-id=TorelloSJimenezRadio1 server=dhcp-wLan/Lan
add address=10.138.61.85 mac-address=00:18:39:C6:4A:52 client-id=TorelloJosepSRd1 server=dhcp-wLan/Lan
add address=10.138.61.86 mac-address=00:1C:10:36:46:D7 client-id=TorelloYebraRadio1 server=dhcp-wLan/Lan
add address=10.138.61.87 mac-address=00:15:D6:A0:25:67 client-id=TorelloPCapdevilaRd2 server=dhcp-wLan/Lan
add address=10.138.61.88 mac-address=ff:ff:ff:ff:ff:ff client-id=TorellocoperativaRadio1 server=dhcp-wLan/Lan
add address=10.138.61.89 mac-address=00:15:6D:D2:E2:CF client-id=TorelloJoVilardRd2 server=dhcp-wLan/Lan
add address=10.138.61.90 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloTarboixRadio1 server=dhcp-wLan/Lan
add address=10.138.61.91 mac-address=00:1A:70:4F:35:AE client-id=TorelloCalabuigRadio1 server=dhcp-wLan/Lan
add address=10.138.61.92 mac-address=00:16:01:0D:36:32 client-id=TorelloRouraRadio1 server=dhcp-wLan/Lan
add address=10.138.61.93 mac-address=00:02:34:D5:66:58 client-id=TorelloPinsRd1 server=dhcp-wLan/Lan
add address=10.138.61.94 mac-address=00:21:29:B5:E6:DA client-id=TrllPssgFrl3Rd1 server=dhcp-wLan/Lan
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.140.225/27"] do={remove $i}
/ ip address add address=10.138.140.225/27 network=10.138.140.224 broadcast=10.138.140.255 interface=wlan1 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.140.224/27] do={/routing bgp network remove $i;}
add network=10.138.140.224/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.140.224/27] do={/routing ospf network remove $i;}
add network=10.138.140.224/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.140.231-10.138.140.254
: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.140.224/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.140.224/27 gateway=10.138.140.225 domain=guifi.net comment=dhcp-wlan1
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.140.226 mac-address=00:15:6D:DB:B8:90 client-id=TorelloManelFRd1 server=dhcp-wlan1
add address=10.138.140.227 mac-address=00:16:01:B0:6C:01 client-id=TorellotallerinformaticRadio1 server=dhcp-wlan1
add address=10.138.140.228 mac-address=00:15:6D:72:11:65 client-id=TorelloJoanSola15Rd1 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;}
#
:delay 1
#
# Radio#: 1 TorelloGestiomatAP2
/interface wireless set wlan2 name="wlan2" \
radio-name="TorelloGestiomatAP2" mode=ap-bridge ssid="guifi.net-TorelloGestiomatAP2" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=2457 \
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.136.65/27"] do={remove $i}
/ ip address add address=10.138.136.65/27 network=10.138.136.64 broadcast=10.138.136.95 interface=wlan2 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.136.64/27] do={/routing bgp network remove $i;}
add network=10.138.136.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.136.64/27] do={/routing ospf network remove $i;}
add network=10.138.136.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.136.71-10.138.136.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.136.64/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.136.64/27 gateway=10.138.136.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.136.66 mac-address=00:1A:70:7B:6F:56 client-id=TorelloVPijoanRadio1 server=dhcp-wlan2
add address=10.138.136.67 mac-address=00:1A:70:47:B8:2A client-id=TorelloAlmatoRadio1 server=dhcp-wlan2
add address=10.138.136.68 mac-address=00:15:6D:AD:5D:D4 client-id=TorelloemilisalaRd1 server=dhcp-wlan2
add address=10.138.136.69 mac-address=00:15:6D:1A:67:6D client-id=TorelloMRualesRd1 server=dhcp-wlan2
add address=10.138.136.70 mac-address=00:1D:7E:28:17:1B client-id=TorelloTVazquezRadio1 server=dhcp-wlan2
add address=10.138.136.71 mac-address=00:15:6D:AE:ED:F3 client-id=TorelloMAankadRd3 server=dhcp-wlan2
add address=10.138.136.72 mac-address=00:1D:7E:28:0A:9B client-id=TorelloTDevesaRadio1 server=dhcp-wlan2
add address=10.138.136.73 mac-address=00:1A:70:7B:6E:5A client-id=TorelloPTorrentGenerRadio1 server=dhcp-wlan2
add address=10.138.136.74 mac-address=00:1D:7E:4B:20:F1 client-id=TorelloSolaRadio1 server=dhcp-wlan2
add address=10.138.136.75 mac-address=00:1D:7E:4B:1B:75 client-id=TorelloEduardcRadio1 server=dhcp-wlan2
add address=10.138.136.76 mac-address=00:1D:7E:4B:25:29 client-id=TorellosacsR1 server=dhcp-wlan2
add address=10.138.136.77 mac-address=00:18:39:BF:B4:37 client-id=TorellosmartinezRadio1 server=dhcp-wlan2
add address=10.138.136.78 mac-address=00:1D:7E:27:EC:DF client-id=TorelloRevillaRadio1 server=dhcp-wlan2
add address=10.138.136.79 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloAZidanRadio1 server=dhcp-wlan2
add address=10.138.136.80 mac-address=00:15:6D:D2:E7:31 client-id=TorelloGes4Rd1 server=dhcp-wlan2
add address=10.138.136.81 mac-address=00:15:6D:A6:F0:C0 client-id=TorelloXCampsRadio1 server=dhcp-wlan2
add address=10.138.136.82 mac-address=00:15:6D:A7:B9:C7 client-id=TorelloJoVilardRd1 server=dhcp-wlan2
add address=10.138.136.84 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloPuigRadio2 server=dhcp-wlan2
add address=10.138.136.86 mac-address=ff:ff:ff:ff:ff:ff client-id=TorelloGonzaloRadio1 server=dhcp-wlan2
add address=10.138.136.87 mac-address=00:15:6D:A7:1C:92 client-id=TorelloGGBRadio server=dhcp-wlan2
add address=10.138.136.88 mac-address=00:1D:73:18:42:29 client-id=TorelloCMigRadio1 server=dhcp-wlan2
add address=10.138.136.89 mac-address=00:15:6D:AB:F3:FC client-id=TorelloAAcarapiRd1 server=dhcp-wlan2
add address=10.138.136.90 mac-address=FF:FF:FF:FF:FF:FF client-id=TorelloSellaresRadio1 server=dhcp-wlan2
add address=10.138.136.91 mac-address=68:7F:74:54:A7:C0 client-id=TorelloMArimanyRd1 server=dhcp-wlan2
add address=10.138.136.92 mac-address=00:16:01:4D:9C:0D client-id=TorelloDMonteroRd1 server=dhcp-wlan2
add address=10.138.136.93 mac-address=00:21:29:B0:A8:04 client-id=TorelloFSubirachsRd1 server=dhcp-wlan2
add address=10.138.136.94 mac-address=00:15:6D:AA:BD:FF client-id=PCrivillersRd2 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 TorelloGestiomatAP3
/interface wireless set wlan3 name="wlan3" \
radio-name="TorelloGestiomatAP3" mode=ap-bridge ssid="guifi.net-TorelloGestiomatAP3" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=2437 \
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.140.65/27"] do={remove $i}
/ ip address add address=10.138.140.65/27 network=10.138.140.64 broadcast=10.138.140.95 interface=wlan3 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.140.64/27] do={/routing bgp network remove $i;}
add network=10.138.140.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.140.64/27] do={/routing ospf network remove $i;}
add network=10.138.140.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.140.71-10.138.140.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.140.64/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.140.64/27 gateway=10.138.140.65 domain=guifi.net comment=dhcp-wlan3
/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=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 TorelloGestiomat5GAP4
/interface wireless set wlan4 name="wlan4" \
radio-name="TorelloGestiomat5GAP4" mode=ap-bridge ssid="guifi.net-TorelloGestiomat5GAP4" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
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: wLan
/ip address
:foreach i in [find address="10.138.140.97/27"] do={remove $i}
/ ip address add address=10.138.140.97/27 network=10.138.140.96 broadcast=10.138.140.127 interface=wlan4 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.140.96/27] do={/routing bgp network remove $i;}
add network=10.138.140.96/27 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wlan4] do={/routing ospf interface remove $i;}
add interface=wlan4
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.140.96/27] do={/routing ospf network remove $i;}
add network=10.138.140.96/27 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wlan4] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan4 ranges=10.138.140.103-10.138.140.126
:foreach i in [/ip dhcp-server find name=dhcp-wlan4] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wlan4 interface=wlan4 address-pool=dhcp-wlan4 disabled=no
:foreach i in [/ip dhcp-server network find address="10.138.140.96/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.140.96/27 gateway=10.138.140.97 domain=guifi.net comment=dhcp-wlan4
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.140.99 mac-address=99:99:99:99:99:9A client-id=TorelloJordiPlRd4 server=dhcp-wlan4
add address=10.138.140.100 mac-address=00:15:6D:7A:2D:A0 client-id=TorelloJVidrierRd1 server=dhcp-wlan4
#
: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
#
# Radio#: 4 TorelloGestiomat5GAP5
/interface wireless set wlan5 name="wlan5" \
radio-name="TorelloGestiomat5GAP5" mode=ap-bridge ssid="guifi.net-TorelloGestiomat5GAP5" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=5200 \
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.140.129/27"] do={remove $i}
/ ip address add address=10.138.140.129/27 network=10.138.140.128 broadcast=10.138.140.159 interface=wlan5 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.140.128/27] do={/routing bgp network remove $i;}
add network=10.138.140.128/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.140.128/27] do={/routing ospf network remove $i;}
add network=10.138.140.128/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.140.135-10.138.140.158
: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.140.128/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.140.128/27 gateway=10.138.140.129 domain=guifi.net comment=dhcp-wlan5
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.140.130 mac-address=00:15:6D:B0:2B:91 client-id=TorelloMusta2Rd1 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
#
# Radio#: 5 TorelloGestiomat5GAP6
/interface wireless set wlan6 name="wlan6" \
radio-name="TorelloGestiomat5GAP6" mode=ap-bridge ssid="guifi.net-TorelloGestiomat5GAP6" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=5220 \
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.140.161/27"] do={remove $i}
/ ip address add address=10.138.140.161/27 network=10.138.140.160 broadcast=10.138.140.191 interface=wlan6 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.140.160/27] do={/routing bgp network remove $i;}
add network=10.138.140.160/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.140.160/27] do={/routing ospf network remove $i;}
add network=10.138.140.160/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.140.167-10.138.140.190
: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.140.160/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.140.160/27 gateway=10.138.140.161 domain=guifi.net comment=dhcp-wlan6
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.140.162 mac-address=00:15:6D:9A:19:45 client-id=TorelloAdolf2533Rd1 server=dhcp-wlan6
add address=10.138.140.163 mac-address=00:15:6D:3C:95:E3 client-id=TorelloRSRd2 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
#
# Radio#: 6 TorelloGestioDip
/interface wireless set wlan7 name="wlan7" \
radio-name="TorelloGestioDip" mode=ap-bridge ssid="guifi.net-TorelloGestioDip" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=18 \
frequency=5520 \
dfs-mode=none \
wds-mode=static wds-default-bridge=none wds-default-cost=100 \
wds-cost-range=50-150 wds-ignore-ssid=yes hide-ssid=no
:delay 1
# Type: wds/p2p
# Remove all existing wds interfaces
:foreach i in [/interface wireless wds find master-interface=wlan7] \
do={:foreach n in [/interface wireless wds get $i name] \
do={:foreach inum in [/ip address find interface=$n] \
do={/ip address remove $inum;};}; \
/interface wireless wds remove $i;}
/ interface wireless wds
add name="wds_TorelloDipSudST1" master-interface=wlan7 wds-address=00:0B:6B:4E:D4:57 disabled=no
/ ip address add address=172.25.16.13/30 network=172.25.16.12 broadcast=172.25.16.15 interface=wds_TorelloDipSudST1 disabled=no comment="wds_TorelloDipSudST1"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_TorelloDipSudST1] do={/routing ospf interface remove $i;}
add interface=wds_TorelloDipSudST1
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.16.12/30] do={/routing ospf network remove $i;}
add network=172.25.16.12/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=TorelloDipSudST1] do={/routing bgp peer remove $i;}
add name="TorelloDipSudST1" instance=default remote-address=172.25.16.14 remote-as=2582 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
#
: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.61.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.61.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=2813 router-id=10.138.61.65 \
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.65 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 2813-TorelloGestiomatST executed."
/