# Generated for:
# RouterOSv2.9
:log info "Unsolclic for 2788-SQBRepetidor going to be executed."
#
# Configuration for RouterOSv2.9
# Device: 2788-SQBRepetidor
#
# 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=SQBRepetidor
#
# DNS (client & server cache) zone: 2670
/ip dns set primary-dns=10.138.195.74 secondary-dns=10.138.0.2 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 2670
/system ntp client set enabled=yes mode=unicast primary-ntp=10.138.0.2
/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="SQBRepetidorTV"
#
# 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 SQBAP1
/interface wireless set wlan1 name="wlan1" \
radio-name="SQBAP1" mode=ap-bridge ssid="guifi.net-SQBAP1" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
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.194.129/26"] do={remove $i}
/ ip address add address=10.138.194.129/26 network=10.138.194.128 broadcast=10.138.194.191 interface=wLan/Lan disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.194.128/26] do={/routing bgp network remove $i;}
add network=10.138.194.128/26 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.194.128/26] do={/routing ospf network remove $i;}
add network=10.138.194.128/26 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.194.135-10.138.194.190
: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.194.128/26"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.194.128/26 gateway=10.138.194.129 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.194.130 mac-address=00:15:6D:AE:6B:A7 client-id=SQBMoratoRadio1 server=dhcp-wLan/Lan
add address=10.138.194.131 mac-address=00:16:01:AF:D5:88 client-id=DoctorRadio1 server=dhcp-wLan/Lan
add address=10.138.194.132 mac-address=00:16:01:F2:0E:49 client-id=SQBArenenyesRadio1 server=dhcp-wLan/Lan
add address=10.138.194.133 mac-address=00:16:01:F2:31:E9 client-id=SQBpilarRadio1 server=dhcp-wLan/Lan
add address=10.138.194.134 mac-address=00:15:6D:AE:6B:A3 client-id=SQBVickyRd1 server=dhcp-wLan/Lan
add address=10.138.194.135 mac-address=00:16:01:AF:AF:04 client-id=SMBLesqueixRadio1 server=dhcp-wLan/Lan
add address=10.138.194.136 mac-address=00:16:01:F2:31:EB client-id=SQBXispesRadio1 server=dhcp-wLan/Lan
add address=10.138.194.137 mac-address=00:1D:7E:3A:36:2C client-id=SQBJuandomferRadio1 server=dhcp-wLan/Lan
add address=10.138.194.138 mac-address=ff:ff:ff:ff:ff:ff client-id=SQBTSeguraRadio1 server=dhcp-wLan/Lan
add address=10.138.194.139 mac-address=ff:ff:ff:ff:ff:ff client-id=MAIKELRadio1 server=dhcp-wLan/Lan
add address=10.138.194.140 mac-address=00:16:01:AF:E9:A8 client-id=SQBRSoyRadio1 server=dhcp-wLan/Lan
add address=10.138.194.141 mac-address=00:16:01:B0:0C:3F client-id=SQBUESantQuirzeRadio1 server=dhcp-wLan/Lan
add address=10.138.194.142 mac-address=ff:ff:ff:ff:ff:ff client-id=SQBRCastanyRadio1 server=dhcp-wLan/Lan
add address=10.138.194.143 mac-address=00:16:01:F2:07:3E client-id=SQBCComasRadio1 server=dhcp-wLan/Lan
add address=10.138.194.144 mac-address=00:15:6D:F3:9B:CD client-id=SQBCarmeCRd1 server=dhcp-wLan/Lan
add address=10.138.194.145 mac-address=00:1E:E5:36:02:96 client-id=SQDBdamiagranadosRadio1 server=dhcp-wLan/Lan
add address=10.138.194.146 mac-address=ff:ff:ff:ff:ff:ff client-id=SMBLaVilaRadio1 server=dhcp-wLan/Lan
add address=10.138.194.147 mac-address=00:0B:6B:4E:60:8A client-id=SQBALopezRd1 server=dhcp-wLan/Lan
add address=10.138.194.148 mac-address=00:21:29:93:55:32 client-id=MTQCasanovaRd1 server=dhcp-wLan/Lan
add address=10.138.194.149 mac-address=00:1E:E5:5B:35:35 client-id=SQBaangladaRd server=dhcp-wLan/Lan
add address=10.138.194.150 mac-address=00:0B:6B:4E:60:8C client-id=SQBFBisauraRd1 server=dhcp-wLan/Lan
add address=10.138.194.151 mac-address=00:00:00:00:00:01 client-id=SQBSomeRd1 server=dhcp-wLan/Lan
add address=10.138.194.152 mac-address=00:15:6D:F2:9B:52 client-id=SQBJoanFRd1 server=dhcp-wLan/Lan
add address=10.138.194.153 mac-address=00:1D:73:55:64:D5 client-id=SQBLauraTRd1 server=dhcp-wLan/Lan
add address=10.138.194.154 mac-address=00:15:6D:EB:92:82 client-id=SQBRaquelRRd1 server=dhcp-wLan/Lan
add address=10.138.194.155 mac-address=00:15:6D:AB:70:AA client-id=SQBMontseCarreraRd1 server=dhcp-wLan/Lan
add address=10.138.194.156 mac-address=00:21:00:75:DB:A3 client-id=JoanPu server=dhcp-wLan/Lan
add address=10.138.194.157 mac-address=00:15:6D:AC:F4:B1 client-id=SQBGASOPERd1 server=dhcp-wLan/Lan
add address=10.138.194.158 mac-address=00:15:6D:AD:DA:1C client-id=SQBSandraperarnauRd1 server=dhcp-wLan/Lan
add address=10.138.194.159 mac-address=00:15:6D:AE:5E:15 client-id=SQBHelenaVRd1 server=dhcp-wLan/Lan
add address=10.138.194.160 mac-address=00:23:69:3B:47:A4 client-id=SQBFTeixidorRd1 server=dhcp-wLan/Lan
add address=10.138.194.161 mac-address=00:23:69:AB:A7:BA client-id=CefeRd1 server=dhcp-wLan/Lan
add address=10.138.194.162 mac-address=00:15:6D:DA:9D:4F client-id=JARocaRd1 server=dhcp-wLan/Lan
add address=10.138.194.163 mac-address=00:15:6D:DC:5B:AA client-id=SQBFrancescCRd1 server=dhcp-wLan/Lan
add address=10.138.194.164 mac-address=00:15:6D:EB:92:9B client-id=SQBVladimirRRd1 server=dhcp-wLan/Lan
add address=10.138.194.165 mac-address=00:15:6D:E4:7F:01 client-id=SQBLuisMariRd1 server=dhcp-wLan/Lan
add address=10.138.194.166 mac-address=00:0B:6B:4E:60:4C client-id=sqbmcurtichsRd2 server=dhcp-wLan/Lan
add address=10.138.194.167 mac-address=00:15:6D:F3:68:6A client-id=SQBNuriaRRd1 server=dhcp-wLan/Lan
add address=10.138.194.168 mac-address=00:15:6D:E4:39:5D client-id=SQBJDominguezRd1 server=dhcp-wLan/Lan
add address=10.138.194.169 mac-address=00:15:6D:F2:68:B6 client-id=SQBMontseFRd1 server=dhcp-wLan/Lan
add address=10.138.194.170 mac-address=00:1C:10:13:97:9E client-id=AlbertBenetRd1 server=dhcp-wLan/Lan
add address=10.138.194.171 mac-address=00:15:6D:DB:BE:70 client-id=SQBLluisaMRd1 server=dhcp-wLan/Lan
add address=10.138.194.172 mac-address=00:15:6D:8C:52:B5 client-id=EsplaiRd1 server=dhcp-wLan/Lan
add address=10.138.194.173 mac-address=00:15:6D:60:D5:4F client-id=SQBJoanGRd1 server=dhcp-wLan/Lan
add address=10.138.194.174 mac-address=00:15:6D:9C:66:33 client-id=SQBTejedorSerraRd2 server=dhcp-wLan/Lan
add address=10.138.194.175 mac-address=00:27:22:20:1B:F5 client-id=SQBMalikaARd1 server=dhcp-wLan/Lan
add address=10.138.194.176 mac-address=00:27:22:18:66:9F client-id=SQBCarmeSRd1 server=dhcp-wLan/Lan
add address=10.138.194.177 mac-address=00:15:6D:D8:23:DA client-id=SQBIntradeRd1 server=dhcp-wLan/Lan
add address=10.138.194.178 mac-address=00:16:01:B0:02:B7 client-id=SQBETubertRd2 server=dhcp-wLan/Lan
add address=10.138.194.179 mac-address=00:27:22:2E:3D:C0 client-id=SQBJosepHRd1 server=dhcp-wLan/Lan
add address=10.138.194.180 mac-address=00:0B:6B:81:CE:43 client-id=dellnodeRd2 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;}
#
:delay 1
#
# Radio#: 1 SQBAP2
/interface wireless set wlan2 name="wlan2" \
radio-name="SQBAP2" mode=ap-bridge ssid="guifi.net-SQBAP2" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=2437 \
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.194.193/26"] do={remove $i}
/ ip address add address=10.138.194.193/26 network=10.138.194.192 broadcast=10.138.194.255 interface=wlan2 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.194.192/26] do={/routing bgp network remove $i;}
add network=10.138.194.192/26 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.194.192/26] do={/routing ospf network remove $i;}
add network=10.138.194.192/26 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wlan2] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan2 ranges=10.138.194.199-10.138.194.254
: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
:foreach i in [/ip dhcp-server network find address="10.138.194.192/26"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.194.192/26 gateway=10.138.194.193 domain=guifi.net comment=dhcp-wlan2
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.194.194 mac-address=00:1A:70:4E:D2:25 client-id=SQBRomaRadio1 server=dhcp-wlan2
add address=10.138.194.196 mac-address=00:1D:7E:4B:27:A0 client-id=SQBQueroRadio1 server=dhcp-wlan2
add address=10.138.194.197 mac-address=00:16:01:F2:29:5B client-id=SQBSALERESRadio20 server=dhcp-wlan2
add address=10.138.194.198 mac-address=00:18:39:AE:6E:3F client-id=SQBJCrousRadio1 server=dhcp-wlan2
add address=10.138.194.199 mac-address=00:15:6D:AE:6B:94 client-id=SQBFVadilloRd1 server=dhcp-wlan2
add address=10.138.194.200 mac-address=ff:ff:ff:ff:ff:ff client-id=SQBamadeublascoRadio1 server=dhcp-wlan2
add address=10.138.194.201 mac-address=00:15:6D:AE:5E:1B client-id=SQDBantonioruizRd1 server=dhcp-wlan2
add address=10.138.194.202 mac-address=ff:ff:ff:ff:ff:ff client-id=SQBjosepsalaRadio1 server=dhcp-wlan2
add address=10.138.194.203 mac-address=ff:ff:ff:ff:ff:ff client-id=SQBABorgesRadio1 server=dhcp-wlan2
add address=10.138.194.205 mac-address=00:15:6D:AA:BE:11 client-id=SQBJaumeRd1 server=dhcp-wlan2
add address=10.138.194.206 mac-address=00:15:6D:AD:6F:A9 client-id=SQBDBernalRd1 server=dhcp-wlan2
add address=10.138.194.207 mac-address=00:12:17:07:AD:AE client-id=SQBNeusRadio1 server=dhcp-wlan2
add address=10.138.194.208 mac-address=ff:ff:ff:ff:ff:ff client-id=SQBMPuigRadio1 server=dhcp-wlan2
add address=10.138.194.215 mac-address=00:16:01:B0:67:60 client-id=SQBeteamRadio1 server=dhcp-wlan2
add address=10.138.194.218 mac-address=00:15:6D:A7:21:1E client-id=BazRd2 server=dhcp-wlan2
add address=10.138.194.219 mac-address=00:0B:6B:4E:60:4B client-id=SQBIGRI server=dhcp-wlan2
add address=10.138.194.220 mac-address=00:1C:10:44:36:53 client-id=SQBMoratoRadio2 server=dhcp-wlan2
add address=10.138.194.221 mac-address=00:15:6D:A8:A9:D7 client-id=SQBEForcadaRd1 server=dhcp-wlan2
add address=10.138.194.222 mac-address=00:15:6D:A8:B6:B7 client-id=SQBLSolsonaRd1 server=dhcp-wlan2
add address=10.138.194.223 mac-address=00:15:6D:AE:E2:BD client-id=sqbicartRd1 server=dhcp-wlan2
add address=10.138.194.226 mac-address=00:15:6D:DD:5B:9A client-id=SQBNuriaPRd1 server=dhcp-wlan2
add address=10.138.194.230 mac-address=00:15:6D:EA:91:49 client-id=SQBMohaRd1 server=dhcp-wlan2
add address=10.138.194.231 mac-address=00:15:6D:DE:C1:02 client-id=SQBEParcerisasRd1 server=dhcp-wlan2
add address=10.138.194.232 mac-address=00:15:6D:E4:80:15 client-id=SQBJCarrascoRd1 server=dhcp-wlan2
add address=10.138.194.233 mac-address=00:15:6D:AD:7E:C2 client-id=SQBCDarnesRd1 server=dhcp-wlan2
add address=10.138.194.234 mac-address=00:1D:73:DE:8B:97 client-id=SQBAntoniBRd1 server=dhcp-wlan2
add address=10.138.194.235 mac-address=00:15:6D:DB:CD:EB client-id=SQBrabionetRd1 server=dhcp-wlan2
add address=10.138.194.236 mac-address=00:15:6D:F8:2F:C2 client-id=SQBJSerradellRd2 server=dhcp-wlan2
add address=10.138.194.237 mac-address=00:23:69:2A:75:E0 client-id=SQBXCollellRd1 server=dhcp-wlan2
add address=10.138.194.239 mac-address=AA:CC:DD:33:33:23 client-id=SQBEspadalerRd2 server=dhcp-wlan2
add address=10.138.194.241 mac-address=00:15:6D:A8:A9:8C client-id=sqbvilaltaRd1 server=dhcp-wlan2
add address=10.138.194.242 mac-address=00:15:6D:D6:95:F2 client-id=SQBAnnaMariaVRd1 server=dhcp-wlan2
add address=10.138.194.243 mac-address=00:15:6D:1A:4F:4B client-id=SQBMariaSRd1 server=dhcp-wlan2
add address=10.138.194.245 mac-address=00:15:6D:AC:98:4D client-id=sqbFutbolRd1 server=dhcp-wlan2
add address=10.138.194.247 mac-address=00:15:6D:EA:91:7D client-id=SQBcaljonnyRd2 server=dhcp-wlan2
#
:delay 1
#
# Radio#: 2 SQBRepetidorWDSSoraCussons
/interface wireless set wlan3 name="wlan3" \
radio-name="SQBRepetidorWDSSoraCussons" mode=ap-bridge ssid="guifi.net-SQBRepetidorWDSSoraCussons" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=5620 \
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_SoraDipCussonsST" master-interface=wlan3 wds-address=00:0B:6B:87:66:21 disabled=no
/ ip address add address=172.25.224.37/30 network=172.25.224.36 broadcast=172.25.224.39 interface=wds_SoraDipCussonsST disabled=no comment="wds_SoraDipCussonsST"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_SoraDipCussonsST] do={/routing ospf interface remove $i;}
add interface=wds_SoraDipCussonsST
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.224.36/30] do={/routing ospf network remove $i;}
add network=172.25.224.36/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=SoraDipCussonsST] do={/routing bgp peer remove $i;}
add name="SoraDipCussonsST" instance=default remote-address=172.25.224.38 remote-as=10386 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Radio#: 3 SQBRepetidorWDSSALLElsMunts
/interface wireless set wlan4 name="wlan4" \
radio-name="SQBRepetidorWDSSALLElsMunts" mode=ap-bridge ssid="guifi.net-SQBRepetidorWDSSALLElsMunts" \
band="5ghz" \
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=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_SALLElsMuntsSoraST" master-interface=wlan4 wds-address=00:0B:6B:87:66:20 disabled=no
/ ip address add address=172.25.8.42/30 network=172.25.8.40 broadcast=172.25.8.43 interface=wds_SALLElsMuntsSoraST disabled=no comment="wds_SALLElsMuntsSoraST"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_SALLElsMuntsSoraST] do={/routing ospf interface remove $i;}
add interface=wds_SALLElsMuntsSoraST
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.8.40/30] do={/routing ospf network remove $i;}
add network=172.25.8.40/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=SALLElsMuntsSoraST] do={/routing bgp peer remove $i;}
add name="SALLElsMuntsSoraST" instance=default remote-address=172.25.8.41 remote-as=10395 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
: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.226.0/30] do={/routing ospf network remove $i;}
add network=172.25.226.0/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=SQBRepetidor2] do={/routing bgp peer remove $i;}
add name="SQBRepetidor2" instance=default remote-address=172.25.226.1 remote-as=2798 \
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.226.2/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.226.2/30 network=172.25.226.0 broadcast=172.25.226.3 interface=ether2 disabled=no comment="SQBRepetidor2"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=ether3] do={/routing ospf interface remove $i;}
add interface=ether3
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.226.8/30] do={/routing ospf network remove $i;}
add network=172.25.226.8/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=SQBRepetidor5G] do={/routing bgp peer remove $i;}
add name="SQBRepetidor5G" instance=default remote-address=172.25.226.9 remote-as=22925 \
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.226.10/30"] do={/ip address remove $i;}
:delay 1
/ ip address add address=172.25.226.10/30 network=172.25.226.8 broadcast=172.25.226.11 interface=ether3 disabled=yes comment="SQBRepetidor5G"
#
# 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.194.129 to-ports=0-65535 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.194.129 to-ports=0-65535 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=2788 router-id=10.138.194.129 \
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=10.138.194.129 distribute-default=never redistribute-connected=no \
redistribute-static=no redistribute-rip=no redistribute-bgp=as-type-1
#
:log info "Unsolclic for 2788-SQBRepetidor executed."
/