# Generated for:
# RouterOSv3.x
:log info "Unsolclic for 13471-BCNxsf-coopSolMAIN going to be executed."
#
# Configuration for RouterOSv3.x
# Device: 13471-BCNxsf-coopSolMAIN
#
# 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=BCNxsf-coopSolMAIN
#
# DNS (client & server cache) zone: 2436
/ip dns set primary-dns=10.138.27.194 secondary-dns=10.139.6.130 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 2436
/system ntp client set enabled=yes mode=unicast primary-ntp=10.138.27.98 secondary-ntp=10.138.27.194
: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="BCNxsf-coopSol"
#
# 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;}
:delay 1
#
# Routed device
#
# Other cable connections
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNMarsupiCobalt] do={/routing bgp peer remove $i;}
add name="BCNMarsupiCobalt" instance=default remote-address=10.139.39.66 remote-as=13457 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNMarsupiConway] do={/routing bgp peer remove $i;}
add name="BCNMarsupiConway" instance=default remote-address=10.139.39.68 remote-as=11871 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNMarsupiTesla] do={/routing bgp peer remove $i;}
add name="BCNMarsupiTesla" instance=default remote-address=10.139.39.69 remote-as=13241 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNxsfcoopSolmon000] do={/routing bgp peer remove $i;}
add name="BCNxsfcoopSolmon000" instance=default remote-address=10.139.39.70 remote-as=11930 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNMarsupiCobaltEyeOS] do={/routing bgp peer remove $i;}
add name="BCNMarsupiCobaltEyeOS" instance=default remote-address=10.139.39.72 remote-as=21181 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNxsfcoopSolBackup] do={/routing bgp peer remove $i;}
add name="BCNxsfcoopSolBackup" instance=default remote-address=10.139.39.73 remote-as=21182 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNMarsupiEuler] do={/routing bgp peer remove $i;}
add name="BCNMarsupiEuler" instance=default remote-address=10.139.39.75 remote-as=25780 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNMarsupiCobaltvdev] do={/routing bgp peer remove $i;}
add name="BCNMarsupiCobaltvdev" instance=default remote-address=10.139.39.67 remote-as=28400 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNMarsupiCaptainCrunch] do={/routing bgp peer remove $i;}
add name="BCNMarsupiCaptainCrunch" instance=default remote-address=10.139.39.74 remote-as=28401 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNMarsupiFree] do={/routing bgp peer remove $i;}
add name="BCNMarsupiFree" instance=default remote-address=10.139.39.78 remote-as=28402 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNxsfcoopSolEulervdns1] do={/routing bgp peer remove $i;}
add name="BCNxsfcoopSolEulervdns1" instance=default remote-address=10.139.39.76 remote-as=28403 \
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=bridge2_SRV] do={/routing ospf interface remove $i;}
add interface=bridge2_SRV
/ routing ospf network
:foreach i in [/routing ospf network find network=10.139.39.64/27] do={/routing ospf network remove $i;}
add network=10.139.39.64/27 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNMarsupiFree2] do={/routing bgp peer remove $i;}
add name="BCNMarsupiFree2" instance=default remote-address=10.139.39.77 remote-as=28408 \
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.139.39.65/27"] do={/ip address remove $i;}
:delay 1
/ ip address add address=10.139.39.65/27 network=10.139.39.64 broadcast=10.139.39.95 interface=bridge2_SRV disabled=no comment="BCNMarsupiCobalt,BCNMarsupiConway,BCNMarsupiTesla,BCNxsfcoopSolmon000,BCNMarsupiCobaltEyeOS,BCNxsfcoopSolBackup,BCNMarsupiEuler,BCNMarsupiCobaltvdev,BCNMarsupiCaptainCrunch,BCNMarsupiFree,BCNxsfcoopSolEulervdns1,BCNMarsupiFree2"
:foreach i in [/ip address find address="10.139.93.1/24"] do={/ip address remove $i;}
:delay 1
/ ip address add address=10.139.93.1/24 network=10.139.93.0 broadcast=10.139.93.255 interface=bridge3_Ofi disabled=no comment="BCNMarsupiCobalt,BCNMarsupiConway,BCNMarsupiTesla,BCNxsfcoopSolmon000,BCNMarsupiCobaltEyeOS,BCNxsfcoopSolBackup,BCNMarsupiEuler,BCNMarsupiCobaltvdev,BCNMarsupiCaptainCrunch,BCNMarsupiFree,BCNxsfcoopSolEulervdns1,BCNMarsupiFree2"
:foreach i in [/ip address find address="10.139.39.129/26"] do={/ip address remove $i;}
:delay 1
/ ip address add address=10.139.39.129/26 network=10.139.39.128 broadcast=10.139.39.191 interface=bridge4_Usr1 disabled=no comment="BCNMarsupiCobalt,BCNMarsupiConway,BCNMarsupiTesla,BCNxsfcoopSolmon000,BCNMarsupiCobaltEyeOS,BCNxsfcoopSolBackup,BCNMarsupiEuler,BCNMarsupiCobaltvdev,BCNMarsupiCaptainCrunch,BCNMarsupiFree,BCNxsfcoopSolEulervdns1,BCNMarsupiFree2"
:foreach i in [/ip address find address="10.139.92.65/26"] do={/ip address remove $i;}
:delay 1
/ ip address add address=10.139.92.65/26 network=10.139.92.64 broadcast=10.139.92.127 interface=bridge5_Usr2 disabled=no comment="BCNMarsupiCobalt,BCNMarsupiConway,BCNMarsupiTesla,BCNxsfcoopSolmon000,BCNMarsupiCobaltEyeOS,BCNxsfcoopSolBackup,BCNMarsupiEuler,BCNMarsupiCobaltvdev,BCNMarsupiCaptainCrunch,BCNMarsupiFree,BCNxsfcoopSolEulervdns1,BCNMarsupiFree2"
:foreach i in [/ip address find address="10.139.36.33/27"] do={/ip address remove $i;}
:delay 1
/ ip address add address=10.139.36.33/27 network=10.139.36.32 broadcast=10.139.36.63 interface=wLan/Lan disabled=no comment="BCNMarsupiCobalt,BCNMarsupiConway,BCNMarsupiTesla,BCNxsfcoopSolmon000,BCNMarsupiCobaltEyeOS,BCNxsfcoopSolBackup,BCNMarsupiEuler,BCNMarsupiCobaltvdev,BCNMarsupiCaptainCrunch,BCNMarsupiFree,BCNxsfcoopSolEulervdns1,BCNMarsupiFree2"
/ 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.228.193.224/30] do={/routing ospf network remove $i;}
add network=10.228.193.224/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNxsfcoopSolCPE] do={/routing bgp peer remove $i;}
add name="BCNxsfcoopSolCPE" instance=default remote-address=172.25.33.186 remote-as=26876 \
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.228.193.226/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=10.228.193.226/30 network=10.228.193.224 broadcast=10.228.193.227 interface=wLan/Lan disabled=no comment="BCNxsfcoopSolCPE"
/ 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=172.25.33.240/30] do={/routing ospf network remove $i;}
add network=172.25.33.240/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNxsfcoopSolAP] do={/routing bgp peer remove $i;}
add name="BCNxsfcoopSolAP" instance=default remote-address=10.228.193.227 remote-as=26877 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
:foreach i in [/ip address find address="172.25.33.241/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.33.241/30 network=172.25.33.240 broadcast=172.25.33.243 interface=wLan/Lan disabled=no comment="BCNxsfcoopSolAP"
/ 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=172.25.38.144/30] do={/routing ospf network remove $i;}
add network=172.25.38.144/30 area=backbone disabled=yes
/ routing bgp peer
:foreach i in [find name=BCNxsfcoopSolPUTXET] do={/routing bgp peer remove $i;}
add name="BCNxsfcoopSolPUTXET" instance=default remote-address=10.228.193.228 remote-as=11815 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=no
:foreach i in [/ip address find address="172.25.38.145/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.38.145/30 network=172.25.38.144 broadcast=172.25.38.147 interface=wLan/Lan disabled=no comment="BCNxsfcoopSolPUTXET"
#
# 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= 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= 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=13471 router-id= \
redistribute-connected=yes redistribute-static=yes redistribute-rip=yes \
redistribute-ospf=yes redistribute-other-bgp=yes out-filter=ebgp-out \
client-to-client-reflection=yes comment="" disabled=no
#
# OSPF Routing
/routing ospf set router-id= distribute-default=never redistribute-connected=no \
redistribute-static=no redistribute-rip=no redistribute-bgp=as-type-1
#
:log info "Unsolclic for 13471-BCNxsf-coopSolMAIN executed."
/