Skip to content

Instantly share code, notes, and snippets.

@PatrickLang
Last active November 24, 2017 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatrickLang/77dd89f71ddff4b72afa552ec2f9e523 to your computer and use it in GitHub Desktop.
Save PatrickLang/77dd89f71ddff4b72afa552ec2f9e523 to your computer and use it in GitHub Desktop.

hAP AC lite

This is currently passing traffic through either wireless interface and appears to be favoring wlan2 (5ghz). I can get up to 98.4Mbps from a LAN port through the NAT to another node on my network with file copies.

This has two wireless interfaces and 5 ethernet ports. Ether1 and both wlan are used for "internet". The others are bridged on LAN side since there isn't an internal switch.

# mar/12/2017 23:27:35 by RouterOS 6.36.4
`#
/interface bridge
add admin-mac=6C:3B:6B:86:AB:A3 auto-mac=no comment=defconf name=bridge
/interface ethernet
set [ find default-name=ether2 ] name=ether2-master
set [ find default-name=ether3 ] master-port=ether2-master
set [ find default-name=ether4 ] master-port=ether2-master
set [ find default-name=ether5 ] master-port=ether2-master
/ip neighbor discovery
set ether1 discover=no
`set bridge comment=defconf
/interface wireless security-profiles
add authentication-types=wpa2-psk group-ciphers=tkip,aes-ccm management-protection=allowed mode=dynamic-keys name=bean unicast-ciphers=tkip,aes-ccm \
    wpa2-pre-shared-key="<removed>"
/interface wireless
set [ find default-name=wlan1 ] disabled=no distance=indoors frequency=2417 security-profile=bean ssid=bean wireless-protocol=802.11
set [ find default-name=wlan2 ] band=5ghz-a/n channel-width=20/40mhz-eC disabled=no distance=indoors frequency=5765 security-profile=bean ssid=bean \
    wireless-protocol=802.11
/ip pool
add name=dhcp ranges=192.168.88.10-192.168.88.254
`/ip dhcp-server
add address-pool=dhcp disabled=no interface=bridge name=defconf
/interface bridge port
add bridge=bridge comment=defconf interface=ether2-master
add comment=defconf disabled=yes interface=wlan1
add comment=defconf interface=wlan2
/ip address
add address=192.168.88.1/24 comment=defconf interface=ether2-master network=192.168.88.0
/ip dhcp-client
add comment=defconf dhcp-options=hostname,clientid disabled=no interface=ether1

add default-route-distance=0 dhcp-options=hostname,clientid disabled=no interface=wlan1
add default-route-distance=0 dhcp-options=hostname,clientid disabled=no interface=wlan2
/ip dhcp-server network
add address=192.168.88.0/24 comment=defconf gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.88.1 name=router
/ip firewall filter
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept established,related" connection-state=established,related
add action=drop chain=input comment="defconf: drop all from WAN" in-interface=all-wireless
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related" connection-state=established,related
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=forward comment="defconf:  drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface=\
    all-wireless
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" out-interface=wlan1
add action=masquerade chain=srcnat out-interface=wlan2 out-interface-list=all
/system clock
set time-zone-name=America/Los_Angeles
/system routerboard settings
set cpu-frequency=650MHz protected-routerboot=disabled
/tool mac-server
set [ find default=yes ] disabled=yes
add interface=bridge
/tool mac-server mac-winbox
set [ find default=yes ] disabled=yes
add interface=bridge

mAP lite

one wlan, one ethernet port. DHCP enabled on the ether1 interface as "LAN"

Applying this could cause you to lose the connection. I got to this state by adding an address and dhcp-server on ether1 for 192.168.89.1/24. Connected to that, then removed the dhcp-server from wlan1.

# nov/24/2017 14:53:09 by RouterOS 6.37.4
#
/interface wireless
set [ find default-name=wlan1 ] band=2ghz-b/g/n disabled=no distance=indoors frequency=2427 ssid=IssaquahCoffee wireless-protocol=802.11
/ip neighbor discovery
set wlan1 discover=no
/ip hotspot profile
set [ find default=yes ] html-directory=flash/hotspot
/ip pool
add name=dhcp ranges=192.168.89.10-192.168.89.254
/ip dhcp-server
add address-pool=dhcp disabled=no interface=ether1 name=dhcp1
/ip address
add address=192.168.89.1/24 comment=defconf interface=ether1 network=192.168.89.0
/ip dhcp-client
add default-route-distance=0 dhcp-options=hostname,clientid disabled=no interface=wlan1
/ip dhcp-server network
add address=192.168.89.0/24 comment=defconf gateway=192.168.89.1
/ip dns
set allow-remote-requests=yes
/ip dns static
add address=192.168.89.1 name=router
/ip firewall filter
add action=accept chain=input comment="defconf: accept ICMP" protocol=icmp
add action=accept chain=input comment="defconf: accept established,related" connection-state=established,related
add action=fasttrack-connection chain=forward comment="defconf: fasttrack" connection-state=established,related
add action=accept chain=forward comment="defconf: accept established,related" connection-state=established,related
add action=drop chain=forward comment="defconf: drop invalid" connection-state=invalid
add action=drop chain=input comment="defconf: drop all from WAN" in-interface=all-wireless
add action=drop chain=forward comment="defconf:  drop all from WAN not DSTNATed" connection-nat-state=!dstnat connection-state=new in-interface=all-wireless
/ip firewall nat
add action=masquerade chain=srcnat comment="defconf: masquerade" out-interface=wlan1
/ip service
set telnet disabled=yes
set ftp disabled=yes
set www address=192.168.89.0/24
set ssh address=192.168.89.0/24
set api address=192.168.89.0/24
set winbox address=192.168.89.0/24
set api-ssl address=192.168.89.0/24
/system clock
set time-zone-name=America/Los_Angeles
/system routerboard settings
set cpu-frequency=650MHz
/tool mac-server
set [ find default=yes ] disabled=yes
add interface=wlan1
/tool mac-server mac-winbox
set [ find default=yes ] disabled=yes
add interface=wlan1
  • Not sure if those firewall rules are complete or not. Should review later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment