Below is the config.
apr/03/2017 09:23:24 by RouterOS 6.38.5
software id = W746-N7NR
/interface bridge
add name=WAN
/interface ethernet
set [ find default-name=ether4 ] comment="ether4 - Firewall Content Filtering (Trunk)" name=Firewall
set [ find default-name=sfp-sfpplus2 ] comment="sfp-sfpplus2 - LAN (Trunk)" name=LAN speed=1Gbps
set [ find default-name=sfp-sfpplus1 ] comment="sfp-sfpplus1 - ISP 1" name=WAN-Out
/interface vlan
add interface=Firewall name="FW to MK" vlan-id=1001
add arp=reply-only interface=LAN name="Free WiFi" vlan-id=122
add arp=reply-only interface=LAN name="Office WiFi" vlan-id=121
add interface=Firewall name="MK to FW" vlan-id=1000
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip dhcp-server option
add code=138 name="EAP Adoption" value="'10.30.10.203'"
/ip hotspot profile
add hotspot-address=10.121.255.254 login-by=https,http-pap,mac-cookie name="Office WiFi" use-radius=yes
add hotspot-address=10.122.255.254 html-directory=freewifi login-by=https,http-pap name="Free WiFi" use-radius=yes
/ip hotspot
add disabled=no interface="Office WiFi" keepalive-timeout=5m login-timeout=5m name="hs-Office WiFi" profile="Office WiFi"
add disabled=no interface="Free WiFi" keepalive-timeout=5m login-timeout=5m name="hs-Free WiFi" profile="Free WiFi"
/ip hotspot user profile
set [ find default=yes ] keepalive-timeout=5m session-timeout=10m shared-users=10000
/ip ipsec proposal
set [ find default=yes ] enc-algorithms=aes-128-cbc
add auth-algorithms=sha256 enc-algorithms=aes-128-cbc name=IPSec_to_DC pfs-group=none
/ip pool
add name="Office WiFi" ranges=10.121.0.1-10.121.255.253
add name="Free WiFi" ranges=10.122.0.1-10.122.255.253
add name=MGMT ranges=10.1.5.160-10.1.5.170
/ip dhcp-server
add add-arp=yes address-pool="Office WiFi" authoritative=yes disabled=no interface="Office WiFi" lease-time=2d name="Office WiFi"
add add-arp=yes address-pool="Free WiFi" authoritative=yes disabled=no interface="Free WiFi" lease-time=2h name="Free WiFi"
add address-pool=MGMT authoritative=yes disabled=no interface=LAN lease-time=5m name=WEMA-MGMT
/queue type
set 4 kind=pcq pcq-burst-rate=15M pcq-classifier=dst-address pcq-limit=100KiB pcq-rate=10M pcq-total-limit=4000000KiB
add kind=pcq name=free_wifi-pcq_download pcq-classifier=dst-address pcq-dst-address6-mask=64 pcq-rate=6144k pcq-src-address6-mask=64 pcq-total-limit=10000KiB
add kind=pcq name=free_wifi-pcq_upload pcq-classifier=src-address pcq-dst-address6-mask=64 pcq-rate=6144k pcq-src-address6-mask=64 pcq-total-limit=10000KiB
set 7 pcq-rate=6144k pcq-total-limit=250000KiB
set 8 pcq-burst-rate=25M pcq-rate=20M pcq-total-limit=250000KiB
/queue simple
add name="Free wifi" queue=free_wifi-pcq_upload/free_wifi-pcq_download target="Free WiFi"
add disabled=yes name=Office_Wifi priority=4/4 queue=pcq-upload-default/pcq-download-default target="Office WiFi" total-queue=pcq-download-default
/queue tree
add max-limit=4G name="Total Download" parent=global queue=default
add max-limit=3500M name="Office WiFi Priority4" packet-mark=Office_WiFi parent="Total Download" priority=4 queue=pcq-download-default
add max-limit=250M name="Free WiFi Priority8" packet-mark=Free_WiFi parent="Total Download" queue=pcq-download-default
add name="Total Upload" parent=global priority=4 queue=default
add name=Office_Wifi_Upload packet-mark=Office_WiFi_Upload parent="Total Upload" priority=4 queue=pcq-upload-default
add name=Free_Wifi_Upload packet-mark=Free_WiFi_Upload parent="Total Upload" priority=4 queue=free_wifi-pcq_upload
/interface bridge port
add bridge=WAN interface=ether7
add bridge=WAN interface=ether8
add bridge=WAN interface=WAN-Out
add bridge=WAN interface=ether1
/ip address
add address=10.1.5.254/23 comment=MGMT interface=LAN network=10.1.4.0
add address=10.121.255.254/16 comment="Office WiFi" interface="Office WiFi" network=10.121.0.0
add address=10.122.255.254/16 comment="Free WiFi" interface="Free WiFi" network=10.122.0.0
add address=xxx.xxx.xxx.xxx/30 comment="ISP 1" interface=WAN network=xxx.xxx.xxx.xxx
add address=192.168.100.2/24 comment="Free Wifi to Firewall" interface="MK to FW" network=192.168.100.0
add address=192.168.101.1/24 comment="Firewall to WAN" interface="FW to MK" network=192.168.101.0
add address=xxx.xxx.xxx.xxx.37.97/29 comment="ISP 1 - Public LAN" interface=WAN network=xxx.xxx.xxx.xxx
/ip cloud
set ddns-enabled=yes
/ip dhcp-server network
add address=10.1.4.0/23 dhcp-option="EAP Adoption" gateway=10.1.5.254
add address=10.121.0.0/16 dns-server=10.121.255.254 gateway=10.121.255.254 netmask=16
add address=10.122.0.0/16 dns-server=10.122.255.254 gateway=10.122.255.254 netmask=16
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip firewall filter
add action=drop chain=input comment="Drop DNS request from WAN interface" dst-port=53 in-interface=WAN protocol=udp
add action=drop chain=input dst-port=53 in-interface=WAN protocol=tcp
add action=accept chain=input comment=IPSec-ESP dst-port=500 protocol=udp src-port=500
add action=accept chain=input comment=IPSec-ESP protocol=ipsec-esp
add action=accept chain=output comment=IPSec-ESP protocol=ipsec-esp
add action=jump chain=forward comment="Detect DDos Attack and Drop DDoS Traffic" connection-state=new disabled=yes jump-target=detect-ddos
add action=return chain=detect-ddos disabled=yes dst-limit=32,32,src-and-dst-addresses/10s
add action=add-dst-to-address-list address-list=ddosed address-list-timeout=10m chain=detect-ddos disabled=yes
add action=add-src-to-address-list address-list=ddoser address-list-timeout=10m chain=detect-ddos disabled=yes
add action=drop chain=forward connection-state=new disabled=yes dst-address-list=ddosed src-address-list=ddoser
add action=add-src-to-address-list address-list="port scanners" address-list-timeout=2w chain=input comment=" Port scanners to list" in-interface=WAN protocol=tcp psd=21,3s,3,1
add action=add-src-to-address-list address-list="port scanners" address-list-timeout=2w chain=input comment="NMAP FIN Stealth scan" in-interface=WAN protocol=tcp tcp-flags=fin,!syn,!rst,!psh,!ack,!urg
add action=add-src-to-address-list address-list="port scanners" address-list-timeout=2w chain=input comment="SYN/FIN scan" in-interface=WAN protocol=tcp tcp-flags=fin,syn
add action=add-src-to-address-list address-list="port scanners" address-list-timeout=2w chain=input comment="SYN/RST scan" in-interface=WAN protocol=tcp tcp-flags=syn,rst
add action=add-src-to-address-list address-list="port scanners" address-list-timeout=2w chain=input comment="FIN/PSH/URG scan" in-interface=WAN protocol=tcp tcp-flags=fin,psh,urg,!syn,!rst,!ack
add action=add-src-to-address-list address-list="port scanners" address-list-timeout=2w chain=input comment="ALL/ALL scan" in-interface=WAN protocol=tcp tcp-flags=fin,syn,rst,psh,ack,urg
add action=add-src-to-address-list address-list="port scanners" address-list-timeout=2w chain=input comment="NMAP NULL scan" in-interface=WAN protocol=tcp tcp-flags=!fin,!syn,!rst,!psh,!ack,!urg
add action=drop chain=input comment="Drop port scanners" in-interface=WAN src-address-list="port scanners"
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
/ip firewall mangle
add action=mark-routing chain=prerouting comment="Free WiFi route to Firewall (Content Filtering)" new-routing-mark=to_FW passthrough=no src-address=10.122.0.0/16
inactive time
add action=mark-packet chain=postrouting comment="Mark Free WiFi Download traffic (Sunday)" new-packet-mark=Limit_Free_WiFi out-interface="Free WiFi" passthrough=no time=0s-1d,sun
inactive time
add action=mark-packet chain=prerouting comment="Mark Free WiFi Upload traffic (Sunday) " in-interface="Free WiFi" new-packet-mark=Limit_Free_WiFi_Upload passthrough=no time=0s-1d,sun
inactive time
add action=mark-packet chain=postrouting comment="Mark Free WiFi Download traffic (Monday-Saturday 00:00 to 09:00)" new-packet-mark=Limit_Free_WiFi out-interface="Free WiFi" passthrough=no time=
0s-9h,mon,tue,wed,thu,fri,sat
inactive time
add action=mark-packet chain=prerouting comment="Mark Free WiFi Upload traffic (Monday-Saturday 00:00 to 09:00)" in-interface="Free WiFi" new-packet-mark=Limit_Free_WiFi_Upload passthrough=no time=
0s-9h,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=postrouting comment="Mark Free WiFi Download traffic (Monday-Saturday 09:00 to 19:00)" new-packet-mark=Free_WiFi out-interface="Free WiFi" passthrough=no time=
9h-19h,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=prerouting comment="Mark Free WiFi Upload traffic (Monday-Saturday 09:00 to 19:00)" in-interface="Free WiFi" new-packet-mark=Free_WiFi_Upload passthrough=no time=
9h-19h,mon,tue,wed,thu,fri,sat
inactive time
add action=mark-packet chain=postrouting comment="Mark Free WiFi Download traffic (Monday-Saturday 19:00 to 24:00)" new-packet-mark=Limit_Free_WiFi out-interface="Free WiFi" passthrough=no time=
19h-1d,mon,tue,wed,thu,fri,sat
inactive time
add action=mark-packet chain=prerouting comment="Mark Free WiFi Upload traffic (Monday-Saturday 19:00 to 24:00)" in-interface="Free WiFi" new-packet-mark=Limit_Free_WiFi_Upload passthrough=no time=
19h-1d,mon,tue,wed,thu,fri,sat
add action=mark-packet chain=postrouting comment="Mark Office WiFi Download traffic" new-packet-mark=Office_WiFi out-interface="Office WiFi" passthrough=no
add action=mark-packet chain=prerouting comment="Mark Office WiFi Upoload traffic" in-interface="Office WiFi" new-packet-mark=Office_WiFi_Upload passthrough=no
/ip firewall nat
add action=accept chain=srcnat comment="No NAT for ISP1 Public LAN addresses" src-address=xxx.xxx.xxx.xxx/29
add action=accept chain=srcnat dst-address=xxx.xxx.xxx.xxx/29
add action=accept chain=srcnat comment="IPSec VPN - From WEMA-MGMT to Kiwire Network" dst-address=10.20.10.0/24 out-interface=WAN src-address=10.1.4.0/23
add action=accept chain=srcnat comment="IPSec VPN - From WEMA-MGMT to EAP Controller Network" dst-address=10.30.10.0/24 out-interface=WAN src-address=10.1.4.0/23
add action=dst-nat chain=dstnat comment="SSH port forward to network switches" dst-address=xxx.xxx.xxx.xxx dst-port=10200 protocol=tcp to-addresses=10.1.5.200 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10201 protocol=tcp to-addresses=10.1.5.201 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10202 protocol=tcp to-addresses=10.1.5.202 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10203 protocol=tcp to-addresses=10.1.5.203 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10204 protocol=tcp to-addresses=10.1.5.204 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10205 protocol=tcp to-addresses=10.1.5.205 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10206 protocol=tcp to-addresses=10.1.5.206 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10207 protocol=tcp to-addresses=10.1.5.207 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10208 protocol=tcp to-addresses=10.1.5.208 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10209 protocol=tcp to-addresses=10.1.5.209 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10210 protocol=tcp to-addresses=10.1.5.210 to-ports=22
add action=dst-nat chain=dstnat dst-address=xxx.xxx.xxx.xxx dst-port=10211 protocol=tcp to-addresses=10.1.5.211 to-ports=22
add action=masquerade chain=srcnat out-interface=WAN
add action=passthrough chain=unused-hs-chain comment="place hotspot rules here" disabled=yes
add action=masquerade chain=srcnat comment="masquerade hotspot network" src-address=10.121.0.0/16
add action=masquerade chain=srcnat comment="masquerade hotspot network" src-address=10.122.0.0/16
add action=masquerade chain=srcnat comment="Allow FW to MK traffic go to internet" src-address=192.168.101.0/24
/ip hotspot ip-binding
add address=10.121.0.0/16 server="hs-Office WiFi"
add address=10.122.0.0/16 server="hs-Free WiFi"
add address=0.0.0.0/0 type=blocked
/ip hotspot walled-garden
add comment="place hotspot rules here" disabled=yes
/ip hotspot walled-garden ip
add action=accept disabled=no dst-address=10.20.10.203
add action=accept disabled=no src-address=10.20.10.203
/ip ipsec peer
Unsafe configuration, suggestion to use certificates
add address=xxx.xxx.xxx.xxx/32 dpd-interval=10s enc-algorithm=aes-128 exchange-mode=aggressive hash-algorithm=sha256 nat-traversal=no secret=xxxxxxxxxx
/ip ipsec policy
add dst-address=10.20.10.0/24 level=unique proposal=IPSec_to_DC sa-dst-address=xxx.xxx.xxx.xxx sa-src-address=xxx.xxx.xxx.xxx src-address=10.1.4.0/23 tunnel=yes
add dst-address=10.30.10.0/24 level=unique proposal=IPSec_to_DC sa-dst-address=xxx.xxx.xxx.xxx sa-src-address=xxx.xxx.xxx.xxx src-address=10.1.4.0/23 tunnel=yes
/ip route
add check-gateway=ping distance=2 gateway=192.168.100.1 routing-mark=to_FW
add check-gateway=ping distance=1 gateway=xxx.xxx.xxx.xxx
add distance=1 dst-address=10.20.10.0/24 gateway=LAN
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www port=10080
set ssh port=4101
/lcd
set enabled=no touch-screen=disabled
/radius
add address=10.20.10.203 secret=xxxxxxx service=hotspot timeout=3s
/radius incoming
set accept=yes
/system clock
set time-zone-name=Asia/Singapore
/system identity
set name=WEMA-MK
/system ntp client
set enabled=yes primary-ntp=218.186.3.36 secondary-ntp=203.174.83.202
/tool graphing interface
add interface=WAN
add
add interface="Office WiFi"
add interface="Free WiFi"
/tool graphing resource
add