# Generated for:
# RouterOSv5.x
:log info "Unsolclic for 13-VicSeminariSud going to be executed."
#
# Configuration for RouterOSv5.x
# Device: 13-VicSeminariSud
#
# 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=VicSeminariSud
#
# DNS (client & server cache) zone: 27556
/ip dns set servers=10.138.160.98,10.138.0.2 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 27556
/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="VicSeminari"
#
# 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 VicSeminariSud
/interface wireless set wlan1 name="wlan1" \
radio-name="VicSeminariSud" mode=ap-bridge ssid="guifi.net-VicSeminariSud" \
band="2ghz-b" channel-width=20mhz \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=2447 \
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.21.1/27"] do={remove $i}
/ ip address add address=10.138.21.1/27 network=10.138.21.0 broadcast=10.138.21.31 interface=wLan/Lan disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.21.0/27] do={/routing bgp network remove $i;}
add network=10.138.21.0/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.21.0/27] do={/routing ospf network remove $i;}
add network=10.138.21.0/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.21.7-10.138.21.30
: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.21.0/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.21.0/27 gateway=10.138.21.1 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.21.2 mac-address=00:16:01:8C:A6:27 client-id=VicGilRd2 server=dhcp-wLan/Lan
add address=10.138.21.3 mac-address=00:16:01:B0:7F:73 client-id=VicLluisGRadio1 server=dhcp-wLan/Lan
add address=10.138.21.4 mac-address=00:1D:7E:C6:BB:05 client-id=VicJCodinachsRadio1 server=dhcp-wLan/Lan
add address=10.138.21.5 mac-address=00:16:01:AF:DA:99 client-id=VicLluisTRadio1 server=dhcp-wLan/Lan
add address=10.138.21.6 mac-address=00:15:6D:AA:BB:A2 client-id=VicPereERd1 server=dhcp-wLan/Lan
add address=10.138.21.7 mac-address=00:21:27:CA:D7:BC client-id=escurialRd1 server=dhcp-wLan/Lan
add address=10.138.21.8 mac-address=ff:ff:ff:ff:ff:ff client-id=VicRoviraPasseigRadio1 server=dhcp-wLan/Lan
add address=10.138.21.9 mac-address=00:16:01:0D:15:9D client-id=VicMohamedRd1 server=dhcp-wLan/Lan
add address=10.138.21.10 mac-address=00:1C:10:36:4D:AB client-id=VicEscofetRadio server=dhcp-wLan/Lan
add address=10.138.21.11 mac-address=00:14:BF:2F:43:C1 client-id=VicJAngladaRadio1 server=dhcp-wLan/Lan
add address=10.138.21.12 mac-address=00:15:6D:A8:C2:2E client-id=VicMarianaRd2 server=dhcp-wLan/Lan
add address=10.138.21.13 mac-address=00:18:F8:E5:FA:AC client-id=VicQuimPerezRadio1 server=dhcp-wLan/Lan
add address=10.138.21.14 mac-address=00:16:01:F4:CB:44 client-id=VicArmengolRadio1 server=dhcp-wLan/Lan
add address=10.138.21.15 mac-address=00:15:6D:D4:7E:5C client-id=VicMontseSalomRd1 server=dhcp-wLan/Lan
add address=10.138.21.17 mac-address=00:0C:42:1B:68:DD client-id=VicFerranRadio1 server=dhcp-wLan/Lan
add address=10.138.21.18 mac-address=00:14:BF:EB:92:87 client-id=VicRobertRadio1 server=dhcp-wLan/Lan
add address=10.138.21.19 mac-address=00:15:6D:5E:82:FE client-id=VicAntonioMRd3 server=dhcp-wLan/Lan
add address=10.138.21.20 mac-address=00:16:B6:39:7F:DF client-id=VicRSerratRadio1 server=dhcp-wLan/Lan
add address=10.138.21.21 mac-address=00:14:BF:EB:6D:83 client-id=VicJCollRadio1 server=dhcp-wLan/Lan
add address=10.138.21.22 mac-address=00:14:BF:D2:72:8F client-id=VicCtraRodaAlbertRadio1 server=dhcp-wLan/Lan
add address=10.138.21.23 mac-address=00:15:6D:AC:F8:1E client-id=VicMarionaRd1 server=dhcp-wLan/Lan
add address=10.138.21.24 mac-address=00:15:6D:A7:A9:B8 client-id=VicXEsponaRd1 server=dhcp-wLan/Lan
add address=10.138.21.25 mac-address=00:01:02:03:04:06 client-id=VicSalvadorRd1 server=dhcp-wLan/Lan
add address=10.138.21.26 mac-address=00:0D:0B:FD:64:CC client-id=VicCNordRadio1 server=dhcp-wLan/Lan
add address=10.138.21.27 mac-address=08:00:69:02:01:FD client-id=VicCorominasGlevaRd1 server=dhcp-wLan/Lan
add address=10.138.21.28 mac-address=00:16:01:B0:86:2F client-id=Vicff2eksRd1 server=dhcp-wLan/Lan
add address=10.138.21.29 mac-address=00:14:BF:C4:F9:4A client-id=VicMartaXapicRd2 server=dhcp-wLan/Lan
add address=10.138.21.30 mac-address=00:16:01:8D:9C:AF client-id=VicMaiteSRd4 server=dhcp-wLan/Lan
#
:delay 1
# Type: wds/p2p
# Remove all existing wds interfaces
:foreach i in [/interface wireless wds find master-interface=wlan1] \
do={:foreach n in [/interface wireless wds get $i name] \
do={:foreach inum in [/ip address find interface=$n] \
do={/ip address remove $inum;};}; \
/interface wireless wds remove $i;}
/ interface wireless wds
add name="wds_VicImpevic" master-interface=wlan1 wds-address=00:0F:66:D9:B8:D6 disabled=yes
/ ip address add address=172.25.0.98/30 network=172.25.0.96 broadcast=172.25.0.99 interface=wds_VicImpevic disabled=yes comment="wds_VicImpevic"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicImpevic] do={/routing ospf interface remove $i;}
add interface=wds_VicImpevic
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.0.96/30] do={/routing ospf network remove $i;}
add network=172.25.0.96/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicImpevic] do={/routing bgp peer remove $i;}
add name="VicImpevic" instance=default remote-address=172.25.0.97 remote-as=47 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_VicGColl" master-interface=wlan1 wds-address=00:13:10:3F:75:89 disabled=no
/ ip address add address=172.25.2.129/30 network=172.25.2.128 broadcast=172.25.2.131 interface=wds_VicGColl disabled=no comment="wds_VicGColl"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicGColl] do={/routing ospf interface remove $i;}
add interface=wds_VicGColl
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.2.128/30] do={/routing ospf network remove $i;}
add network=172.25.2.128/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicGColl] do={/routing bgp peer remove $i;}
add name="VicGColl" instance=default remote-address=172.25.2.130 remote-as=247 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_VicTetill" master-interface=wlan1 wds-address=00:13:10:E5:75:3A disabled=no
/ ip address add address=172.25.10.26/30 network=172.25.10.24 broadcast=172.25.10.27 interface=wds_VicTetill disabled=no comment="wds_VicTetill"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicTetill] do={/routing ospf interface remove $i;}
add interface=wds_VicTetill
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.24/30] do={/routing ospf network remove $i;}
add network=172.25.10.24/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicTetill] do={/routing bgp peer remove $i;}
add name="VicTetill" instance=default remote-address=172.25.10.25 remote-as=369 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 1 VicSeminariSud-Bujons
/interface wireless set wlan2 name="wlan2" \
radio-name="VicSeminariSud-Bujons" mode=ap-bridge ssid="guifi.net-VicSeminariSud-Bujons" \
band="5ghz-a" channel-width=20mhz \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=5320 \
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_VicBarriOsonaNordST" master-interface=wlan2 wds-address=00:0C:42:0C:97:24 disabled=no
/ ip address add address=172.25.10.146/30 network=172.25.10.144 broadcast=172.25.10.147 interface=wds_VicBarriOsonaNordST disabled=no comment="wds_VicBarriOsonaNordST"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicBarriOsonaNordST] do={/routing ospf interface remove $i;}
add interface=wds_VicBarriOsonaNordST
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.144/30] do={/routing ospf network remove $i;}
add network=172.25.10.144/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicBarriOsonaNordST] do={/routing bgp peer remove $i;}
add name="VicBarriOsonaNordST" instance=default remote-address=172.25.10.145 remote-as=520 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_VicPalauBojonsST1" master-interface=wlan2 wds-address=00:1D:7D:38:F7:2F disabled=no
/ ip address add address=172.25.10.241/30 network=172.25.10.240 broadcast=172.25.10.243 interface=wds_VicPalauBojonsST1 disabled=no comment="wds_VicPalauBojonsST1"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicPalauBojonsST1] do={/routing ospf interface remove $i;}
add interface=wds_VicPalauBojonsST1
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.240/30] do={/routing ospf network remove $i;}
add network=172.25.10.240/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicPalauBojonsST1] do={/routing bgp peer remove $i;}
add name="VicPalauBojonsST1" instance=default remote-address=172.25.10.242 remote-as=9330 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 2 VicSeminariSud-JaumeI3
/interface wireless set wlan3 name="wlan3" \
radio-name="VicSeminariSud-JaumeI3" mode=ap-bridge ssid="guifi.net-VicSeminariSud-JaumeI3" \
band="5ghz-a" channel-width=20mhz \
frequency-mode=regulatory-domain country=spain antenna-gain=8 \
frequency=5640 \
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_VicLaCentral" master-interface=wlan3 wds-address=00:1D:7D:38:F4:BF disabled=no
/ ip address add address=172.25.11.6/30 network=172.25.11.4 broadcast=172.25.11.7 interface=wds_VicLaCentral disabled=no comment="wds_VicLaCentral"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicLaCentral] do={/routing ospf interface remove $i;}
add interface=wds_VicLaCentral
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.11.4/30] do={/routing ospf network remove $i;}
add network=172.25.11.4/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicLaCentral] do={/routing bgp peer remove $i;}
add name="VicLaCentral" instance=default remote-address=172.25.11.5 remote-as=11600 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_VicJaumeI3" master-interface=wlan3 wds-address=00:C0:CA:1D:89:5E disabled=no
/ ip address add address=172.25.11.13/30 network=172.25.11.12 broadcast=172.25.11.15 interface=wds_VicJaumeI3 disabled=no comment="wds_VicJaumeI3"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicJaumeI3] do={/routing ospf interface remove $i;}
add interface=wds_VicJaumeI3
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.11.12/30] do={/routing ospf network remove $i;}
add network=172.25.11.12/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicJaumeI3] do={/routing bgp peer remove $i;}
add name="VicJaumeI3" instance=default remote-address=172.25.11.14 remote-as=10639 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 3 VicSeminariSudAP5
/interface wireless set wlan4 name="wlan4" \
radio-name="VicSeminariSudAP5" mode=ap-bridge ssid="guifi.net-VicSeminariSudAP5" \
band="5ghz-a" channel-width=20mhz \
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.161.193/27"] do={remove $i}
/ ip address add address=10.138.161.193/27 network=10.138.161.192 broadcast=10.138.161.223 interface=wlan4 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.161.192/27] do={/routing bgp network remove $i;}
add network=10.138.161.192/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.161.192/27] do={/routing ospf network remove $i;}
add network=10.138.161.192/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.161.199-10.138.161.222
: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.161.192/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.161.192/27 gateway=10.138.161.193 domain=guifi.net comment=dhcp-wlan4
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.161.194 mac-address=00:15:6D:E8:E0:F2 client-id=VicSeminariInternRd1 server=dhcp-wlan4
add address=10.138.161.195 mac-address=00:15:6D:EB:ED:27 client-id=VicMarcSilvia server=dhcp-wlan4
add address=10.138.161.196 mac-address=00:15:6D:D2:56:96 client-id=VicMasSerraRd1 server=dhcp-wlan4
add address=10.138.161.197 mac-address=00:15:6D:E3:E4:03 client-id=VicClaudiaRd2 server=dhcp-wlan4
add address=10.138.161.198 mac-address=00:15:6D:F3:3C:4D client-id=VicIldefons1Nano5 server=dhcp-wlan4
add address=10.138.161.199 mac-address=00:15:6D:E8:DF:CD client-id=VicPfdezRd1 server=dhcp-wlan4
add address=10.138.161.200 mac-address=00:15:6D:F3:3C:3A client-id=VicDinaresRd1 server=dhcp-wlan4
add address=10.138.161.201 mac-address=00:15:6D:E7:8D:C9 client-id=VicSegalesRd1 server=dhcp-wlan4
add address=10.138.161.202 mac-address=00:15:6D:EB:ED:80 client-id=VicRbCarme37Rd1 server=dhcp-wlan4
add address=10.138.161.203 mac-address=00:15:6D:30:1A:6B client-id=VicBoujemaaRd1 server=dhcp-wlan4
add address=10.138.161.204 mac-address=00:15:6D:30:1A:5C client-id=VicAbdel29Rd1 server=dhcp-wlan4
add address=10.138.161.205 mac-address=00:0C:42:7B:32:7D client-id=VicMossenVilasis6Rd1 server=dhcp-wlan4
add address=10.138.161.206 mac-address=00:15:6D:3A:A5:13 client-id=VicEnricJJRd1 server=dhcp-wlan4
add address=10.138.161.207 mac-address=00:11:22:33:44:56 client-id=vicdamasoRd1 server=dhcp-wlan4
add address=10.138.161.208 mac-address=00:27:22:10:F9:CD client-id=VicJoanBauRd2 server=dhcp-wlan4
add address=10.138.161.209 mac-address=00:0C:42:88:9D:3F client-id=Vicoriolb server=dhcp-wlan4
add address=10.138.161.210 mac-address=00:0C:42:87:DE:D9 client-id=VicPlJoanAmades3Rd1 server=dhcp-wlan4
add address=10.138.161.211 mac-address=00:27:22:10:F9:CF client-id=VicJVilasisRd3 server=dhcp-wlan4
add address=10.138.161.212 mac-address=00:0C:42:84:4C:6D client-id=VicJordiEvaRd1 server=dhcp-wlan4
add address=10.138.161.213 mac-address=00:15:6D:F6:B7:5B client-id=VicIsabelARd2 server=dhcp-wlan4
add address=10.138.161.214 mac-address=00:27:22:10:F7:CB client-id=VicRA21Rd2 server=dhcp-wlan4
add address=10.138.161.215 mac-address=00:27:22:26:87:CA client-id=VicMVilaroRd1 server=dhcp-wlan4
add address=10.138.161.216 mac-address=00:27:22:1C:5D:B7 client-id=VicJoshuaRd1 server=dhcp-wlan4
add address=10.138.161.217 mac-address=00:0C:42:BD:7E:7B client-id=VcTnMrlsRd1 server=dhcp-wlan4
add address=10.138.161.218 mac-address=00:0C:42:BD:7E:7B client-id=GXAEstraguesRd1 server=dhcp-wlan4
add address=10.138.161.219 mac-address=00:0C:42:88:5A:79 client-id=VicTorreCaputxins24Rd1 server=dhcp-wlan4
add address=10.138.161.220 mac-address=00:0C:42:CE:8E:B9 client-id=vicnou40Rd1 server=dhcp-wlan4
add address=10.138.161.221 mac-address=00:0C:42:E5:92:7B client-id=VicNuriaRieraRd1 server=dhcp-wlan4
add address=10.138.161.222 mac-address=00:00:00:00:00:01 client-id=VicRamiRd2 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.200.48/29] do={/routing ospf network remove $i;}
add network=172.25.200.48/29 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicSeminariOest] do={/routing bgp peer remove $i;}
add name="VicSeminariOest" instance=default remote-address=172.25.200.49 remote-as=3 \
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.200.51/29"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.200.51/29 network=172.25.200.48 broadcast=172.25.200.55 interface=ether2 disabled=no comment="VicSeminariOest"
#
# 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.21.1 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.21.1 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=13 router-id=10.138.21.1 \
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.21.1 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 13-VicSeminariSud executed."
/