Hotspot portal against external DHCP Server

Long time listener first time caller. So I figured I’d solicit the help of the forums with this little issue I have. After a week of beating my head against the desk, and eventually finding myself rocking back and forth in the corner of my office attempting to dig my way out with a plastic spork, I’ve given up hope and turned to the experts.

Yes the common courtesy seems to be to print out a boatload of configs or fancy diagrams bit I figured at this point a fancy diagram isn’t going to take place of simple words and too much configs might be a bad idea. So you just tell me what you request for configs and I’ll dump what’s necessary to the forums.

This is what I have: 7 RB435G’s setup currently as wireless bridges spread throughout a large building. Due to the layout of the network (don’t shoot the messenger) we have an…interesting vlan setup on the other switches/routers which looks like this:

Wireless Mgmnt (AP’s) 810 - 10.8.10.x
Wireless Employees: 820 - 10.8.20.x
Wireless Guests: 830 - 10.8.30.x

By adding wireless mgmnt and wireless employee’s (or guests at this point, it doesn’t matter) to vlan, then bridging wlan1 and vlan-guest. Adding an address to the bridged interface, IP’s are successfully handed out via our external dhcp server (gateway of 10.8.20.1, 10.8.30.1 depending on which vlan I attach to the bridge). Now that’s not the problem..it works, I celebrated with copious amounts of coffee.

Here’s the kicker. I have now been tasked with creating hotspot with radius authentication (once again, doesn’t seem to be a problem). Successfully setup Usermanger with radius authentication and all of that fun stuff..but I digress. If I setup a wireless hotspot listening on the bridged interface (wireless-bridge) and either enable or disable default forward on the wireless interface with a local DHCP server on the RB436G I get hit with the hotspot portal (success!), clients authenticate and life goes on.

Now before I go on and further confuse you, maybe I have the pools setup incorrectly (but yet it works). Because the VLANs on this network are Required in order to get out of the network (forced on both the 8206 switch and our firewall), I’ve had to create two separate pools for the hotspot. The default hotspot pool is pool-guest which gets a 10.8.69.xxx address for unauthenticated guests. Once a client has successfully authenticated they get a 10.8.30.x address in the pool.

So if your still with me and haven’t started drooling uncontrollably…Wirelss AP’s work with a 10.8.30.1 gatway, Hotspots work with a DHCP server setup locally (clients gateway is 10.8.30.58 which is the wireless-bridge ip address, go figure). Now if I setup a dhcp relay to point to our external dhcp server and issue a 10.8.30.1 gatway..nadda, zip, zilch, bumpkis. Clients don’t get the authentication page, nothing. However they do get a dhcp address from the external server, I can see it on the server side and the client gets a proper address. They successfully get stuck in the 10.8.69.x pool (pool-guest) awaiting authentication but can’t get a proper route, nor can I navigate to the 10.8.30.58 hotspot portal with said gateway.

At this point I’m thinking it’s a mix of firewall and/or routing on the AP.

Here’s what I want to accomplish: These clients are a mix of laptops, ipads, android tablets and all sorts of mysterious wireless devices. Because of this they will be roaming around. I figured if I could setup a centralized dhcp server on a mikrotik device that has a single pool then each hotspot with just pool-guest and a set static gateway of 10.8.30.1 then the clients, as they roam should be able to get through each access point they hit.

Am I doing something wrong? Have I created a black hole to the end of the universe? Please help, as i’m at the end of my leash and currently entertaining the idea of attempting the French can-can dance on top of my desk to Orpheus in the Underworld if it would make this work.

