# Generated for:
# RouterOSv4.0+
:log info "Unsolclic for 8787-RodaDipMunMik2 going to be executed."
#
# Configuration for RouterOSv4.0+
# Device: 8787-RodaDipMunMik2
#
# 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=RodaDipMunMik2
#
# DNS (client & server cache) zone: 2461
/ip dns set primary-dns=10.138.33.130 secondary-dns=10.138.0.2 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 2461
/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="RodaDipMuntanyeta"
#
# 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 RodaDipMunAPNOest
/interface wireless set wlan1 name="wlan1" \
radio-name="RodaDipMunAPNOest" mode=ap-bridge ssid="guifi.net-RodaDipMunAPNOest" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=2467 \
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.33.33/27"] do={remove $i}
/ ip address add address=10.138.33.33/27 network=10.138.33.32 broadcast=10.138.33.63 interface=wLan/Lan disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.33.32/27] do={/routing bgp network remove $i;}
add network=10.138.33.32/27 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wLan/Lan] do={/routing ospf interface remove $i;}
add interface=wLan/Lan
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.33.32/27] do={/routing ospf network remove $i;}
add network=10.138.33.32/27 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wLan/Lan] do={/ip pool remove $i;}
/ip pool add name=dhcp-wLan/Lan ranges=10.138.33.39-10.138.33.62
:foreach i in [/ip dhcp-server find name=dhcp-wLan/Lan] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wLan/Lan interface=wLan/Lan address-pool=dhcp-wLan/Lan disabled=no
:foreach i in [/ip dhcp-server network find address="10.138.33.32/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.33.32/27 gateway=10.138.33.33 domain=guifi.net comment=dhcp-wLan/Lan
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.33.34 mac-address=00:15:6D:F3:9D:2F client-id=RodaRabadaRd1 server=dhcp-wLan/Lan
add address=10.138.33.35 mac-address=00:16:01:0D:00:A2 client-id=RodaFvidal server=dhcp-wLan/Lan
add address=10.138.33.36 mac-address=00:1D:7E:28:10:20 client-id=RodaRosarioCRadio1 server=dhcp-wLan/Lan
add address=10.138.33.37 mac-address=00:16:B6:D9:01:14 client-id=RodaPiliRadio1 server=dhcp-wLan/Lan
add address=10.138.33.38 mac-address=00:16:01:B0:53:6A client-id=RodaIreneVRadio1 server=dhcp-wLan/Lan
add address=10.138.33.39 mac-address=ff:ff:ff:ff:ff:ff client-id=RodaAnnaRadio1 server=dhcp-wLan/Lan
add address=10.138.33.40 mac-address=00:16:B6:11:3C:18 client-id=RodaManubens server=dhcp-wLan/Lan
add address=10.138.33.41 mac-address=ff:ff:ff:ff:ff:ff client-id=RodaSerafi server=dhcp-wLan/Lan
add address=10.138.33.42 mac-address=00:1C:10:44:38:CD client-id=MasiesAngelNodeRadio1 server=dhcp-wLan/Lan
add address=10.138.33.43 mac-address=ff:ff:ff:ff:ff:ff client-id=RodaMiquelFreixaRadio3 server=dhcp-wLan/Lan
add address=10.138.33.44 mac-address=00:16:01:B0:0D:BD client-id=RodaJsanglasRadio1 server=dhcp-wLan/Lan
add address=10.138.33.45 mac-address=00:1C:10:14:1A:05 client-id=RodaPFabraWRT server=dhcp-wLan/Lan
add address=10.138.33.46 mac-address=00:16:01:84:75:20 client-id=RodaTorderaRadio1 server=dhcp-wLan/Lan
add address=10.138.33.47 mac-address=00:16:01:84:AF:11 client-id=AEDRodaSTATeclaRd1 server=dhcp-wLan/Lan
add address=10.138.33.48 mac-address=ff:ff:ff:ff:ff:ff client-id=RodaAnnaFRadio1 server=dhcp-wLan/Lan
add address=10.138.33.49 mac-address=00:16:01:8E:DD:1C client-id=RodaSayosRadio1 server=dhcp-wLan/Lan
add address=10.138.33.50 mac-address=ff:ff:ff:ff:ff:ff client-id=RodaMCarmen server=dhcp-wLan/Lan
add address=10.138.33.51 mac-address=00:1A:70:4F:3B:82 client-id=RodaLluisccRadio1 server=dhcp-wLan/Lan
add address=10.138.33.52 mac-address=00:27:22:4C:49:88 client-id=RodaMikhayloRd1 server=dhcp-wLan/Lan
add address=10.138.33.53 mac-address=00:0F:66:37:30:17 client-id=RodabeepRadio1 server=dhcp-wLan/Lan
add address=10.138.33.54 mac-address=ff:ff:ff:ff:ff:ff client-id=RodaMiquelPTRadio1 server=dhcp-wLan/Lan
add address=10.138.33.55 mac-address=ff:ff:ff:ff:ff:ff client-id=RodajcarbonellRadio1 server=dhcp-wLan/Lan
add address=10.138.33.56 mac-address=00:1A:70:47:B4:EC client-id=RodaBalaguerRadio1 server=dhcp-wLan/Lan
add address=10.138.33.57 mac-address=00:1D:7E:28:16:A7 client-id=RodaAdelaBRadio1 server=dhcp-wLan/Lan
add address=10.138.33.58 mac-address=00:16:01:AE:E8:11 client-id=RodaFeliuRadio1 server=dhcp-wLan/Lan
add address=10.138.33.59 mac-address=00:18:39:AE:47:CF client-id=RodaYolandaRadio1 server=dhcp-wLan/Lan
add address=10.138.33.60 mac-address=00:15:6D:AE:E3:20 client-id=RodaGemmaSRd1 server=dhcp-wLan/Lan
add address=10.138.33.61 mac-address=00:1C:10:13:99:6A client-id=RodaCanPlantesRadio1 server=dhcp-wLan/Lan
add address=10.138.33.62 mac-address=00:1A:70:4E:C2:0E client-id=RodaJperezRadio1 server=dhcp-wLan/Lan
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.138.33/27"] do={remove $i}
/ ip address add address=10.138.138.33/27 network=10.138.138.32 broadcast=10.138.138.63 interface=wlan1 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.138.32/27] do={/routing bgp network remove $i;}
add network=10.138.138.32/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.138.32/27] do={/routing ospf network remove $i;}
add network=10.138.138.32/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.138.39-10.138.138.62
: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.138.32/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.138.32/27 gateway=10.138.138.33 domain=guifi.net comment=dhcp-wlan1
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.138.34 mac-address=00:16:01:AF:ED:2B client-id=RodaHassanRadio1 server=dhcp-wlan1
add address=10.138.138.35 mac-address=00:15:6D:D1:B1:DC client-id=RodaGrabiRd2 server=dhcp-wlan1
add address=10.138.138.36 mac-address=00:16:01:B0:7C:6E client-id=RodaACampsRadio1 server=dhcp-wlan1
add address=10.138.138.37 mac-address=ff:ff:ff:ff:ff:ff client-id=RodaXeviPRadio2 server=dhcp-wlan1
add address=10.138.138.38 mac-address=00:16:01:F2:2D:54 client-id=rodasanticorRadio1 server=dhcp-wlan1
add address=10.138.138.39 mac-address=00:16:01:B0:73:9C client-id=RodaARifaRadio1 server=dhcp-wlan1
add address=10.138.138.41 mac-address=ff:ff:ff:ff:ff:ff client-id=RodaIRifaRadio1 server=dhcp-wlan1
add address=10.138.138.42 mac-address=00:0B:6B:35:FE:BD client-id=RodaMaikaRd1 server=dhcp-wlan1
add address=10.138.138.43 mac-address=00:15:6D:A6:9D:66 client-id=RodaAngelPuigRd1 server=dhcp-wlan1
add address=10.138.138.44 mac-address=00:15:6D:A7:AB:A8 client-id=RodaJordiPRd1 server=dhcp-wlan1
add address=10.138.138.45 mac-address=00:1A:70:4F:B2:C5 client-id=RodaSantamariaRd1 server=dhcp-wlan1
add address=10.138.138.46 mac-address=00:16:01:8E:E0:AF client-id=RodaCastanRd1 server=dhcp-wlan1
add address=10.138.138.47 mac-address=00:15:6D:A7:AB:D1 client-id=RodaHalidARd1 server=dhcp-wlan1
add address=10.138.138.48 mac-address=66:66:66:66:66:67 client-id=rodajoanitxe server=dhcp-wlan1
add address=10.138.138.50 mac-address=00:15:6D:A8:B8:54 client-id=RodaAzizORd1 server=dhcp-wlan1
add address=10.138.138.51 mac-address=00:15:6D:A8:1C:54 client-id=RodaAliIRd1 server=dhcp-wlan1
add address=10.138.138.52 mac-address=00:15:6D:AA:BA:83 client-id=RodaIolandaPRd1 server=dhcp-wlan1
add address=10.138.138.53 mac-address=00:15:6D:AA:BB:2E client-id=RodaEnricMRd1 server=dhcp-wlan1
add address=10.138.138.54 mac-address=00:15:6D:D9:14:0D client-id=RodaDavidCRd1 server=dhcp-wlan1
add address=10.138.138.55 mac-address=00:16:01:B0:6F:D3 client-id=RodaLluisTarterRd1 server=dhcp-wlan1
add address=10.138.138.56 mac-address=00:16:01:AF:E7:1D client-id=RodaNQuaissiRd2 server=dhcp-wlan1
add address=10.138.138.57 mac-address=00:15:6D:AB:69:C1 client-id=RodaSusannaS server=dhcp-wlan1
add address=10.138.138.58 mac-address=00:16:01:AE:F8:20 client-id=RodaSalomonRd1 server=dhcp-wlan1
add address=10.138.138.59 mac-address=00:21:29:AA:B7:01 client-id=RdvdPrBrr24Rd1 server=dhcp-wlan1
add address=10.138.138.61 mac-address=00:15:6D:E5:7D:91 client-id=MasiesRManouRd1 server=dhcp-wlan1
add address=10.138.138.62 mac-address=00:16:B6:D9:11:E5 client-id=RodaNuriaBrugueraRd1 server=dhcp-wlan1
#
:delay 1
#
# Radio#: 1 RodaDipMunAPSud
/interface wireless set wlan2 name="wlan2" \
radio-name="RodaDipMunAPSud" mode=ap-bridge ssid="guifi.net-RodaDipMunAPSud" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=2417 \
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.33.65/27"] do={remove $i}
/ ip address add address=10.138.33.65/27 network=10.138.33.64 broadcast=10.138.33.95 interface=wlan2 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.33.64/27] do={/routing bgp network remove $i;}
add network=10.138.33.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.33.64/27] do={/routing ospf network remove $i;}
add network=10.138.33.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.33.71-10.138.33.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.33.64/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.33.64/27 gateway=10.138.33.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.33.66 mac-address=00:13:10:92:73:0F client-id=GurbElRigat server=dhcp-wlan2
add address=10.138.33.67 mac-address=00:18:39:BB:FF:C0 client-id=MdRCrisEduRadio1 server=dhcp-wlan2
add address=10.138.33.69 mac-address=00:16:01:8E:E1:90 client-id=MasiesRCrosasRadio1 server=dhcp-wlan2
add address=10.138.33.70 mac-address=00:18:39:C6:27:6A client-id=MasiesGuerreroRadio1 server=dhcp-wlan2
add address=10.138.33.71 mac-address=ff:ff:ff:ff:ff:ff client-id=FolguerolesHipicaRadio1 server=dhcp-wlan2
add address=10.138.33.72 mac-address=00:80:48:4F:0C:1B client-id=MasiesGuix server=dhcp-wlan2
add address=10.138.33.73 mac-address=00:15:6D:A9:BD:5B client-id=RodaMarcVRd1 server=dhcp-wlan2
add address=10.138.33.74 mac-address=00:1D:7E:28:19:C2 client-id=VicNRieraRadio1 server=dhcp-wlan2
add address=10.138.33.75 mac-address=00:15:6D:AB:FC:75 client-id=GurbMasVilaRd1 server=dhcp-wlan2
add address=10.138.33.76 mac-address=00:15:6D:3A:64:D3 client-id=RodaAmparMRd1 server=dhcp-wlan2
add address=10.138.33.77 mac-address=00:15:6D:AD:52:00 client-id=RodaRogerFRd1 server=dhcp-wlan2
add address=10.138.33.78 mac-address=00:15:6D:1A:3C:8C client-id=MasiesPepGloriaRd1 server=dhcp-wlan2
add address=10.138.33.79 mac-address=00:15:6D:AE:0C:36 client-id=RodaRamonMRd1 server=dhcp-wlan2
add address=10.138.33.80 mac-address=22:33:44:55:66:01 client-id=RodaMontseVRd1 server=dhcp-wlan2
add address=10.138.33.81 mac-address=00:15:6D:AE:ED:7A client-id=MasiesJMasRd1 server=dhcp-wlan2
add address=10.138.33.82 mac-address=00:15:6D:ED:AF:A9 client-id=RodaEsterLLRd1 server=dhcp-wlan2
add address=10.138.33.83 mac-address=00:15:6D:E8:CC:54 client-id=MasiesJordia server=dhcp-wlan2
add address=10.138.33.84 mac-address=00:15:6D:4E:AF:17 client-id=iMadRd2 server=dhcp-wlan2
add address=10.138.33.85 mac-address=00:16:01:B0:7B:08 client-id=RdJcntVrdgr20Rd1 server=dhcp-wlan2
add address=10.138.33.86 mac-address=00:16:01:AD:B5:EC client-id=GurbPladelasala server=dhcp-wlan2
add address=10.138.33.87 mac-address=00:27:22:4C:29:EE client-id=RodaJaumeSERd1 server=dhcp-wlan2
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.138.65/27"] do={remove $i}
/ ip address add address=10.138.138.65/27 network=10.138.138.64 broadcast=10.138.138.95 interface=wlan2 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.138.64/27] do={/routing bgp network remove $i;}
add network=10.138.138.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.138.64/27] do={/routing ospf network remove $i;}
add network=10.138.138.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.138.71-10.138.138.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.138.64/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.138.64/27 gateway=10.138.138.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.138.66 mac-address=ff:ff:ff:ff:ff:ff client-id=MasiesRCGinestaRadio1 server=dhcp-wlan2
#
:delay 1
#
# Radio#: 2 RodaDipMunAP5
/interface wireless set wlan3 name="wlan3" \
radio-name="RodaDipMunAP5" mode=ap-bridge ssid="guifi.net-RodaDipMunAP5" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
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
/ip address
:foreach i in [find address="10.138.138.97/27"] do={remove $i}
/ ip address add address=10.138.138.97/27 network=10.138.138.96 broadcast=10.138.138.127 interface=wlan3 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.138.96/27] do={/routing bgp network remove $i;}
add network=10.138.138.96/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.138.96/27] do={/routing ospf network remove $i;}
add network=10.138.138.96/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.138.103-10.138.138.126
: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.138.96/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.138.96/27 gateway=10.138.138.97 domain=guifi.net comment=dhcp-wlan3
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.138.98 mac-address=00:15:6D:BB:91:9A client-id=RodaRachidIRd2 server=dhcp-wlan3
add address=10.138.138.99 mac-address=00:15:6D:BD:F7:AE client-id=RodaASentiasRd2 server=dhcp-wlan3
add address=10.138.138.100 mac-address=00:15:6D:BC:13:77 client-id=RodaRoserRd1 server=dhcp-wlan3
add address=10.138.138.101 mac-address=00:15:6D:BC:22:EC client-id=RodaRamonCRd1 server=dhcp-wlan3
add address=10.138.138.102 mac-address=00:15:6D:D6:AC:5B client-id=RodaInyaquiRd1 server=dhcp-wlan3
add address=10.138.138.103 mac-address=00:15:6D:BC:13:94 client-id=RodaPilarFRd1 server=dhcp-wlan3
add address=10.138.138.104 mac-address=00:15:6D:D3:97:1F client-id=RodaJordiMRd1 server=dhcp-wlan3
add address=10.138.138.105 mac-address=00:15:6D:D6:AC:64 client-id=RodaJuanaNRd1 server=dhcp-wlan3
add address=10.138.138.106 mac-address=00:15:6D:D6:B2:C0 client-id=RodaJoanTRd1 server=dhcp-wlan3
add address=10.138.138.107 mac-address=00:15:6D:D7:AC:67 client-id=RodaJosepDRd1 server=dhcp-wlan3
add address=10.138.138.108 mac-address=00:15:6D:D2:96:46 client-id=RodaMontseRd1 server=dhcp-wlan3
add address=10.138.138.109 mac-address=00:27:22:42:E8:F8 client-id=RodaWoKaRd2 server=dhcp-wlan3
add address=10.138.138.110 mac-address=00:15:6D:D3:96:14 client-id=RodaCasalsRd1 server=dhcp-wlan3
add address=10.138.138.111 mac-address=00:15:6D:D6:54:2D client-id=RodaAscensorRd1 server=dhcp-wlan3
add address=10.138.138.112 mac-address=00:15:6D:DA:83:52 client-id=RodaMartaGRd1 server=dhcp-wlan3
add address=10.138.138.113 mac-address=00:15:6D:D7:B2:B6 client-id=RodaDavidFRd1 server=dhcp-wlan3
add address=10.138.138.114 mac-address=00:15:6D:D0:B1:3A client-id=RodaMohamedORd1 server=dhcp-wlan3
add address=10.138.138.115 mac-address=00:15:6D:D2:BF:A9 client-id=RodaOlgaRd1 server=dhcp-wlan3
add address=10.138.138.116 mac-address=00:15:6D:D3:BE:E6 client-id=RodaAnnaSRd1 server=dhcp-wlan3
add address=10.138.138.117 mac-address=00:15:6D:DA:34:19 client-id=RodaSaikoRd1 server=dhcp-wlan3
add address=10.138.138.118 mac-address=00:15:6D:F2:20:6E client-id=RodaMarcTRd2 server=dhcp-wlan3
add address=10.138.138.119 mac-address=00:15:6D:D3:BF:6C client-id=RodaRoserMRd1 server=dhcp-wlan3
add address=10.138.138.120 mac-address=00:15:6D:D0:B1:44 client-id=RodaMustafaDipRd1 server=dhcp-wlan3
add address=10.138.138.121 mac-address=00:15:6D:E7:8E:69 client-id=RodaDavidBRd1 server=dhcp-wlan3
add address=10.138.138.122 mac-address=00:15:6D:E6:90:FC client-id=RodaJoanDRd1 server=dhcp-wlan3
add address=10.138.138.123 mac-address=00:15:6D:E6:90:09 client-id=RodaXavierTRd1 server=dhcp-wlan3
add address=10.138.138.124 mac-address=00:15:6D:E6:8F:E3 client-id=RodaMCCastellsRd1 server=dhcp-wlan3
add address=10.138.138.125 mac-address=00:15:6D:E6:90:A3 client-id=RodaJosepCRd1 server=dhcp-wlan3
add address=10.138.138.126 mac-address=00:15:6D:E6:90:C6 client-id=RodaVilaltaRd1 server=dhcp-wlan3
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.34.97/27"] do={remove $i}
/ ip address add address=10.138.34.97/27 network=10.138.34.96 broadcast=10.138.34.127 interface=wlan3 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.34.96/27] do={/routing bgp network remove $i;}
add network=10.138.34.96/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.34.96/27] do={/routing ospf network remove $i;}
add network=10.138.34.96/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.34.103-10.138.34.126
: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.34.96/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.34.96/27 gateway=10.138.34.97 domain=guifi.net comment=dhcp-wlan3
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.34.98 mac-address=00:15:6D:F3:20:E8 client-id=RodaAnselmHRd1 server=dhcp-wlan3
add address=10.138.34.99 mac-address=00:15:6D:E8:CC:A1 client-id=RodaJPratRd1 server=dhcp-wlan3
add address=10.138.34.100 mac-address=00:15:6D:F3:20:E1 client-id=RodaAnnaPRd1 server=dhcp-wlan3
add address=10.138.34.101 mac-address=00:15:6D:F3:20:6A client-id=RodaRogerARd1 server=dhcp-wlan3
add address=10.138.34.102 mac-address=00:15:6D:F3:20:E6 client-id=RodaJosepGRd1 server=dhcp-wlan3
add address=10.138.34.103 mac-address=00:15:6D:F2:20:76 client-id=RodaDavidVRd2 server=dhcp-wlan3
add address=10.138.34.104 mac-address=00:15:6D:F2:3A:A7 client-id=RodaLlarInfantsRd2 server=dhcp-wlan3
add address=10.138.34.105 mac-address=00:15:6D:F3:1F:AF client-id=RodaSalimRd1 server=dhcp-wlan3
add address=10.138.34.106 mac-address=00:15:6D:F6:1D:FB client-id=RodaDelgadoRd2 server=dhcp-wlan3
add address=10.138.34.107 mac-address=00:15:6D:B0:2A:E6 client-id=RodaElIdrissiRd1 server=dhcp-wlan3
add address=10.138.34.108 mac-address=00:15:6D:F6:1D:AA client-id=RodaMohamedRd1 server=dhcp-wlan3
add address=10.138.34.109 mac-address=00:15:6D:F2:1F:E3 client-id=RodaJordiGRd1 server=dhcp-wlan3
add address=10.138.34.110 mac-address=00:15:6D:F2:20:E5 client-id=RodaCriviRd2 server=dhcp-wlan3
add address=10.138.34.111 mac-address=00:15:6D:E6:8F:92 client-id=RodaJosepFRd1 server=dhcp-wlan3
add address=10.138.34.112 mac-address=00:15:6D:3A:A6:DC client-id=RodaVictoriaJRd1 server=dhcp-wlan3
add address=10.138.34.113 mac-address=00:15:6D:3A:A6:57 client-id=RodaUshiRd1 server=dhcp-wlan3
add address=10.138.34.114 mac-address=00:15:6D:30:19:BF client-id=RodaMartaAlzina6Rd3 server=dhcp-wlan3
add address=10.138.34.115 mac-address=55:44:33:22:88:01 client-id=RodaPepPRd2 server=dhcp-wlan3
add address=10.138.34.116 mac-address=00:15:6D:EC:D5:F7 client-id=RodaSiouxShivaRd2 server=dhcp-wlan3
add address=10.138.34.117 mac-address=00:15:D6:A0:24:79 client-id=RodaXeviRRd1 server=dhcp-wlan3
add address=10.138.34.118 mac-address=00:15:6D:EE:6A:0F client-id=RodaFerranTRd1 server=dhcp-wlan3
add address=10.138.34.119 mac-address=00:15:6D:E6:8E:3B client-id=RodaDavidFontRd1 server=dhcp-wlan3
add address=10.138.34.120 mac-address=00:15:6D:9A:7D:E1 client-id=RodaMireiaRd1 server=dhcp-wlan3
add address=10.138.34.121 mac-address=00:15:6D:9A:7C:26 client-id=RodaPilarRd1 server=dhcp-wlan3
add address=10.138.34.122 mac-address=00:15:6D:9A:7D:AA client-id=RodaMeritxellRRd1 server=dhcp-wlan3
add address=10.138.34.123 mac-address=00:27:22:00:18:C3 client-id=RodaAbdelazizRd1 server=dhcp-wlan3
add address=10.138.34.124 mac-address=00:16:01:F2:0E:1E client-id=RodaMCasadevallRadio1 server=dhcp-wlan3
add address=10.138.34.125 mac-address=00:27:22:00:0E:CB client-id=RodaEstherRRd1 server=dhcp-wlan3
add address=10.138.34.126 mac-address=00:27:22:00:0E:B9 client-id=RodaAbdelkarimRd1 server=dhcp-wlan3
#
:delay 1
# Type: wds/p2p
# Remove all existing wds interfaces
:foreach i in [/interface wireless wds find master-interface=wlan3] \
do={:foreach n in [/interface wireless wds get $i name] \
do={:foreach inum in [/ip address find interface=$n] \
do={/ip address remove $inum;};}; \
/interface wireless wds remove $i;}
#
:delay 1
#
# Radio#: 3 RodaDipMunAP5-2
/interface wireless set wlan4 name="wlan4" \
radio-name="RodaDipMunAP5-2" mode=ap-bridge ssid="guifi.net-RodaDipMunAP5-2" \
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.140.32.33/27"] do={remove $i}
/ ip address add address=10.140.32.33/27 network=10.140.32.32 broadcast=10.140.32.63 interface=wlan4 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.140.32.32/27] do={/routing bgp network remove $i;}
add network=10.140.32.32/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.140.32.32/27] do={/routing ospf network remove $i;}
add network=10.140.32.32/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.140.32.39-10.140.32.62
: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.140.32.32/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.140.32.32/27 gateway=10.140.32.33 domain=guifi.net comment=dhcp-wlan4
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.140.32.34 mac-address=00:0C:42:D9:04:C1 client-id=EsquirolShivaRd2 server=dhcp-wlan4
add address=10.140.32.35 mac-address=00:27:22:42:E8:F8 client-id=RodaWoKaRd1 server=dhcp-wlan4
add address=10.140.32.36 mac-address=00:0C:42:CC:C6:3D client-id=RodaMQuintanaRd1 server=dhcp-wlan4
add address=10.140.32.37 mac-address=00:27:22:10:F8:5A client-id=RodaRQuintanaRd1 server=dhcp-wlan4
add address=10.140.32.38 mac-address=00:0C:42:CC:BA:EF client-id=RodaRCasasRd1 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
#
# 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.25.12/30] do={/routing ospf network remove $i;}
add network=172.25.25.12/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=RodaDipMuntanyetaLinks] do={/routing bgp peer remove $i;}
add name="RodaDipMuntanyetaLinks" instance=default remote-address=172.25.25.13 remote-as=2353 \
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.25.14/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.25.14/30 network=172.25.25.12 broadcast=172.25.25.15 interface=ether2 disabled=no comment="RodaDipMuntanyetaLinks"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=ether3] do={/routing ospf interface remove $i;}
add interface=ether3
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.25.56/30] do={/routing ospf network remove $i;}
add network=172.25.25.56/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=RodaDipMunRocketM516dBi] do={/routing bgp peer remove $i;}
add name="RodaDipMunRocketM516dBi" instance=default remote-address=172.25.25.58 remote-as=36416 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
:foreach i in [/ip address find address="172.25.25.57/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.25.57/30 network=172.25.25.56 broadcast=172.25.25.59 interface=ether3 disabled=no comment="RodaDipMunRocketM516dBi"
#
# 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.33.33 comment="" disabled=no
add chain=srcnat src-address="172.16.0.0/12" dst-address=!172.16.0.0/12 protocol=!ospf action=src-nat to-addresses=10.138.33.33 comment="" disabled=no
#
# BGP Routing
# BGP & OSPF Filters
:foreach i in [/routing filter find chain=ospf-in] do={/routing filter remove $i;}
:foreach i in [/routing filter find chain=ospf-out] do={/routing filter remove $i;}
:foreach i in [/routing filter find chain=ebgp-in] do={/routing filter remove $i;}
:foreach i in [/routing filter find chain=ebgp-out] do={/routing filter remove $i;}
/ routing filter
add action=discard chain=ebgp-in comment="1. Discard insert non 10.x routes from BGP peer" disabled=no invert-match=no prefix=!10.0.0.0/8 prefix-length=!8-32
add action=discard chain=ebgp-out comment="2. Discard send non 10.x routes to BGP peer" disabled=no invert-match=no prefix=!10.0.0.0/8 prefix-length=!8-32
add action=accept chain=ospf-in comment="3. Accept insert 10.x routes from OSPF neighbor" disabled=no invert-match=no prefix=10.0.0.0/8 prefix-length=8-32
add action=accept chain=ospf-in comment="4. Accept insert 172.x routes from OSPF neighbor" disabled=no invert-match=no prefix=172.16.0.0/12 prefix-length=8-32
add action=discard chain=ospf-in comment="5. Discard insert non 10.x and 172.x from OSPF neighbor" disabled=no invert-match=no
add action=accept chain=ospf-out comment="6. Allow send 10.x routes to OSPF neighbor" disabled=no invert-match=no prefix=10.0.0.0/8 prefix-length=8-32
add action=accept chain=ospf-out comment="7. Allow send 172.x routes to OSPF neighbor" disabled=no invert-match=no prefix=172.16.0.0/12 prefix-length=8-32
add action=discard chain=ospf-out comment="8. Discard send non 10.x and 172.x to OSPF neighbor" disabled=no invert-match=no
#
# BGP instance
/ routing bgp instance
set default name="default" as=8787 router-id=10.138.33.33 \
redistribute-connected=no redistribute-static=no redistribute-rip=no \
redistribute-ospf=yes redistribute-other-bgp=yes out-filter=ebgp-out \
client-to-client-reflection=yes comment="" disabled=no
#
# OSPF Routing
/routing ospf instance set default name=default router-id=10.138.33.33 comment="" disabled=no distribute-default=never \
redistribute-bgp=as-type-1 redistribute-connected=no redistribute-other-ospf=no redistribute-rip=no redistribute-static=no in-filter=ospf-in out-filter=ospf-out
#
:log info "Unsolclic for 8787-RodaDipMunMik2 executed."
/