# Generated for:
# RouterOSv3.x
:log info "Unsolclic for 4124-GXACampST going to be executed."
#
# Configuration for RouterOSv3.x
# Device: 4124-GXACampST
#
# 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=GXACampST
#
# DNS (client & server cache) zone: 4224
/ip dns set primary-dns=10.138.160.98 secondary-dns=10.138.0.2 allow-remote-requests=yes
:delay 1
#
# NTP (client & server cache) zone: 4224
/system ntp client set enabled=yes mode=unicast primary-ntp=10.138.10.2 secondary-ntp=10.138.160.98
: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="GXACampanar"
#
# 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 GXACampST-NE
/interface wireless set wlan1 name="wlan1" \
radio-name="GXACampST-NE" mode=ap-bridge ssid="guifi.net-GXACampST-NE" \
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.163.1/27"] do={remove $i}
/ ip address add address=10.138.163.1/27 network=10.138.163.0 broadcast=10.138.163.31 interface=wLan/Lan disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.163.0/27] do={/routing bgp network remove $i;}
add network=10.138.163.0/27 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.163.0/27] do={/routing ospf network remove $i;}
add network=10.138.163.0/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.163.7-10.138.163.30
: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.163.0/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.163.0/27 gateway=10.138.163.1 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.163.2 mac-address=00:16:01:8C:6E:40 client-id=GXAAlexandra server=dhcp-wLan/Lan
add address=10.138.163.3 mac-address=00:16:B6:C9:18:EE client-id=GXAGriera server=dhcp-wLan/Lan
add address=10.138.163.4 mac-address=00:15:6D:D2:E2:DE client-id=VicMohamedCRadio1 server=dhcp-wLan/Lan
add address=10.138.163.5 mac-address=00:18:39:86:FA:70 client-id=GXAMorera server=dhcp-wLan/Lan
add address=10.138.163.6 mac-address=00:18:39:AE:4A:84 client-id=GXAMerce server=dhcp-wLan/Lan
add address=10.138.163.7 mac-address=00:14:BF:D2:70:4F client-id=GXACanTeula server=dhcp-wLan/Lan
add address=10.138.163.8 mac-address=00:14:BF:EB:8E:53 client-id=GXAAngels server=dhcp-wLan/Lan
add address=10.138.163.9 mac-address=00:16:B6:D9:B0:D9 client-id=GXAAssumpta server=dhcp-wLan/Lan
add address=10.138.163.10 mac-address=00:1D:7E:4B:27:9F client-id=GXARomaRd1 server=dhcp-wLan/Lan
add address=10.138.163.11 mac-address=00:16:B6:39:80:EB client-id=GXAImma server=dhcp-wLan/Lan
add address=10.138.163.12 mac-address=00:16:01:84:77:32 client-id=GXAMMorera server=dhcp-wLan/Lan
add address=10.138.163.13 mac-address=00:16:B6:C9:29:14 client-id=VicMiroRadio1 server=dhcp-wLan/Lan
add address=10.138.163.14 mac-address=00:15:6D:AB:DF:24 client-id=GXAManel server=dhcp-wLan/Lan
add address=10.138.163.15 mac-address=00:0D:0B:FD:5B:5F client-id=GXAMireia server=dhcp-wLan/Lan
add address=10.138.163.16 mac-address=00:14:BF:EB:6E:61 client-id=GXARoca server=dhcp-wLan/Lan
add address=10.138.163.17 mac-address=00:15:6D:AB:DD:86 client-id=VicJVilaBarracaRd1 server=dhcp-wLan/Lan
add address=10.138.163.18 mac-address=00:15:6D:A8:B7:AD client-id=VicAnnaNRd1 server=dhcp-wLan/Lan
add address=10.138.163.19 mac-address=00:15:6D:AB:F1:C1 client-id=GXASilviaPRd1 server=dhcp-wLan/Lan
add address=10.138.163.20 mac-address=00:16:01:AD:D6:4C client-id=GXAJorda server=dhcp-wLan/Lan
add address=10.138.163.21 mac-address=00:15:6D:AB:90:13 client-id=VicJoanMiroRd2 server=dhcp-wLan/Lan
add address=10.138.163.22 mac-address=00:15:6D:F8:2E:90 client-id=GXAPauVilaRd2 server=dhcp-wLan/Lan
add address=10.138.163.23 mac-address=00:16:01:AE:42:06 client-id=GXACasajuanaRieraRadio1 server=dhcp-wLan/Lan
add address=10.138.163.24 mac-address=00:22:6B:6E:21:31 client-id=VICMONAGUIRd2 server=dhcp-wLan/Lan
add address=10.138.163.25 mac-address=00:1A:70:7B:6F:22 client-id=GXAcantalaiaRd1 server=dhcp-wLan/Lan
add address=10.138.163.26 mac-address=00:0D:0B:D5:E5:D8 client-id=VicSolrufRadio1 server=dhcp-wLan/Lan
add address=10.138.163.27 mac-address=ff:ff:ff:ff:ff:ff client-id=GXAPanedasRadio1 server=dhcp-wLan/Lan
add address=10.138.163.28 mac-address=00:15:6D:1A:12:A6 client-id=VicElNadalRd2 server=dhcp-wLan/Lan
add address=10.138.163.29 mac-address=00:18:39:AE:4A:80 client-id=GXAPepRd1 server=dhcp-wLan/Lan
add address=10.138.163.30 mac-address=00:1A:70:4E:BE:C9 client-id=GXAMarcRadio1 server=dhcp-wLan/Lan
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.163.193/27"] do={remove $i}
/ ip address add address=10.138.163.193/27 network=10.138.163.192 broadcast=10.138.163.223 interface=wlan1 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.163.192/27] do={/routing bgp network remove $i;}
add network=10.138.163.192/27 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.163.192/27] do={/routing ospf network remove $i;}
add network=10.138.163.192/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.138.163.199-10.138.163.222
: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.138.163.192/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.163.192/27 gateway=10.138.163.193 domain=guifi.net comment=dhcp-wlan1
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.163.194 mac-address=00:1D:73:18:07:78 client-id=VicIsernRadio1 server=dhcp-wlan1
add address=10.138.163.195 mac-address=00:15:6D:1A:00:04 client-id=laguixaSalomRd1 server=dhcp-wlan1
add address=10.138.163.196 mac-address=00:1D:7E:F1:06:6A client-id=VicSaladaRadio1 server=dhcp-wlan1
add address=10.138.163.197 mac-address=00:15:6D:A9:2C:D6 client-id=VicMTVilaRd1 server=dhcp-wlan1
add address=10.138.163.198 mac-address=00:15:6D:AE:0A:78 client-id=VicIdrissiRd1 server=dhcp-wlan1
add address=10.138.163.199 mac-address=00:00:00:00:00:02 client-id=GXAXavierMartosRd1 server=dhcp-wlan1
add address=10.138.163.200 mac-address=00:14:BF:EB:8F:FA client-id=GXAMasCodina server=dhcp-wlan1
add address=10.138.163.201 mac-address=00:15:6D:D2:E0:5F client-id=VicYassinRd1 server=dhcp-wlan1
add address=10.138.163.202 mac-address=45:78:0B:72:39:83 client-id=GXAOD1Rd1 server=dhcp-wlan1
add address=10.138.163.203 mac-address=00:1A:70:4F:42:6B client-id=VicSantMarcBagasRd1 server=dhcp-wlan1
add address=10.138.163.204 mac-address=00:15:6D:AD:D9:40 client-id=VicAbdulKRd2 server=dhcp-wlan1
add address=10.138.163.205 mac-address=00:15:6D:DB:CE:05 client-id=VicRosaFRd1 server=dhcp-wlan1
add address=10.138.163.206 mac-address=00:15:6D:5E:76:33 client-id=VicMostafaElFaraoutRd2 server=dhcp-wlan1
add address=10.138.163.207 mac-address=00:15:06:DA:B2:ED client-id=JSerraRd1 server=dhcp-wlan1
add address=10.138.163.208 mac-address=00:15:6D:5E:BA:34 client-id=VicAzizRd2 server=dhcp-wlan1
add address=10.138.163.209 mac-address=00:15:6D:3A:65:52 client-id=GXACanPereRd1 server=dhcp-wlan1
add address=10.138.163.210 mac-address=00:18:F8:7A:4E:BC client-id=GXALluisMerceRd1 server=dhcp-wlan1
#
: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 GXACampST-NO
/interface wireless set wlan2 name="wlan2" \
radio-name="GXACampST-NO" mode=ap-bridge ssid="guifi.net-GXACampST-NO" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=2442 \
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.163.33/27"] do={remove $i}
/ ip address add address=10.138.163.33/27 network=10.138.163.32 broadcast=10.138.163.63 interface=wlan2 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.163.32/27] do={/routing bgp network remove $i;}
add network=10.138.163.32/27 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.163.32/27] do={/routing ospf network remove $i;}
add network=10.138.163.32/27 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.163.39-10.138.163.62
: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.163.32/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.163.32/27 gateway=10.138.163.33 domain=guifi.net comment=dhcp-wlan2
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.163.34 mac-address=00:15:6D:1A:37:05 client-id=GXALamiranda server=dhcp-wlan2
add address=10.138.163.35 mac-address=00:18:F8:F2:6A:62 client-id=GXACorominola server=dhcp-wlan2
add address=10.138.163.36 mac-address=00:16:B6:D9:63:9B client-id=GXAHectorRd1 server=dhcp-wlan2
add address=10.138.163.37 mac-address=00:15:6D:AB:F4:E7 client-id=SERPuigdeRd1 server=dhcp-wlan2
add address=10.138.163.38 mac-address=00:15:6D:E8:CB:2A client-id=GXACanGirapells server=dhcp-wlan2
add address=10.138.163.39 mac-address=00:0C:42:05:84:2A client-id=FolguerolesLaDemuntVRadio1 server=dhcp-wlan2
#
: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 GXACampST-S
/interface wireless set wlan3 name="wlan3" \
radio-name="GXACampST-S" mode=ap-bridge ssid="guifi.net-GXACampST-S" \
band="2.4ghz-b" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
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: HotSpot
#
# HotSpot
/interface wireless
:foreach i in [find name=hotspot3] do={remove $i}
add name="hotspot3" arp=enabled master-interface=wlan3 ssid="guifi.net-AccesObert" disabled="no"
/ip address
:foreach i in [find address="192.168.102.1/24"] do={remove $i}
/ip address add address=192.168.102.1/24 interface=hotspot3 disabled=no
/ip pool
:foreach i in [find name=hs-pool-102] do={remove $i}
add name="hs-pool-102" ranges=192.168.102.2-192.168.102.254
/ip dhcp-server
:foreach i in [find name=hs-dhcp-102] do={remove $i}
add name="hs-dhcp-102" interface=hotspot3 lease-time=1h address-pool=hs-pool-102 bootp-support=static authoritative=after-2sec-delay disabled=no
/ip dhcp-server network
:foreach i in [find address="192.168.102.0/24"] do={remove $i}
add address=192.168.102.0/24 gateway=192.168.102.1 domain=guifi.net comment=dhcp-2
/ip hotspot profile
:foreach i in [find name=hsprof3] do={remove $i}
add name="hsprof3" hotspot-address=192.168.102.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=hotspot3] do={remove $i}
add name="hotspot3" interface=hotspot3 address-pool=hs-pool-102 profile=hsprof3 idle-timeout=5m keepalive-timeout=none addresses-per-mac=2 disabled=no
# end of HotSpot
:delay 1
#
:delay 1
# Type: wLan
/ip address
:foreach i in [find address="10.138.163.65/27"] do={remove $i}
/ ip address add address=10.138.163.65/27 network=10.138.163.64 broadcast=10.138.163.95 interface=wlan3 disabled=no
/ routing bgp network
:foreach i in [/routing bgp network find network=10.138.163.64/27] do={/routing bgp network remove $i;}
add network=10.138.163.64/27 disabled=no
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wlan3] do={/routing ospf interface remove $i;}
add interface=wlan3
/ routing ospf network
:foreach i in [/routing ospf network find network=10.138.163.64/27] do={/routing ospf network remove $i;}
add network=10.138.163.64/27 area=backbone disabled=no
:delay 1
#
# DHCP
:foreach i in [/ip pool find name=dhcp-wlan3] do={/ip pool remove $i;}
/ip pool add name=dhcp-wlan3 ranges=10.138.163.71-10.138.163.94
:foreach i in [/ip dhcp-server find name=dhcp-wlan3] do={/ip dhcp-server remove $i;}
/ip dhcp-server add name=dhcp-wlan3 interface=wlan3 address-pool=dhcp-wlan3 disabled=no
:foreach i in [/ip dhcp-server network find address="10.138.163.64/27"] do={/ip dhcp-server network remove $i;}
/ip dhcp-server network add address=10.138.163.64/27 gateway=10.138.163.65 domain=guifi.net comment=dhcp-wlan3
/ip dhcp-server lease
:foreach i in [find comment=""] do={remove $i;}
:delay 1
add address=10.138.163.66 mac-address=00:16:01:8E:D0:32 client-id=GXACarlesRadio1 server=dhcp-wlan3
add address=10.138.163.67 mac-address=00:1D:7E:28:01:3A client-id=GXALlarInfantsRd1 server=dhcp-wlan3
add address=10.138.163.69 mac-address=00:1D:7E:28:1A:D9 client-id=GXAXDalmauRadio1 server=dhcp-wlan3
add address=10.138.163.70 mac-address=00:1D:7E:27:F4:E7 client-id=GXAIsernRadio1 server=dhcp-wlan3
#
: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
#
# Radio#: 3 GXACampST-Ciber
/interface wireless set wlan4 name="wlan4" \
radio-name="GXACampST-Ciber" mode=ap-bridge ssid="guifi.net-GXACampST-Ciber" \
band="5ghz" \
frequency-mode=regulatory-domain country=spain antenna-gain=14 \
frequency=5540 \
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_GXACentreST" master-interface=wlan4 wds-address=00:1D:7D:38:F7:7B disabled=no
/ ip address add address=172.25.10.22/30 network=172.25.10.20 broadcast=172.25.10.23 interface=wds_GXACentreST disabled=no comment="wds_GXACentreST"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_GXACentreST] do={/routing ospf interface remove $i;}
add interface=wds_GXACentreST
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.20/30] do={/routing ospf network remove $i;}
add network=172.25.10.20/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=GXACentreST] do={/routing bgp peer remove $i;}
add name="GXACentreST" instance=default remote-address=172.25.10.21 remote-as=4125 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
/ interface wireless wds
add name="wds_VicPlacaEnllacos" master-interface=wlan4 wds-address=00:0B:6B:4F:7A:EB disabled=yes
/ ip address add address=172.25.10.213/30 network=172.25.10.212 broadcast=172.25.10.215 interface=wds_VicPlacaEnllacos disabled=yes comment="wds_VicPlacaEnllacos"
/ routing ospf interface
:foreach i in [/routing ospf interface find interface=wds_VicPlacaEnllacos] do={/routing ospf interface remove $i;}
add interface=wds_VicPlacaEnllacos
/ routing ospf network
:foreach i in [/routing ospf network find network=172.25.10.212/30] do={/routing ospf network remove $i;}
add network=172.25.10.212/30 area=backbone disabled=no
/ routing bgp peer
:foreach i in [find name=VicPlacaEnllacos] do={/routing bgp peer remove $i;}
add name="VicPlacaEnllacos" instance=default remote-address=172.25.10.214 remote-as=2707 \
multihop=no route-reflect=no ttl=default in-filter=ebgp-in out-filter=ebgp-out disabled=yes
#
:delay 1
#
# Routed device
#
# Other cable connections
#
# 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.163.1 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.163.1 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=4124 router-id=10.138.163.1 \
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.163.1 distribute-default=never redistribute-connected=no \
redistribute-static=no redistribute-rip=no redistribute-bgp=as-type-1
#
:log info "Unsolclic for 4124-GXACampST executed."
/