Layer-3 hotspot mode

In most simple on-premise deployments, HSG controls hotspot access in layer-2 mode - HSG tracks per client session based on a combination of client device MAC and IP addresses. In layer-2 mode, the clients sit in the same network as the HSG hotspot instance LAN/VLAN interface, and HSG has visibility on both client MAC and IP.

But in some more complex deployments, where the clients could come from a different internal network, eg. 

Senario #1 is particularly true for services provides managing many customers using a central HSG (each customer maps to a dedicated hotspot instance within HSG), and each customer network is connected via a VPN tunnel back to central HSG.

In above scenarios, clients traffic routes across a layer 3 network before reaching to HSG, and HSG can only "see" client IP address in each request (the client MAC will be rewritten to downstream router MAC when routed across the router), so HSG can only control client access in layer 3 mode by tracking client IP address, because client MAC is no longer visible to HSG.

Below topology elaborates scenario #2. and it's similar for #1 (instead of a layer 3 router, it could be a intranet WAN/MPLS/VPN network).

Important notes for running in layer-3 mode:

Sample config on HSG

-------------------------------------------------

HSG# show running-config !hostname HSG!interface eth0 description "Connection to WAN" enable ip address dhcp!interface eth1 description "Connection to LAN" enable!interface eth2 description OOB-Mgmt enable ip address 10.10.10.1/24 dhcp-server  dns 8.8.8.8 8.8.4.4  range 10.10.10.10 10.10.10.20!interface eth3!interface vlan 1 10 description "transit hotspot VLAN" enable ip address 172.16.10.1/24!interface loopback enable ip address 2.1.2.1/32!ip dhcp-server start!ip name-server 8.8.8.8 8.8.4.4ip host macc.ransnet.com 2.1.2.1 rewriteip host mail 127.0.0.1ip host mysqldb 127.0.0.1ip host splash.ransnet.com 2.1.2.1 rewrite!ip ntp-server 203.211.159.1 62.201.225.9!!make sure you have route for client networksip route 172.16.20.0/24 nexthop 172.16.10.2!macc start!firewall-dnat 10 redirect all udp dport 53 rdport 53 src 10.0.0.0/8 remark "rewrite DNS from LAN only"firewall-dnat 12 redirect all udp dport 53 rdport 53 src 192.168.0.0/16 remark "rewrite DNS from LAN only"!firewall-input 10 permit all tcp dport 80 src 10.0.0.0/8 remark "portal access"firewall-input 11 permit all tcp dport 80 src 192.168.0.0/16 remark "portal access"firewall-input 21 permit all udp dport 53 src 10.0.0.0/8 remark "allow DNS from LAN only"firewall-input 22 permit all udp dport 53 src 192.168.0.0/16 remark "allow DNS from LAN only"firewall-input 31 permit all tcp dport 22 src 10.0.0.0/8 remark "allow SSH from LAN only"firewall-input 32 permit all tcp dport 22 src 192.168.0.0/16 remark "allow SSH from LAN only"!firewall-access 10 permit outbound eth0!firewall-snat 10 overload outbound eth0!security radius-server client 127.0.0.1 key testing123 name LOCAL start!security hotspot vlan10!enable layer3 mode (default layer2) hotspot-mode layer3 hotspot-wan eth0 hotspot-server 172.16.10.1 ports 5000 5001!network range must supersede all client subnets if there're multiple client VLANs client-network 172.16.0.0 255.255.0.0 client-static 172.16.0.0 255.255.0.0 bypass-domain list  dn akamaihd.net  dn facebook.com  dn facebook.net  dn fbcdn.net  dn y5zone.sg hotspot-portal https://splash.ransnet.com/pid/vlan10/login.php startHSG# HSG# show security hotspot clients Client-MAC           Client-IP        Username                  %/MaxUp      %/MaxDown    Idle/Max     Duration/Max------[vlan10    ]--------------------------------------------------------------------------------------------------..NA..               172.16.20.6      yingde@gmail.com          0%/0         0%/0         0/0          35/0        HSG# show security hotspot clientsClient-MAC           Client-IP        Username                  %/MaxUp      %/MaxDown    Idle/Max     Duration/Max------[vlan10    ]--------------------------------------------------------------------------------------------------..NA..               172.16.20.7      demouser                  0%/0         0%/0         1/0          6/0         ..NA..               172.16.20.6      xxxx@gmail.com            0%/0         0%/0         0/0          65/0        

NOTE: layer3 mode has no visibility on client MAC address.

-------------------------------------------------

Sample config on router (can be any other 3rd-party router)

-------------------------------------------------

!hostname core-router!interface eth0 enable!interface eth1 description "DHCP for AP management" enable ip address 192.168.9.1/24 dhcp-server  range 192.168.9.2 192.168.9.254!interface vlan 0 10 description "transit hotspot VLAN" enable ip address 172.16.10.2/24!interface vlan 1 20 description "user VLAN" enable ip address 172.16.20.1/24 dhcp-server  range 172.16.20.2 172.16.20.254!ip dhcp-server start!ip default-gateway 172.16.10.1!