Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have recently started working with Asp.NET. I have decided to build a captive portal for windows as my first Asp.NET project.

Currently I am confused with the hardware requirements for a captive portal.

I have a normal home router and a laptop. The router is connected to INTERNET and my laptop is connected to the router.

When a user wants to access internet he/she connects to the router and as soon as they browse they are redirected to an authentication page being hosted on my laptop.

Once the user is authenticated and allowed access he should be able to surf the net.

My question is how do i reroute user from my laptop (after authentication) back to the router(internet gateway) to surf the internet.

I hope my question is clear.

Below is a diagram that might give you a clear idea

enter image description here

share|improve this question

closed as off topic by SvW, EEAA, RolandoMySQLDBA, mdpc, Michael Hampton Apr 5 '13 at 23:45

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

A router that sends people to a captive portal often uses a firewall that looks for a flag, or can check a user's MAC, or any number of other methods to see if they have been properly authenticated, to decide where they are routed.

The logic is simple (maybe not this simple though),

if user != authenticated -> captive portal; else -> internet;.

A route in a captive portal is not static, the firewall makes that logic check quite often, and will route the user's connection based upon the current state of the user.

Some just intercept the DNS traffic, some intercept HTTP traffic, some route/redirect everything.

share|improve this answer
    
I am completely aware of how to code a script to detect MAC address and so forth. The laptop will act as a firewall but what I need to know is how to reroute requests after authentication from the laptop back to the router –  crazyghost Apr 5 '13 at 14:53
    
I don't think I was answering as if you didn't. I was just trying to illustrate that it's the firewall on the original router that makes the decision to send you to the captive portal or to the internet.. therefor, only 1 router needed :) –  NickW Apr 5 '13 at 14:55
    
Sorry if I was too blunt but I didn't mean to offend. My question still stands if I use one router how do i reroute requests back to the router from my laptop –  crazyghost Apr 5 '13 at 14:58
    
Your router and laptop should be in the same network, or in different networks with routers in between. the first situation is more normal usually. The client behind the router is behind NAT, so the laptop sees requests as if they come directly from the router, and it can respond to it in the same manner (locally, via a router, or the internet). I forgot to mention the NAT masquerading. –  NickW Apr 5 '13 at 15:03
    
Well let me be more clear 1) all requests are forwarded from the router to the laptop. 2) laptop authenticates 3) if approved the request is forwarded from Laptop to router(INTERNET GATEWAY) I am having trouble in this last step, how do I do it –  crazyghost Apr 5 '13 at 15:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.