Okay so I think I’ve got somewhere else with this. I’ve disabled all the pools for the hotspot guest and authenticated user (pool-guest & pool-auth). By doing this the external dhcp server can issue a gateway of the mikrotik and clients can authenticate and get out. Problem is I have 7 mikrotiks spread throughout the building so this isn’t going to work, I need the default route of 10.8.30.1 setup (route of the main switch). Now I think I’ve gotten somewhere though (yay!). I’ve narrowed it down to Filter rules, if I remove all the filter rules I can set the default gateway to 10.8.30.1 on the dhcp server, clients can pull an address down, authenticate and navigate to their hearts content..but alas, no filter rules..this feels like a bad thing. Filter rules enabled and I get hit by the reject hs-unauth rule which makes no sense. So alas here’s some configs for you to ponder:

 #   ADDRESS            NETWORK         INTERFACE                                                                                                                                                             
 0   10.8.10.57/24      10.8.10.0       ether1                                                                                                                                                                
 1   10.8.30.58/24      10.8.30.0       wireless-bridge



 0 R  vlan-guest                                                                             1500 enabled        830 ether1



 0  R name="wireless-bridge" mtu=1500 l2mtu=1516 arp=enabled mac-address=00:0C:42:BB:B5:7E protocol-mode=none priority=0x8000 auto-mac=yes admin-mac=00:00:00:00:00:00 max-message-age=20s forward-delay=15s 
      transmit-hold-count=6 ageing-time=5m 

 #    INTERFACE                                                                              BRIDGE                                                                             PRIORITY  PATH-COST    HORIZON
 0    wlan1                                                                                  wireless-bridge                                                                        0x80         10       none
 1    vlan-guest                                                                             wireless-bridge                                                                        0x80         10       none

/interface bridge settings set bridge firewall is enabled.

0   chain=forward action=jump jump-target=hs-unauth hotspot=from-client,!auth 

 1   chain=forward action=jump jump-target=hs-unauth-to hotspot=to-client,!auth 

 2   chain=input action=jump jump-target=hs-input hotspot=from-client 

 3 I chain=hs-input action=jump jump-target=pre-hs-input 

 4   chain=hs-input action=accept protocol=udp dst-port=64872 

 5   chain=hs-input action=accept protocol=tcp dst-port=64872-64875 

 6   chain=hs-input action=jump jump-target=hs-unauth hotspot=!auth 

 7   chain=hs-unauth action=return protocol=icmp 

 8   chain=hs-unauth action=return protocol=tcp dst-address=10.8.30.58 dst-port=80 

 9   chain=hs-unauth action=reject reject-with=tcp-reset protocol=tcp 

10   chain=hs-unauth action=reject reject-with=icmp-net-prohibited 

11   chain=hs-unauth-to action=return protocol=icmp 

12   chain=hs-unauth-to action=return protocol=tcp src-address=10.8.30.58 src-port=80 

13   chain=hs-unauth action=reject reject-with=icmp-host-prohibited



    admin@MikroTik] /ip firewall nat> print all
Flags: X - disabled, I - invalid, D - dynamic 
 0 D chain=dstnat action=jump jump-target=hotspot hotspot=from-client 

 1 D chain=hotspot action=jump jump-target=pre-hotspot 

 2 D chain=hotspot action=redirect to-ports=64872 protocol=udp dst-port=53 

 3 D chain=hotspot action=redirect to-ports=64872 protocol=tcp dst-port=53 

 4 D chain=hotspot action=redirect to-ports=64873 protocol=tcp hotspot=local-dst dst-port=80 

 5 D chain=hotspot action=redirect to-ports=64875 protocol=tcp hotspot=local-dst dst-port=443 

 6 D chain=hotspot action=jump jump-target=hs-unauth protocol=tcp hotspot=!auth 

 7 D chain=hotspot action=jump jump-target=hs-auth protocol=tcp hotspot=auth 

 8 D chain=hs-unauth action=return protocol=tcp dst-port=53 

 9 D chain=hs-unauth action=redirect to-ports=64874 protocol=tcp dst-port=80 

10 D chain=hs-unauth action=redirect to-ports=64874 protocol=tcp dst-port=3128 

11 D chain=hs-unauth action=redirect to-ports=64874 protocol=tcp dst-port=8080 

12 D chain=hs-unauth action=redirect to-ports=64875 protocol=tcp dst-port=443 

13 I chain=hs-unauth action=jump jump-target=hs-smtp protocol=tcp dst-port=25 

14 D chain=hs-auth action=redirect to-ports=64874 protocol=tcp hotspot=http 

15 I chain=hs-auth action=jump jump-target=hs-smtp protocol=tcp dst-port=25 

16 X ;;; place hotspot rules here
     chain=unused-hs-chain action=passthrough 

17   chain=pre-hotspot action=accept hotspot=auth 

18   chain=pre-hotspot action=accept protocol=udp dst-port=53 

19   chain=pre-hotspot action=accept protocol=tcp dst-port=53 

20 X chain=srcnat action=accept src-address=10.8.30.0/24 out-interface=ether1

I’ve also setup udp/tcp 53 in walled garden.

Any help would be appreciated.

Hi,

great Thread :slight_smile: … did you find any Solution for this Problem ?