# Generat per a:
# RouterOSv6.x
:log info "Unsolclic for 37644-SevaResi750UP going to be executed."
#
# Configuration for RouterOSv6.x
# Device: 37644-SevaResi750UP
#
# 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 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=SevaResi750UP
#
# DNS (client & server cache) zone: 2467
/ip dns set servers=10.138.0.2,10.138.23.34 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 2467
/system ntp client set enabled=yes mode=unicast primary-ntp=10.138.0.2 secondary-ntp=10.138.23.34
:delay 1
#
# Bandwidth-server
/ tool bandwidth-server set enabled=yes authenticate=no allocate-udp-ports-from=2000
#
# SNMP
/snmp community set public addresses=10.0.0.0/8
/snmp set contact="guifi@guifi.net" enabled=yes location="SevaResidencia" trap-community=public
#
# Guest user
/user
:foreach i in [find group=read] do={/user remove $i;}
add name="guest" group=read address=10.0.0.0/8 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 SevaResidenciaAP5N
/interface wireless set wlan1 name="wlan1" \
radio-name="SevaResidenciaAP5N" mode=ap-bridge ssid="guifi.net-SevaResidenciaAP5N" \
band="5ghz-a" channel-width=20mhz \
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: wdsSevaResidenciaAP5N
# 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
# Type: wLan/Lan
/ip address
:foreach i in [find address="10.138.17.33/27"] do={remove $i}
/ ip address add address=10.138.17.33/27 network=10.138.17.32 broadcast=10.138.17.63 interface=wLan/Lan disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.17.32/27] do={/routing bgp network remove $i;}
add network=10.138.17.32/27 synchronize=no 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.17.32/27] do={/routing ospf network remove $i;}
add network=10.138.17.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.17.39-10.138.17.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.17.32/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.17.32/27 gateway=10.138.17.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.17.34 mac-address=4C:5E:0C:54:28:5A client-id=SevaGustavoRd2 server=dhcp-wLan/Lan
add address=10.138.17.35 mac-address=00:00:00:00:00:00 client-id=SvPdrt3Rd1 server=dhcp-wLan/Lan
add address=10.138.17.36 mac-address=64:D1:54:BF:45:8F client-id=SevaPlanxisteriaSevaRd1 server=dhcp-wLan/Lan
add address=10.138.17.37 mac-address=00:00:00:00:00:01 client-id=SevaMartiRd1 server=dhcp-wLan/Lan
add address=10.138.17.38 mac-address=00:0C:42:F1:B3:70 client-id=SevaGuardeBressolRd1 server=dhcp-wLan/Lan
add address=10.138.17.39 mac-address=D4:CA:6D:B9:C6:6F client-id=SevaCanMugaRd1 server=dhcp-wLan/Lan
add address=10.138.17.40 mac-address=00:00:00:00:00:00 client-id=SvMntmnyRd1 server=dhcp-wLan/Lan
add address=10.138.17.41 mac-address=D4:CA:6D:C0:6A:BF client-id=SevaJTioRd1 server=dhcp-wLan/Lan
add address=10.138.17.42 mac-address=00:0C:42:F6:8C:A6 client-id=SevaGeniRd1 server=dhcp-wLan/Lan
add address=10.138.17.43 mac-address=4C:5E:0C:EA:60:BB client-id=SevaDolrosQRd1 server=dhcp-wLan/Lan
add address=10.138.17.44 mac-address=00:00:00:00:00:00 client-id=SevaAJ1100 server=dhcp-wLan/Lan
add address=10.138.17.45 mac-address=D4:CA:6D:C0:62:2F client-id=SevaCarrerNordRd1 server=dhcp-wLan/Lan
add address=10.138.17.46 mac-address=00:0C:42:F6:85:D8 client-id=SevaEulaliaPlaRd1 server=dhcp-wLan/Lan
add address=10.138.17.47 mac-address=00:0C:42:F7:A0:2D client-id=SevaAnnaTeis server=dhcp-wLan/Lan
add address=10.138.17.48 mac-address=D4:CA:6D:6D:C7:03 client-id=SevaMVilaRd1 server=dhcp-wLan/Lan
add address=10.138.17.49 mac-address=00:0C:42:CE:A2:AB client-id=SevaEvaiXeviRd1 server=dhcp-wLan/Lan
add address=10.138.17.50 mac-address=D4:CA:6D:5C:A2:C7 client-id=SevaEvaSRd2 server=dhcp-wLan/Lan
add address=10.138.17.51 mac-address=00:00:00:00:00:00 client-id=SvSrrdlRd1 server=dhcp-wLan/Lan
add address=10.138.17.52 mac-address=D4:CA:6D:8C:D2:38 client-id=SevaKarlesRd1 server=dhcp-wLan/Lan
add address=10.138.17.53 mac-address=D4:CA:6D:6D:B6:70 client-id=SevaOlgaPuigRd1 server=dhcp-wLan/Lan
add address=10.138.17.54 mac-address=D4:CA:6D:8B:FD:45 client-id=sevaenriRd1 server=dhcp-wLan/Lan
add address=10.138.17.55 mac-address=D4:CA:6D:4E:C8:61 client-id=SevaDavidGRd1 server=dhcp-wLan/Lan
add address=10.138.17.56 mac-address=D4:CA:6D:B9:D5:11 client-id=SevaCanCanalsRd1 server=dhcp-wLan/Lan
add address=10.138.17.57 mac-address=00:00:00:00:00:00 client-id=SevaMecanitzats2Rd1 server=dhcp-wLan/Lan
add address=10.138.17.58 mac-address=D4:CA:6D:C5:70:89 client-id=SevaPilarRd1 server=dhcp-wLan/Lan
add address=10.138.17.59 mac-address=D4:CA:6D:D0:40:3B client-id=SevaMonmanyRd1 server=dhcp-wLan/Lan
add address=10.138.17.60 mac-address=00:00:00:00:00:00 client-id=SEVAFERRANRd1 server=dhcp-wLan/Lan
add address=10.138.17.61 mac-address=4C:5E:0C:2D:3E:E3 client-id=SevaEsteveARd3 server=dhcp-wLan/Lan
add address=10.138.17.62 mac-address=00:00:00:00:00:00 client-id=SevaGallifaRd1 server=dhcp-wLan/Lan
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.140.132.33/27"] do={remove $i}
/ ip address add address=10.140.132.33/27 network=10.140.132.32 broadcast=10.140.132.63 interface=wlan1 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.140.132.32/27] do={/routing bgp network remove $i;}
add network=10.140.132.32/27 synchronize=no 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.140.132.32/27] do={/routing ospf network remove $i;}
add network=10.140.132.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.140.132.39-10.140.132.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.140.132.32/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.140.132.32/27 gateway=10.140.132.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.17.158 mac-address=00:00:00:00:00:00 client-id=SMBLMtllRd1 server=dhcp-wlan1
add address=10.140.132.34 mac-address=4C:5E:0C:58:98:7E client-id=SevaQuioscRd1 server=dhcp-wlan1
add address=10.140.132.35 mac-address=99:99:99:99:99:99 client-id=SevaJoanARd1 server=dhcp-wlan1
add address=10.140.132.36 mac-address=00:0C:42:C8:EB:1B client-id=SevaALunaRd1 server=dhcp-wlan1
add address=10.140.132.37 mac-address=4C:5E:0C:FD:13:6E client-id=SevaOlgaMRd1 server=dhcp-wlan1
add address=10.140.132.38 mac-address=00:0C:42:8F:33:A2 client-id=SevaNuriaiDavidRd1 server=dhcp-wlan1
add address=10.140.132.39 mac-address=4C:5E:0C:30:C2:14 client-id=SevaBoletsRd1 server=dhcp-wlan1
add address=10.140.132.40 mac-address=4C:5E:0C:54:28:65 client-id=SevaPedroZRd1 server=dhcp-wlan1
add address=10.140.132.41 mac-address=4C:5E:0C:A4:1E:63 client-id=SevaGXRd1 server=dhcp-wlan1
add address=10.140.132.42 mac-address=00:00:00:00:00:00 client-id=SevaMaya server=dhcp-wlan1
add address=10.140.132.43 mac-address=00:00:00:00:00:00 client-id=SevaMentaRd1 server=dhcp-wlan1
add address=10.140.132.44 mac-address=00:00:00:00:00:00 client-id=SevaAndreuRd1 server=dhcp-wlan1
add address=10.140.132.45 mac-address=E4:8D:8C:DB:7A:ED client-id=SevaSilviaRd1 server=dhcp-wlan1
add address=10.140.132.46 mac-address=E4:8D:8C:70:5F:E9 client-id=SevaLluisAlzamoraRd1 server=dhcp-wlan1
add address=10.140.132.47 mac-address=00:00:00:00:00:00 client-id=SvRctr2Rd1 server=dhcp-wlan1
add address=10.140.132.48 mac-address=00:00:00:00:00:00 client-id=SevaNuriaRoca server=dhcp-wlan1
add address=10.140.132.49 mac-address=99:99:99:99:99:99 client-id=SevaRocada7ClaraRd1 server=dhcp-wlan1
add address=10.140.132.50 mac-address=00:00:00:00:00:00 client-id=SvJcntVrdgr10Rd1 server=dhcp-wlan1
add address=10.140.132.51 mac-address=64:D1:54:35:66:3A client-id=SevaGaRd2 server=dhcp-wlan1
add address=10.140.132.52 mac-address=00:00:00:00:00:00 client-id=SvNrd4Rd1 server=dhcp-wlan1
add address=10.140.132.53 mac-address=00:00:00:00:00:00 client-id=SvCrrrDlt10Rd1 server=dhcp-wlan1
add address=10.140.132.54 mac-address=CC:2D:E0:66:9F:F7 client-id=SvRfgtsRd1 server=dhcp-wlan1
add address=10.140.132.55 mac-address=00:00:00:00:00:00 client-id=SevaBarbaraRd1 server=dhcp-wlan1
add address=10.140.132.56 mac-address=00:00:00:00:00:00 client-id=SvBx23Rd1 server=dhcp-wlan1
add address=10.140.132.57 mac-address=00:00:00:00:00:00 client-id=SvJspPl44Rd1 server=dhcp-wlan1
add address=10.140.132.58 mac-address=00:00:00:00:00:00 client-id=SvBrgdRd1 server=dhcp-wlan1
add address=10.140.132.59 mac-address=00:00:00:00:00:00 client-id=SevaCorredor6Rd1 server=dhcp-wlan1
add address=10.140.132.60 mac-address=00:00:00:00:00:00 client-id=Sv11StmbrBx3Rd1 server=dhcp-wlan1
add address=10.140.132.61 mac-address=00:00:00:00:00:00 client-id=SevaCarletsRd1 server=dhcp-wlan1
add address=10.140.132.62 mac-address=00:0C:42:8F:32:AD client-id=SevaIreneRd1 server=dhcp-wlan1
#
:delay 1
#
# Radio#: 1 SevaResi-Apartments
/interface wireless set wlan2 name="wlan2" \
radio-name="SevaResi-Apartments" mode=ap-bridge ssid="guifi.net-SevaResi-Apartments" \
band="5ghz-a" channel-width=20mhz \
frequency-mode=regulatory-domain country=spain antenna-gain=16 \
frequency=5300 \
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: wdsSevaResi-Apartments
# 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_SevaApartamentsST" master-interface=wlan2 wds-address=00:0C:42:CD:48:7D disabled=no
/ ip address add address=172.25.3.57/29 network=172.25.3.56 broadcast=172.25.3.63 interface=wds_SevaApartamentsST disabled=no comment="wds_SevaApartamentsST"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_SevaApartamentsST] do={/routing ospf interface remove $i;}
add interface=wds_SevaApartamentsST
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.3.56/29] do={/routing ospf network remove $i;}
add network=172.25.3.56/29 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=SevaApartamentsST] do={/routing bgp peer remove $i;}
add name="SevaApartamentsST" instance=default remote-address=172.25.3.59 remote-as=17730 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_BrullPinar750UP" master-interface=wlan2 wds-address=D4:CA:6D:8B:CB:82 disabled=no
/ ip address add address=172.25.6.188/29 network=172.25.6.184 broadcast=172.25.6.191 interface=wds_BrullPinar750UP disabled=no comment="wds_BrullPinar750UP"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_BrullPinar750UP] do={/routing ospf interface remove $i;}
add interface=wds_BrullPinar750UP
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.6.184/29] do={/routing ospf network remove $i;}
add network=172.25.6.184/29 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=BrullPinar750UP] do={/routing bgp peer remove $i;}
add name="BrullPinar750UP" instance=default remote-address=172.25.6.185 remote-as=54646 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 2 SevaResi-Polivalent
/interface wireless set wlan3 name="wlan3" \
radio-name="SevaResi-Polivalent" mode=ap-bridge ssid="guifi.net-SevaResi-Polivalent" \
band="5ghz-a" channel-width=20mhz \
frequency-mode=regulatory-domain country=spain antenna-gain=16 \
frequency=5500 \
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: wdsSevaResi-Polivalent
# 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_SevaPolivalentRB750UP" master-interface=wlan3 wds-address=00:00:00:00:00:00 disabled=no
/ ip address add address=172.25.3.241/29 network=172.25.3.240 broadcast=172.25.3.247 interface=wds_SevaPolivalentRB750UP disabled=no comment="wds_SevaPolivalentRB750UP"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_SevaPolivalentRB750UP] do={/routing ospf interface remove $i;}
add interface=wds_SevaPolivalentRB750UP
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.3.240/29] do={/routing ospf network remove $i;}
add network=172.25.3.240/29 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=SevaPolivalentRB750UP] do={/routing bgp peer remove $i;}
add name="SevaPolivalentRB750UP" instance=default remote-address=172.25.3.244 remote-as=40530 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 3 SevaResi-Pibatlle
/interface wireless set wlan4 name="wlan4" \
radio-name="SevaResi-Pibatlle" mode=ap-bridge ssid="guifi.net-SevaResi-Pibatlle" \
band="5ghz-a" channel-width=20mhz \
frequency-mode=regulatory-domain country=spain antenna-gain=25 \
frequency=5600 \
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: wdsSevaResi-Pibatlle
# Remove all existing wds interfaces
:foreach i in [/interface wireless wds find master-interface=wlan4] \
do={:foreach n in [/interface wireless wds get $i name] \
do={:foreach inum in [/ip address find interface=$n] \
do={/ip address remove $inum;};}; \
/interface wireless wds remove $i;}
/ interface wireless wds
add name="wds_SevaPibatlleRB" master-interface=wlan4 wds-address=00:0C:42:72:2E:4A disabled=no
/ ip address add address=172.25.3.177/29 network=172.25.3.176 broadcast=172.25.3.183 interface=wds_SevaPibatlleRB disabled=no comment="wds_SevaPibatlleRB"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_SevaPibatlleRB] do={/routing ospf interface remove $i;}
add interface=wds_SevaPibatlleRB
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.3.176/29] do={/routing ospf network remove $i;}
add network=172.25.3.176/29 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=SevaPibatlleRB] do={/routing bgp peer remove $i;}
add name="SevaPibatlleRB" instance=default remote-address=172.25.3.180 remote-as=40274 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Routed device
#
# Altres connexions de cable
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=Lan/Lan] do={/routing ospf interface remove $i;}
add interface=Lan/Lan
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.17.144/28] do={/routing ospf network remove $i;}
add network=10.138.17.144/28 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=SevaResiApartaments] do={/routing bgp peer remove $i;}
add name="SevaResiApartaments" instance=default remote-address=10.138.17.146 remote-as=37646 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=Lan/Lan] do={/routing ospf interface remove $i;}
add interface=Lan/Lan
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.17.144/28] do={/routing ospf network remove $i;}
add network=10.138.17.144/28 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=SevaResiPolivalent] do={/routing bgp peer remove $i;}
add name="SevaResiPolivalent" instance=default remote-address=10.138.17.147 remote-as=37648 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=Lan/Lan] do={/routing ospf interface remove $i;}
add interface=Lan/Lan
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.17.144/28] do={/routing ospf network remove $i;}
add network=10.138.17.144/28 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=SevaResiPibatlle] do={/routing bgp peer remove $i;}
add name="SevaResiPibatlle" instance=default remote-address=10.138.17.148 remote-as=37649 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=Lan/Lan] do={/routing ospf interface remove $i;}
add interface=Lan/Lan
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.17.144/28] do={/routing ospf network remove $i;}
add network=10.138.17.144/28 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=SevaResiOmniAP5N] do={/routing bgp peer remove $i;}
add name="SevaResiOmniAP5N" instance=default remote-address=10.138.17.149 remote-as=37651 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=Lan/Lan] do={/routing ospf interface remove $i;}
add interface=Lan/Lan
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.17.144/28] do={/routing ospf network remove $i;}
add network=10.138.17.144/28 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=SevaResiReservatAJ1100] do={/routing bgp peer remove $i;}
add name="SevaResiReservatAJ1100" instance=default remote-address=10.138.17.150 remote-as=37652 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=Lan/Lan] do={/routing ospf interface remove $i;}
add interface=Lan/Lan
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.17.144/28] do={/routing ospf network remove $i;}
add network=10.138.17.144/28 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=SevaResiinterior] do={/routing bgp peer remove $i;}
add name="SevaResiinterior" instance=default remote-address=10.138.17.151 remote-as=64336 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=Lan/Lan] do={/routing ospf interface remove $i;}
add interface=Lan/Lan
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.17.144/28] do={/routing ospf network remove $i;}
add network=10.138.17.144/28 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=SevaResiBrullPinar] do={/routing bgp peer remove $i;}
add name="SevaResiBrullPinar" instance=default remote-address=10.138.17.152 remote-as=68212 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=Lan/Lan] do={/routing ospf interface remove $i;}
add interface=Lan/Lan
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.17.144/28] do={/routing ospf network remove $i;}
add network=10.138.17.144/28 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=SevaResiDependencies] do={/routing bgp peer remove $i;}
add name="SevaResiDependencies" instance=default remote-address=10.138.17.153 remote-as=68537 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
:foreach i in [/ip address find address="10.138.17.145/28"] do={/ip address remove $i;}
:delay 1
/ ip address add address=10.138.17.145/28 network=10.138.17.144 broadcast=10.138.17.159 interface=Lan/Lan disabled=no comment="SevaResiApartaments,SevaResiPolivalent,SevaResiPibatlle,SevaResiOmniAP5N,SevaResiReservatAJ1100,SevaResiinterior,SevaResiBrullPinar,SevaResiDependencies"
#
# 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.17.33 comment="" disabled=no
#
# Enrutament BGP
# 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 chain=ebgp-in comment="0. Set ebgp-in preferred source." set-pref-src="10.138.17.33" disabled=no
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 set-pref-src="10.138.17.33"
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
#
# Instància BGP
/ routing bgp instance
set default name="default" as=37644 router-id=10.138.17.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
#
# Enrutament OSPF
/routing ospf instance set default name=default router-id=10.138.17.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 37644-SevaResi750UP executed."
/