# Generat per a:
# RouterOSv2.9
:log info "Unsolclic for 3919-CallSerratST1 going to be executed."
#
# Configuration for RouterOS > 2.9.51 or 3.9
# Trasto: 3919-CallSerratST1
#
# WARNING: Beta version
#
# 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.-Fitxer importat:
# Desa aquesta "sortida" a un fitxer, després puja'l al router
# fent servir FTP amb un nom de l'estil "script_name.rsc".
# (note, l'extensió ".rsc" es un requisit)
# Executa el fitxer importat amb la comanda:
# > /import script_name
# 3.-Telnet copia i enganxar:
# Open a terminal session, and cut&paste this output
# directly on the terminal input.
#
# Notes:
# -routing-test package is required, 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=CallSerratST1
#
# DNS (client & server cache) zone: 2445
/ip dns set primary-dns=10.138.1.130 secondary-dns=10.138.25.68 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 2445
/system ntp client set enabled=yes mode=unicast primary-ntp=10.138.15.130
/system ntp server set manycast=no enabled=yes
: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="CallSerrat"
#
# 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 CallSerratST1-AP1
/interface wireless set wlan1 name="wlan1" \
radio-name="CallSerratST1-AP1" mode=ap-bridge ssid="guifi.net-CallSerratST1-AP1" \
band="2.4ghz-b" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=2412 \
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.1.193/27"] do={remove $i}
/ ip address add address=10.138.1.193/27 network=10.138.1.192 broadcast=10.138.1.223 interface=wLan/Lan 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.1.192/27] do={/routing ospf network remove $i;}
add network=10.138.1.192/27 area=backbone disabled=no
:delay 1
#
# DHCP
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.1.194 mac-address=00:16:E6:3C:95:AA client-id=VicTolosaBaix server=dhcp-wLan/Lan
add address=10.138.1.195 mac-address=00:16:01:0D:34:6A client-id=StEugniaCanCrusellasRadio1 server=dhcp-wLan/Lan
add address=10.138.1.196 mac-address=00:16:01:92:5F:86 client-id=CallAymerichRadio1 server=dhcp-wLan/Lan
add address=10.138.1.197 mac-address=ff:ff:ff:ff:ff:ff client-id=CalldetenesACasanyRadio1 server=dhcp-wLan/Lan
add address=10.138.1.198 mac-address=ff:ff:ff:ff:ff:ff client-id=CallJosep2 server=dhcp-wLan/Lan
add address=10.138.1.199 mac-address=ff:ff:ff:ff:ff:ff client-id=VicAlbertsenseRadio server=dhcp-wLan/Lan
add address=10.138.1.200 mac-address=00:16:01:AF:06:7A client-id=CallTorresRadio2 server=dhcp-wLan/Lan
add address=10.138.1.201 mac-address=00:1D:73:05:0A:68 client-id=CallVerdaguer38 server=dhcp-wLan/Lan
add address=10.138.1.202 mac-address=00:1E:E5:5B:58:42 client-id=CalldetenesXGallifaRadio1 server=dhcp-wLan/Lan
add address=10.138.1.203 mac-address=00:1D:0F:AF:40:D1 client-id=calldetenesRoviraRadio1 server=dhcp-wLan/Lan
add address=10.138.1.204 mac-address=00:1A:70:7B:5E:BD client-id=CalldetenesMasFarigoRadio1 server=dhcp-wLan/Lan
add address=10.138.1.205 mac-address=00:13:10:92:E0:60 client-id=MoliAltarribaRadio1 server=dhcp-wLan/Lan
add address=10.138.1.208 mac-address=00:1C:10:14:1B:C3 client-id=CalldetenesLluisPRadio1 server=dhcp-wLan/Lan
:foreach i in [/ip dhcp-server network find address="10.138.1.192/27"] do={/ip dhcp-server network remove $i;}
: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.1.214-10.138.1.222
/ip dhcp-server network add address=10.138.1.192/27 gateway=10.138.1.193 domain=guifi.net comment=dhcp-wLan/Lan
: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
#
: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 CallSerratST1-AP2
/interface wireless set wlan2 name="wlan2" \
radio-name="CallSerratST1-AP2" mode=ap-bridge ssid="guifi.net-CallSerratST1-AP2" \
band="2.4ghz-b" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=2432 \
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: HotSpot
#
# HotSpot
/interface wireless
:foreach i in [find name=hotspot2] do={remove $i}
add name="hotspot2" arp=enabled master-interface=wlan2 ssid="guifi.net-AccesObert" disabled="no"
/ip address
:foreach i in [find address="192.168.101.1/24"] do={remove $i}
/ip address add address=192.168.101.1/24 interface=hotspot2 disabled=no
/ip pool
:foreach i in [find name=hs-pool-101] do={remove $i}
add name="hs-pool-101" ranges=192.168.101.2-192.168.101.254
/ip dhcp-server
:foreach i in [find name=hs-dhcp-101] do={remove $i}
add name="hs-dhcp-101" interface=hotspot2 lease-time=1h address-pool=hs-pool-101 bootp-support=static authoritative=after-2sec-delay disabled=no
/ip dhcp-server network
:foreach i in [find address="192.168.101.0/24"] do={remove $i}
add address=192.168.101.0/24 gateway=192.168.101.1 domain=guifi.net comment=dhcp-1
/ip hotspot profile
:foreach i in [find name=hsprof2] do={remove $i}
add name="hsprof2" hotspot-address=192.168.101.1 dns-name="guests.guifi.net" html-directory=hotspot smtp-server=0.0.0.0 login-by=http-pap,trial split-user-domain=no trial-uptime=30m/1d trial-user-profile=default use-radius=no
/ip hotspot user profile
set default name="default" advertise-url=http://guifi.net/trespassos/
/ip hotspot
:foreach i in [find name=hotspot2] do={remove $i}
add name="hotspot2" interface=hotspot2 address-pool=hs-pool-101 profile=hsprof2 idle-timeout=5m keepalive-timeout=none addresses-per-mac=2 disabled=no
# end of HotSpot
:delay 1
#
# DHCP
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.1.194 mac-address=00:16:E6:3C:95:AA client-id=VicTolosaBaix server=dhcp-wLan/Lan
add address=10.138.1.195 mac-address=00:16:01:0D:34:6A client-id=StEugniaCanCrusellasRadio1 server=dhcp-wLan/Lan
add address=10.138.1.196 mac-address=00:16:01:92:5F:86 client-id=CallAymerichRadio1 server=dhcp-wLan/Lan
add address=10.138.1.197 mac-address=ff:ff:ff:ff:ff:ff client-id=CalldetenesACasanyRadio1 server=dhcp-wLan/Lan
add address=10.138.1.198 mac-address=ff:ff:ff:ff:ff:ff client-id=CallJosep2 server=dhcp-wLan/Lan
add address=10.138.1.199 mac-address=ff:ff:ff:ff:ff:ff client-id=VicAlbertsenseRadio server=dhcp-wLan/Lan
add address=10.138.1.200 mac-address=00:16:01:AF:06:7A client-id=CallTorresRadio2 server=dhcp-wLan/Lan
add address=10.138.1.201 mac-address=00:1D:73:05:0A:68 client-id=CallVerdaguer38 server=dhcp-wLan/Lan
add address=10.138.1.202 mac-address=00:1E:E5:5B:58:42 client-id=CalldetenesXGallifaRadio1 server=dhcp-wLan/Lan
add address=10.138.1.203 mac-address=00:1D:0F:AF:40:D1 client-id=calldetenesRoviraRadio1 server=dhcp-wLan/Lan
add address=10.138.1.204 mac-address=00:1A:70:7B:5E:BD client-id=CalldetenesMasFarigoRadio1 server=dhcp-wLan/Lan
add address=10.138.1.205 mac-address=00:13:10:92:E0:60 client-id=MoliAltarribaRadio1 server=dhcp-wLan/Lan
add address=10.138.1.208 mac-address=00:1C:10:14:1B:C3 client-id=CalldetenesLluisPRadio1 server=dhcp-wLan/Lan
:foreach i in [/ip dhcp-server network find address="10.138.1.192/27"] do={/ip dhcp-server network remove $i;}
: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.1.214-10.138.1.222
/ip dhcp-server network add address=10.138.1.192/27 gateway=10.138.1.193 domain=guifi.net comment=dhcp-wLan/Lan
: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
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.1.161/27"] do={remove $i}
/ ip address add address=10.138.1.161/27 network=10.138.1.160 broadcast=10.138.1.191 interface=wlan2 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.1.160/27] do={/routing ospf network remove $i;}
add network=10.138.1.160/27 area=backbone disabled=no
:delay 1
#
# DHCP
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.1.162 mac-address=00:18:39:C6:26:4A client-id=VicvilaroRadio server=dhcp-wlan2
add address=10.138.1.163 mac-address=68:08:07:01:06:73 client-id=VicAdoberies server=dhcp-wlan2
add address=10.138.1.165 mac-address=00:0F:66:37:34:79 client-id=CalldetenesDavidRadio1 server=dhcp-wlan2
add address=10.138.1.166 mac-address=00:18:F8:E5:FC:B9 client-id=CalldetenesGuitiRadio1 server=dhcp-wlan2
add address=10.138.1.167 mac-address=ff:ff:ff:ff:ff:ff client-id=CalldetenesEstelTRadio1 server=dhcp-wlan2
add address=10.138.1.168 mac-address=ff:ff:ff:ff:ff:ff client-id=VicPereMRadio1 server=dhcp-wlan2
add address=10.138.1.169 mac-address=00:16:01:84:5C:88 client-id=VicMartiGenisRadio1 server=dhcp-wlan2
add address=10.138.1.170 mac-address=00:16:01:0D:15:9E client-id=VicARCRadio0 server=dhcp-wlan2
add address=10.138.1.171 mac-address=00:1A:70:4F:04:5F client-id=VicMariolaRadio1 server=dhcp-wlan2
add address=10.138.1.172 mac-address=00:0F:66:F1:C4:28 client-id=vicmariageneclient server=dhcp-wlan2
add address=10.138.1.173 mac-address=00:1A:70:4E:DD:EA client-id=VicMatrixRadio1 server=dhcp-wlan2
add address=10.138.1.174 mac-address=ff:ff:ff:ff:ff:ff client-id=VicLaCallaRadio1 server=dhcp-wlan2
add address=10.138.1.175 mac-address=00:1A:70:64:A8:F2 client-id=CalldetenesPmauriRadio1 server=dhcp-wlan2
add address=10.138.1.176 mac-address=00:18:F8:F1:81:31 client-id=VicDosEstadiRadio1 server=dhcp-wlan2
add address=10.138.1.177 mac-address=ff:ff:ff:ff:ff:ff client-id=VicMiquelXic server=dhcp-wlan2
add address=10.138.1.178 mac-address=00:16:01:84:B2:74 client-id=VicSTLlatzerJoanRadio3 server=dhcp-wlan2
add address=10.138.1.179 mac-address=00:16:01:AD:AD:B6 client-id=VicMiquelAngelRadio1 server=dhcp-wlan2
add address=10.138.1.180 mac-address=00:1D:7E:55:5C:40 client-id=VicCano83 server=dhcp-wlan2
add address=10.138.1.181 mac-address=ff:ff:ff:ff:ff:ff client-id=VicImmaRadio1 server=dhcp-wlan2
add address=10.138.1.182 mac-address=ff:ff:ff:ff:ff:ff client-id=VicMatagalls server=dhcp-wlan2
add address=10.138.1.183 mac-address=ff:ff:ff:ff:ff:ff client-id=VicStLlatzerJACRadio1 server=dhcp-wlan2
add address=10.138.1.184 mac-address=00:16:01:B0:26:6C client-id=VicPilarARadio2 server=dhcp-wlan2
add address=10.138.1.185 mac-address=00:1C:10:36:7D:10 client-id=VicMustafaJRadio1 server=dhcp-wlan2
add address=10.138.1.186 mac-address=00:16:01:AF:46:32 client-id=VicStLlatzerMPRadio1 server=dhcp-wlan2
add address=10.138.1.187 mac-address=00:1D:7E:27:FC:10 client-id=CalldetenesMariaRadio1 server=dhcp-wlan2
add address=10.138.1.188 mac-address=00:1A:70:4F:42:6C client-id=VicStAnnasudRadio1 server=dhcp-wlan2
add address=10.138.1.189 mac-address=00:16:01:D1:64:15 client-id=VicSofianRadio1 server=dhcp-wlan2
add address=10.138.1.190 mac-address=00:80:48:4E:FF:96 client-id=VicSantLlatzerMarc server=dhcp-wlan2
:foreach i in [/ip dhcp-server network find address="10.138.1.160/27"] do={/ip dhcp-server network remove $i;}
:foreach i in [/ip pool find name=dhcp-wlan2] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan2 ranges=10.138.1.190-10.138.1.190
/ip dhcp-server network add address=10.138.1.160/27 gateway=10.138.1.161 domain=guifi.net comment=dhcp-wlan2
: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=yes
#
: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 CallSerratST1-AP3
/interface wireless set wlan3 name="wlan3" \
radio-name="CallSerratST1-AP3" mode=ap-bridge ssid="guifi.net-CallSerratST1-AP3" \
band="2.4ghz-b" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=2462 \
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.76.97/27"] do={remove $i}
/ ip address add address=10.138.76.97/27 network=10.138.76.96 broadcast=10.138.76.127 interface=wLan/Lan 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.76.96/27] do={/routing ospf network remove $i;}
add network=10.138.76.96/27 area=backbone disabled=no
:delay 1
#
# DHCP
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.76.98 mac-address=00:16:01:4D:B0:EE client-id=CalldetenesMarcRadio1 server=dhcp-wLan/Lan
add address=10.138.76.99 mac-address=00:0B:6B:2C:3A:3F client-id=CallJVilaRadio2 server=dhcp-wLan/Lan
add address=10.138.76.100 mac-address=00:14:BF:D2:70:A4 client-id=CallJosep server=dhcp-wLan/Lan
add address=10.138.76.101 mac-address=00:18:F8:BD:74:FF client-id=CallManel server=dhcp-wLan/Lan
add address=10.138.76.102 mac-address=00:0D:0B:FD:61:10 client-id=CallRoserTarres server=dhcp-wLan/Lan
add address=10.138.76.103 mac-address=00:18:F8:BD:75:14 client-id=FolFerragutWRT server=dhcp-wLan/Lan
add address=10.138.76.104 mac-address=00:1A:70:47:B8:6D client-id=CalldetenesVilaCapdeRadio1 server=dhcp-wLan/Lan
add address=10.138.76.105 mac-address=00:12:17:07:53:A1 client-id=Callxevi server=dhcp-wLan/Lan
add address=10.138.76.106 mac-address=ff:ff:ff:ff:ff:ff client-id=VicSantLlatzerMFCRadio1 server=dhcp-wLan/Lan
add address=10.138.76.107 mac-address=00:1A:70:4E:F1:C3 client-id=CalldetenesJPortetRadio1 server=dhcp-wLan/Lan
add address=10.138.76.108 mac-address=00:13:10:92:72:6E client-id=VicMossenserRadio1 server=dhcp-wLan/Lan
add address=10.138.76.109 mac-address=ff:ff:ff:ff:ff:ff client-id=CalldetenesRicardoRadio3 server=dhcp-wLan/Lan
add address=10.138.76.110 mac-address=ff:ff:ff:ff:ff:ff client-id=CalldetenesBalmesRadio1 server=dhcp-wLan/Lan
add address=10.138.76.111 mac-address=00:1C:10:13:98:47 client-id=VicJoanGuifiRadio1 server=dhcp-wLan/Lan
add address=10.138.76.114 mac-address=00:1C:10:13:B0:29 client-id=CalaMonicaRadio1 server=dhcp-wLan/Lan
add address=10.138.76.115 mac-address=16:01:AE:EB:A6:2D client-id=CalldetenesPoncRadio2 server=dhcp-wLan/Lan
add address=10.138.76.116 mac-address=00:1C:10:13:98:F2 client-id=VicCristianRadio1 server=dhcp-wLan/Lan
add address=10.138.76.117 mac-address=00:16:01:AF:22:62 client-id=VicGaltesRadio2 server=dhcp-wLan/Lan
add address=10.138.76.118 mac-address=00:16:01:AF:00:02 client-id=VicPosadaRadio1 server=dhcp-wLan/Lan
add address=10.138.76.119 mac-address=00:16:01:AF:F5:97 client-id=callToniRadio1 server=dhcp-wLan/Lan
add address=10.138.76.120 mac-address=00:16:01:AE:F0:43 client-id=CallcaltoniRadio1 server=dhcp-wLan/Lan
add address=10.138.76.121 mac-address=00:16:01:AE:F1:E6 client-id=vicsthilariRadio1 server=dhcp-wLan/Lan
add address=10.138.76.122 mac-address=00:1D:7E:28:15:03 client-id=CalldetenesGonzalezRadio1 server=dhcp-wLan/Lan
add address=10.138.76.123 mac-address=00:1C:10:36:7F:17 client-id=CalldetenesCarolaRadio1 server=dhcp-wLan/Lan
add address=10.138.76.124 mac-address=00:1D:7E:4B:57:60 client-id=VicStHilariLopezRadio3 server=dhcp-wLan/Lan
add address=10.138.76.125 mac-address=00:1C:10:36:4A:F4 client-id=VicMiquelCRadio1 server=dhcp-wLan/Lan
add address=10.138.76.126 mac-address=00:0B:6B:2C:37:B6 client-id=VicSuaresRadio1 server=dhcp-wLan/Lan
:foreach i in [/ip dhcp-server network find address="10.138.76.96/27"] do={/ip dhcp-server network remove $i;}
: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.76.126-10.138.76.126
/ip dhcp-server network add address=10.138.76.96/27 gateway=10.138.76.97 domain=guifi.net comment=dhcp-wLan/Lan
: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=yes
#
: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
#
# Routed device
#
# Altres connexions de cable
/ 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.3.24/30] do={/routing ospf network remove $i;}
add network=172.25.3.24/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=CallSerratST2] do={/routing bgp peer remove $i;}
add name="CallSerratST2" instance=default remote-address=172.25.3.25 remote-as=3920 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=yes
:foreach i in [/ip address find address="172.25.3.26/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.3.26/30 network=172.25.3.24 broadcast=172.25.3.27 interface=ether2 disabled=no comment="CallSerratST2"
#
# Internal addresses NAT
:foreach i in [/ip firewall nat find src-address="172.25.0.0/16"] 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.76.97 to-ports=0-65535 comment="" disabled=no
add chain=srcnat src-address="172.25.0.0/16" dst-address=!172.25.0.0/16 protocol=!ospf action=src-nat to-addresses=10.138.76.97 to-ports=0-65535 comment="" disabled=no
#
# Enrutament BGP
# Filtres BGP i OSPF
: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;}
/ routing filter
add chain=ospf-out prefix=10.0.0.0/8 prefix-length=8-32 invert-match=no action=accept comment="" disabled=no
add chain=ospf-out invert-match=no action=discard comment="" disabled=no
add chain=ospf-in prefix=10.0.0.0/8 prefix-length=8-32 invert-match=no action=accept comment="" disabled=no
add chain=ospf-in invert-match=no action=reject comment="" disabled=no
#
# Instància BGP
/ routing bgp instance
set default name="default" as=3919 router-id=10.138.76.97 redistribute-static=yes \
redistribute-connected=yes redistribute-rip=yes redistribute-ospf=yes \
redistribute-other-bgp=yes out-filter=ospf-out \
client-to-client-reflection=yes comment="" disabled=no
#
# Enrutament OSPF
/routing ospf set router-id=10.138.76.97 redistribute-connected=as-type-1 redistribute-static=as-type-1 redistribute-bgp=as-type-1
#
:log info "Unsolclic for 3919-CallSerratST1 executed."
/