# Generat per a:
# RouterOSv2.9
:log info "Unsolclic for 1939-AlpDiposit-ST1 going to be executed."
#
# Configuration for RouterOS > 2.9.51 or 3.x
# Trasto: 1939-AlpDiposit-ST1
#
# ATENCIÓ: Versió Beta
#
# 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=AlpDiposit-ST1
#
# DNS (client & server cache) zone: 3607
/ip dns set primary-dns=10.138.120.66 secondary-dns=10.138.42.3 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 3607
/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="AlpDip"
#
# 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 AlpDipAP-SudEst
/interface wireless set wlan1 name="wlan1" \
radio-name="AlpDipAP-SudEst" mode=ap-bridge ssid="guifi.net-AlpDipAP-SudEst" \
band="2.4ghz-b" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=2422 \
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.3.1/27"] do={remove $i}
/ ip address add address=10.138.3.1/27 network=10.138.3.0 broadcast=10.138.3.31 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.3.0/27] do={/routing ospf network remove $i;}
add network=10.138.3.0/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.3.2 mac-address=00:16:B6:DA:11:F9 client-id=AlpensCentreNTRadio1 server=dhcp-wLan/Lan
add address=10.138.3.3 mac-address=00:16:B6:D9:EA:8E client-id=AlpgavarresaRadio1 server=dhcp-wLan/Lan
add address=10.138.3.4 mac-address=00:18:39:AE:45:95 client-id=AlpensJIborraBRadio1 server=dhcp-wLan/Lan
add address=10.138.3.5 mac-address=ff:ff:ff:ff:ff:ff client-id=AlpensJSabartesRadio1 server=dhcp-wLan/Lan
add address=10.138.3.6 mac-address=00:18:39:AE:45:98 client-id=AlpensJAntigasRadio1 server=dhcp-wLan/Lan
add address=10.138.3.7 mac-address=ff:ff:ff:ff:ff:ff client-id=NodeTraveriaRadio1 server=dhcp-wLan/Lan
add address=10.138.3.8 mac-address=00:16:B6:39:8E:92 client-id=AlpensSati server=dhcp-wLan/Lan
add address=10.138.3.9 mac-address=00:16:B6:39:7D:7B client-id=AlpensABenitoRadio1 server=dhcp-wLan/Lan
add address=10.138.3.10 mac-address=00:18:F8:F1:F3:4F client-id=AlpensJCrespoRadio1 server=dhcp-wLan/Lan
add address=10.138.3.11 mac-address=00:16:B6:39:8E:91 client-id=AlpensDGarciaRadio1 server=dhcp-wLan/Lan
add address=10.138.3.12 mac-address=00:16:01:F2:3C:16 client-id=AlpensMasAnfrunsRadio1 server=dhcp-wLan/Lan
add address=10.138.3.13 mac-address=00:16:B6:34:7D:72 client-id=AlpensDGraellRadio2 server=dhcp-wLan/Lan
add address=10.138.3.14 mac-address=00:16:B6:39:7D:8A client-id=AlpensJCastanyRadio1 server=dhcp-wLan/Lan
add address=10.138.3.15 mac-address=00:16:B6:39:7D:90 client-id=AlpensFPardoRadio1 server=dhcp-wLan/Lan
add address=10.138.3.16 mac-address=00:16:B6:39:7D:93 client-id=AlpensJCruellsRadio1 server=dhcp-wLan/Lan
add address=10.138.3.17 mac-address=00:16:B6:39:7D:A2 client-id=AlpensJTorrentsRadio1 server=dhcp-wLan/Lan
add address=10.138.3.18 mac-address=00:16:B6:39:7D:9F client-id=AlpensJVinyesRadio1 server=dhcp-wLan/Lan
add address=10.138.3.19 mac-address=00:16:B6:39:8F:BA client-id=AlpensLPratRadio1 server=dhcp-wLan/Lan
add address=10.138.3.20 mac-address=00:16:B6:39:8F:C6 client-id=AlpensSSabariegoRadio1 server=dhcp-wLan/Lan
add address=10.138.3.21 mac-address=00:16:B6:39:8F:C3 client-id=AlpensSSerraRadio1 server=dhcp-wLan/Lan
add address=10.138.3.22 mac-address=00:16:B6:39:8F:CF client-id=AlpensXFisasRadio1 server=dhcp-wLan/Lan
add address=10.138.3.23 mac-address=ff:ff:ff:ff:ff:ff client-id=AlpensAntigasRadio1 server=dhcp-wLan/Lan
add address=10.138.3.24 mac-address=00:16:B6:39:7D:81 client-id=AlpensSCampsRadio1 server=dhcp-wLan/Lan
add address=10.138.3.25 mac-address=ff:ff:ff:ff:ff:ff client-id=AlpensPlaRadio1 server=dhcp-wLan/Lan
add address=10.138.3.26 mac-address=ff:ff:ff:ff:ff:ff client-id=AlpensToniBetRadio1 server=dhcp-wLan/Lan
add address=10.138.3.27 mac-address=00:18:39:AE:45:9E client-id=AlpensMCobaaRadio1 server=dhcp-wLan/Lan
add address=10.138.3.28 mac-address=00:18:39:AE:45:8C client-id=AlpensMRSolaRadio1 server=dhcp-wLan/Lan
add address=10.138.3.29 mac-address=00:1D:7E:FB:A3:0C client-id=AlpensCasinoRadio1 server=dhcp-wLan/Lan
add address=10.138.3.30 mac-address=00:18:39:AE:45:8F client-id=AlpensXAugeRadio1 server=dhcp-wLan/Lan
:foreach i in [/ip dhcp-server network find address="10.138.3.0/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.3.30-10.138.3.30
/ip dhcp-server network add address=10.138.3.0/27 gateway=10.138.3.1 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: wLan
/ip address
:foreach i in [find address="10.138.3.65/27"] do={remove $i}
/ ip address add address=10.138.3.65/27 network=10.138.3.64 broadcast=10.138.3.95 interface=wlan1 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.3.64/27] do={/routing ospf network remove $i;}
add network=10.138.3.64/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.3.66 mac-address=00:1D:7E:55:5D:63 client-id=AlpensCalReiRadio1 server=dhcp-wlan1
:foreach i in [/ip dhcp-server network find address="10.138.3.64/27"] do={/ip dhcp-server network remove $i;}
:foreach i in [/ip pool find name=dhcp-wlan1] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan1 ranges=10.138.3.72-10.138.3.94
/ip dhcp-server network add address=10.138.3.64/27 gateway=10.138.3.65 domain=guifi.net comment=dhcp-wlan1
: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
#
: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 AlpDipAP-SudOest
/interface wireless set wlan2 name="wlan2" \
radio-name="AlpDipAP-SudOest" mode=ap-bridge ssid="guifi.net-AlpDipAP-SudOest" \
band="2.4ghz-b" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=2472 \
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.3.33/27"] do={remove $i}
/ ip address add address=10.138.3.33/27 network=10.138.3.32 broadcast=10.138.3.63 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.3.32/27] do={/routing ospf network remove $i;}
add network=10.138.3.32/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.3.34 mac-address=00:18:39:AE:45:9B client-id=AlpensMCastroRadio2 server=dhcp-wlan2
add address=10.138.3.35 mac-address=00:0F:66:5B:13:52 client-id=AlpensDamiRadio1 server=dhcp-wlan2
add address=10.138.3.36 mac-address=00:18:F8:F1:B5:75 client-id=AlpensMSolerRadio1 server=dhcp-wlan2
add address=10.138.3.37 mac-address=00:16:01:12:E1:A4 client-id=AlpensXQTRadio1 server=dhcp-wlan2
add address=10.138.3.38 mac-address=ff:ff:ff:ff:ff:ff client-id=AlpensPlacetaRadio1 server=dhcp-wlan2
add address=10.138.3.39 mac-address=ff:ff:ff:ff:ff:ff client-id=AlpensRogerRadio1 server=dhcp-wlan2
add address=10.138.3.40 mac-address=ff:ff:ff:ff:ff:ff client-id=AlpensRocadepenaRadio1 server=dhcp-wlan2
add address=10.138.3.41 mac-address=00:16:01:10:29:26 client-id=AlpensSebastiaRadio1 server=dhcp-wlan2
add address=10.138.3.42 mac-address=ff:ff:ff:ff:ff:ff client-id=AlpensJSanchezRadio1 server=dhcp-wlan2
add address=10.138.3.43 mac-address=00:16:B6:D9:1D:77 client-id=alpmagiRadio1 server=dhcp-wlan2
add address=10.138.3.44 mac-address=00:18:F8:F1:F3:70 client-id=AlpensCasalMunicipalRadio1 server=dhcp-wlan2
add address=10.138.3.45 mac-address=00:16:B6:39:8E:8B client-id=AlpensRSoleRadio1 server=dhcp-wlan2
add address=10.138.3.46 mac-address=00:16:B6:39:8E:88 client-id=AlpensEmbCasaCruellsRadio1 server=dhcp-wlan2
add address=10.138.3.47 mac-address=00:16:B6:39:7D:87 client-id=AlpensAPratVRadio1 server=dhcp-wlan2
add address=10.138.3.48 mac-address=00:16:B6:39:7D:84 client-id=AlpensCalPeretCaiRadio1 server=dhcp-wlan2
add address=10.138.3.49 mac-address=00:16:B6:39:7D:78 client-id=AlpensCalVilamalaRadio1 server=dhcp-wlan2
add address=10.138.3.50 mac-address=00:16:B6:39:7D:6F client-id=AlpensESayosRadio1 server=dhcp-wlan2
add address=10.138.3.51 mac-address=00:16:B6:39:7D:6C client-id=AlpensEValverdeRadio1 server=dhcp-wlan2
add address=10.138.3.52 mac-address=00:16:B6:39:7D:96 client-id=AlpensJIborraRadio1 server=dhcp-wlan2
add address=10.138.3.53 mac-address=00:16:B6:39:7D:9C client-id=AlpensLaFondaRadio1 server=dhcp-wlan2
add address=10.138.3.54 mac-address=00:16:B6:39:7D:99 client-id=AlpensLBosomsRadio1 server=dhcp-wlan2
add address=10.138.3.55 mac-address=00:16:B6:39:8F:BD client-id=AlpensPCastanyRadio1 server=dhcp-wlan2
add address=10.138.3.56 mac-address=00:16:B6:39:8F:B7 client-id=AlpensMGomezRadio2 server=dhcp-wlan2
add address=10.138.3.57 mac-address=00:16:B6:39:8F:B4 client-id=AlpensPRafaelRadio1 server=dhcp-wlan2
add address=10.138.3.58 mac-address=00:16:B6:39:8F:CC client-id=AlpensRRafaelRadio1 server=dhcp-wlan2
add address=10.138.3.59 mac-address=00:16:B6:39:7D:75 client-id=AlpensCBragulatRadio1 server=dhcp-wlan2
add address=10.138.3.60 mac-address=00:16:B6:39:7D:7E client-id=AlpensAOrraRadio1 server=dhcp-wlan2
add address=10.138.3.61 mac-address=00:18:39:AE:83:1E client-id=AlpensMRSolerRadio1 server=dhcp-wlan2
add address=10.138.3.62 mac-address=00:18:39:AE:45:A1 client-id=AlpensAFranciscoRadio1 server=dhcp-wlan2
:foreach i in [/ip dhcp-server network find address="10.138.3.32/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.3.62-10.138.3.62
/ip dhcp-server network add address=10.138.3.32/27 gateway=10.138.3.33 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: wLan
/ip address
:foreach i in [find address="10.138.3.97/27"] do={remove $i}
/ ip address add address=10.138.3.97/27 network=10.138.3.96 broadcast=10.138.3.127 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.3.96/27] do={/routing ospf network remove $i;}
add network=10.138.3.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.3.98 mac-address=ff:ff:ff:ff:ff:ff client-id=AlpensJCamprubiRadio1 server=dhcp-wlan2
add address=10.138.3.99 mac-address=00:1D:73:18:DA:F9 client-id=AlpensClarisRadio1 server=dhcp-wlan2
:foreach i in [/ip dhcp-server network find address="10.138.3.96/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.3.105-10.138.3.126
/ip dhcp-server network add address=10.138.3.96/27 gateway=10.138.3.97 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=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;}
#
:delay 1
#
# Radio#: 2 Alpens-SBG
/interface wireless set wlan3 name="wlan3" \
radio-name="Alpens-SBG" mode=ap-bridge ssid="guifi.net-Alpens-SBG" \
band="5ghz" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=5700 \
dfs-mode=none \
wds-mode=static wds-default-bridge=none wds-default-cost=100 \
wds-cost-range=50-150 wds-ignore-ssid=yes hide-ssid=no
:delay 1
# Type: wds/p2p
# Remove all existing wds interfaces
:foreach i in [/interface wireless wds find master-interface=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_SBGTorreNord" master-interface=wlan3 wds-address=00:15:6D:63:0E:48 disabled=no
/ ip address add address=172.25.6.114/30 network=172.25.6.112 broadcast=172.25.6.115 interface=wds_SBGTorreNord disabled=no comment="wds_SBGTorreNord"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_SBGTorreNord] do={/routing ospf interface remove $i;}
add interface=wds_SBGTorreNord
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.6.112/30] do={/routing ospf network remove $i;}
add network=172.25.6.112/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=SBGTorreNord] do={/routing bgp peer remove $i;}
add name="SBGTorreNord" instance=default remote-address=172.25.6.113 remote-as=5613 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=no
#
:delay 1
#
# Radio#: 3 AlpDiposit-SALCasademunt
/interface wireless set wlan4 name="wlan4" \
radio-name="AlpDiposit-SALCasademunt" mode=ap-bridge ssid="guifi.net-AlpDiposit-SALCasademunt" \
band="5ghz" \
frequency-mode=manual-txpower country=spain antenna-gain=0 \
frequency=5300 \
dfs-mode=none \
wds-mode=static wds-default-bridge=none wds-default-cost=100 \
wds-cost-range=50-150 wds-ignore-ssid=yes hide-ssid=no
:delay 1
# Type: wds/p2p
# Remove all existing wds interfaces
:foreach i in [/interface wireless wds find master-interface=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_SALCasademunt" master-interface=wlan4 wds-address=00:0C:42:0C:1A:EC disabled=no
/ ip address add address=172.25.2.29/30 network=172.25.2.28 broadcast=172.25.2.31 interface=wds_SALCasademunt disabled=no comment="wds_SALCasademunt"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_SALCasademunt] do={/routing ospf interface remove $i;}
add interface=wds_SALCasademunt
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.2.28/30] do={/routing ospf network remove $i;}
add network=172.25.2.28/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=SALCasademunt] do={/routing bgp peer remove $i;}
add name="SALCasademunt" instance=default remote-address=172.25.2.30 remote-as=2269 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=no
#
: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.88/30] do={/routing ospf network remove $i;}
add network=172.25.3.88/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=AlpDipositST2] do={/routing bgp peer remove $i;}
add name="AlpDipositST2" instance=default remote-address=172.25.3.89 remote-as=6558 \
multihop=no route-reflect=no ttl=1 in-filter=ospf-in out-filter=ospf-out disabled=no
:foreach i in [/ip address find address="172.25.3.90/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.3.90/30 network=172.25.3.88 broadcast=172.25.3.91 interface=ether2 disabled=no comment="AlpDipositST2"
#
# 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.3.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.3.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=1939 router-id=10.138.3.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.3.97 redistribute-connected=as-type-1 redistribute-static=as-type-1 redistribute-bgp=as-type-1
#
:log info "Unsolclic for 1939-AlpDiposit-ST1 executed."
/