How do captive portal network connections work? The 2019 Stack Overflow Developer Survey Results Are InHow does the captive portal redirect work behind the scenesLinux static dhcp ip for visitor access internet without requesting MAC address?RADIUS hardware on the client side?Running a VPN server and a captive portal on the same machine with a DNS tooDo I need two routers to build a captive portalSuggestions required on how to allow users access to WiFi Captive Portals when roamingCaptive portal setup with minimal hardware requirementsCaptive portal with iptables and local dns serverIdeally, how should HSTS / SSL Everywhere / Let's encrypt work with captive Wifi portals?Auto-trigger captive portal agreement page displayTrigger agreement page automatically when connecting to Captive Portal

Button changing it's text & action. Good or terrible?

Should I use my personal e-mail address, or my workplace one, when registering to external websites for work purposes?

Why was M87 targetted for the Event Horizon Telescope instead of Sagittarius A*?

Is a "Democratic" Feudal System Possible?

Why is the maximum length of OpenWrt’s root password 8 characters?

Does a dangling wire really electrocute me if I'm standing in water?

Write faster on AT24C32

Am I thawing this London Broil safely?

Identify boardgame from Big movie

Multiply Two Integer Polynomials

How to deal with fear of taking dependencies

Why do UK politicians seemingly ignore opinion polls on Brexit?

The difference between dialogue marks

Is "plugging out" electronic devices an American expression?

Deal with toxic manager when you can't quit

Protecting Dualbooting Windows from dangerous code (like rm -rf)

Building a conditional check constraint

Falsification in Math vs Science

Would the motor reverse if phases swapped for this case?

Statement true because not provable

Shouldn't "much" here be used instead of "more"?

Is bread bad for ducks?

What does ひと匙 mean in this manga and has it been used colloquially?

For what reasons would an animal species NOT cross a *horizontal* land bridge?



How do captive portal network connections work?



The 2019 Stack Overflow Developer Survey Results Are InHow does the captive portal redirect work behind the scenesLinux static dhcp ip for visitor access internet without requesting MAC address?RADIUS hardware on the client side?Running a VPN server and a captive portal on the same machine with a DNS tooDo I need two routers to build a captive portalSuggestions required on how to allow users access to WiFi Captive Portals when roamingCaptive portal setup with minimal hardware requirementsCaptive portal with iptables and local dns serverIdeally, how should HSTS / SSL Everywhere / Let's encrypt work with captive Wifi portals?Auto-trigger captive portal agreement page displayTrigger agreement page automatically when connecting to Captive Portal



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








7















Internet access at hotels, airports cafes is often gated by a captive portal which forces you to a particular web page on first use, for example a payment page or some page to accept a terms of service or an authentication/authorization page. You see this with both wireless and wired connections.



How does this work?










share|improve this question



















  • 1





    Kinda like this, but not done for evil. ex-parrot.com/~pete/upside-down-ternet.html

    – Zoredache
    Mar 12 '12 at 7:49

















7















Internet access at hotels, airports cafes is often gated by a captive portal which forces you to a particular web page on first use, for example a payment page or some page to accept a terms of service or an authentication/authorization page. You see this with both wireless and wired connections.



How does this work?










share|improve this question



















  • 1





    Kinda like this, but not done for evil. ex-parrot.com/~pete/upside-down-ternet.html

    – Zoredache
    Mar 12 '12 at 7:49













7












7








7


2






Internet access at hotels, airports cafes is often gated by a captive portal which forces you to a particular web page on first use, for example a payment page or some page to accept a terms of service or an authentication/authorization page. You see this with both wireless and wired connections.



How does this work?










share|improve this question
















Internet access at hotels, airports cafes is often gated by a captive portal which forces you to a particular web page on first use, for example a payment page or some page to accept a terms of service or an authentication/authorization page. You see this with both wireless and wired connections.



How does this work?







internet captive-portal wifi






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 12 '12 at 1:12







Howiecamp

















asked Mar 12 '12 at 0:26









HowiecampHowiecamp

2721816




2721816







  • 1





    Kinda like this, but not done for evil. ex-parrot.com/~pete/upside-down-ternet.html

    – Zoredache
    Mar 12 '12 at 7:49












  • 1





    Kinda like this, but not done for evil. ex-parrot.com/~pete/upside-down-ternet.html

    – Zoredache
    Mar 12 '12 at 7:49







1




1





Kinda like this, but not done for evil. ex-parrot.com/~pete/upside-down-ternet.html

– Zoredache
Mar 12 '12 at 7:49





Kinda like this, but not done for evil. ex-parrot.com/~pete/upside-down-ternet.html

– Zoredache
Mar 12 '12 at 7:49










3 Answers
3






active

oldest

votes


















13














It certainly varies by vendor of the wireless product but in my experience it usually works something like this:



  1. Your laptop makes a wireless connection to an intelligent access point, which may be connected to a centralized management station.

  2. Your first web request is intercepted and replied to with a Location: header that redirects you to a login/policy page (e.g. http://hotelwireless.net/login). This might live directly on the intelligent access point, or on a central management station.

  3. Once you've completed authentication, your MAC address is added to a list of allowed clients causing future requests to be correctly routed to the Internet, or accessible Intranet resources.

With regards to what to call it, I've heard it referred to as a "captive portal" or "wireless access portal" most frequently.






share|improve this answer


















  • 2





    I have also seen it using dns, so the first dns query will be resolved to the login/policy page.

    – Niko S P
    Mar 12 '12 at 1:19






  • 1





    Are you looking to set one up? There are some quick, easy and secure linux distros like pfSense that you can deploy in less than an hour.

    – G Koe
    Mar 12 '12 at 2:39






  • 1





    How does the client side work? Windows 10, upon getting such a wifi connection, will launch default browser to go to the portal. Android 5 phones will launch a Sign-in to Network app (not the default browser) which basically just show that portal page. Is there a new protocol involved? What are its specifications?

    – Old Geezer
    Jan 4 '16 at 14:49











  • I know it's an old post, but how do you intercept juts the first web request (or rather web requests until the user has authenticated by some means like clicking a button) ?

    – Dominik
    Feb 11 '16 at 0:57


















4














First for achieving the redirection, you need an inline authenticator (access controller).
In context of your topic, you will need a Wireless lan controller if you opt for central management of AP. OR you can also place a captive portal type of network access controller with Wall garden features.



NAS monitors the traffic entering the downlink (client side) through promiscuous mode raw socket and when the browser initiated traffic for a unauthenticated client is detected a HTTP redirection is given to it as response. So browser on receiving gets redirected to our CAPTIVE portal homepage, which can be hosted inline on authenticator or out of box at some external web server.



The sole work of this page is to provide user a UI to enter credentials. the credentials entered are forwarded back to the authenticator Daemon like chilli in case of coova chilli, futher these credentials are passed as radius request to the RADIUS server or may be checked locally. Upon successful authentication the state of the client at authenticator is marked authorized and client is granted access.



How Redirection is achieved



The most widely used approach is to intercept the HTTP request initiated by user and 302 code as response to client. In chilli it is done via below function



http_redirect2() 

cat < < EOF
HTTP/1.1 302 Redirect

Location: $1

Set-Cookie: PORTAL_SESSIONID=$PORTAL_SESSIONID

Set-Cookie: COOVA_USERURL=$COOVA_USERURL

Connection: close

EOF
exit




This redirection can be easily achieved pragmatically controlled tun tap interface to client side interface which intercepts client traffic.
Further redirection can be achieved via DNS poisoning too but may sometimes cause problem if responses got cached at client browser.
Further things can be done more specifically according to the problem domain. I can help you with that if you want.






share|improve this answer
































    0














    There is a great description of this at https://www.arubanetworks.com/vrd/GuestAccessAppNote/wwhelp/wwhimpl/js/html/wwhelp.htm.



    Here's part of it:




    Captive Portal Authentication Process



    Captive portal is a Layer 3 authentication, which requires that the devices connect to the network and obtain an IP address and related DNS information before authenticating through the captive portal. The following steps explain the entire captive portal process when the native ArubaOS is used for captive portal authentication:



    1.
    The device that is associating to the guest SSID is assigned an initial role (guest-logon role in the example configuration). This initial role allows DHCP, so the user gets an IP address.



    2.
    The user opens a browser and makes an HTTP (or HTTPS) request to some destination (for example, www.bbc.com).



    3.
    The resolver in the device sends a DNS request to resolve the www.bbc.com. The initial role (guest-logon role) permits DNS services, so the resolver can communicate with the DNS server.



    4.
    The DNS server replies with the correct address to www.bbc.com.



    5.
    The resolver tells the browser which IP address to use based on the DNS reply.



    6.
    The browser initiates a TCP connection to port 80 of the www.bbc.com address.



    7.
    The controller intercepts the connection and spoofs the initial TCP handshakes of the HTTP process. At this moment, the client browser thinks it is communicating with the bbc.com server.



    8.
    When the browser sends the HTTP GET request for the web page, the controller replies saying that bbc.com has “temporarily moved” to .



    9.
    The browser closes the connection.



    10.
    The browser attempts to connect with , but it first needs to send a DNS request for the address.



    11.
    The actual DNS server responds that it cannot resolve
    https://securelogin.arubanetworks.com, but the controller intercepts that reply and changes the packet to say that securelogin.arubanetworks.com is at the IP address of the controller itself. Remember that it is critical that the DNS server sends back a reply to the query. It is only then that the controller can spoof the reply back from the DNS server. Sending a DNS request without receiving a reply is not sufficient, since without a reply the controller will never help the client resolve securelogin.arubanetworks.com.



    12.
    The browser initiates an HTTPS connection to address of controller, which responds with the captive portal login page, where the guest authenticates.



    13.
    After successful authentication, the user is assigned the post authentication role (auth-guest role in the example configuration). This is the default role in the captive portal profile.



    14.
    After authentication, the browser is redirected to bbc.com at the address originally resolved by the DNS. Alternatively, if a welcome page is configured, the browser is redirected to the welcome page.



    15.
    To successfully redirect to the original web page the controller spoofs a reply from bbc.com to tell the client that bbc.com has “permanently moved” to bbc.com. This step corrects the “temporary relocation” that occurred as part of the captive portal login.



    16.
    This causes the client to re-query DNS for the address of www.bbc.com.



    17.
    The browser starts to communicate with the actual bbc.com server.







    share|improve this answer








    New contributor




    ratskin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.




















      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "2"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f368644%2fhow-do-captive-portal-network-connections-work%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      13














      It certainly varies by vendor of the wireless product but in my experience it usually works something like this:



      1. Your laptop makes a wireless connection to an intelligent access point, which may be connected to a centralized management station.

      2. Your first web request is intercepted and replied to with a Location: header that redirects you to a login/policy page (e.g. http://hotelwireless.net/login). This might live directly on the intelligent access point, or on a central management station.

      3. Once you've completed authentication, your MAC address is added to a list of allowed clients causing future requests to be correctly routed to the Internet, or accessible Intranet resources.

      With regards to what to call it, I've heard it referred to as a "captive portal" or "wireless access portal" most frequently.






      share|improve this answer


















      • 2





        I have also seen it using dns, so the first dns query will be resolved to the login/policy page.

        – Niko S P
        Mar 12 '12 at 1:19






      • 1





        Are you looking to set one up? There are some quick, easy and secure linux distros like pfSense that you can deploy in less than an hour.

        – G Koe
        Mar 12 '12 at 2:39






      • 1





        How does the client side work? Windows 10, upon getting such a wifi connection, will launch default browser to go to the portal. Android 5 phones will launch a Sign-in to Network app (not the default browser) which basically just show that portal page. Is there a new protocol involved? What are its specifications?

        – Old Geezer
        Jan 4 '16 at 14:49











      • I know it's an old post, but how do you intercept juts the first web request (or rather web requests until the user has authenticated by some means like clicking a button) ?

        – Dominik
        Feb 11 '16 at 0:57















      13














      It certainly varies by vendor of the wireless product but in my experience it usually works something like this:



      1. Your laptop makes a wireless connection to an intelligent access point, which may be connected to a centralized management station.

      2. Your first web request is intercepted and replied to with a Location: header that redirects you to a login/policy page (e.g. http://hotelwireless.net/login). This might live directly on the intelligent access point, or on a central management station.

      3. Once you've completed authentication, your MAC address is added to a list of allowed clients causing future requests to be correctly routed to the Internet, or accessible Intranet resources.

      With regards to what to call it, I've heard it referred to as a "captive portal" or "wireless access portal" most frequently.






      share|improve this answer


















      • 2





        I have also seen it using dns, so the first dns query will be resolved to the login/policy page.

        – Niko S P
        Mar 12 '12 at 1:19






      • 1





        Are you looking to set one up? There are some quick, easy and secure linux distros like pfSense that you can deploy in less than an hour.

        – G Koe
        Mar 12 '12 at 2:39






      • 1





        How does the client side work? Windows 10, upon getting such a wifi connection, will launch default browser to go to the portal. Android 5 phones will launch a Sign-in to Network app (not the default browser) which basically just show that portal page. Is there a new protocol involved? What are its specifications?

        – Old Geezer
        Jan 4 '16 at 14:49











      • I know it's an old post, but how do you intercept juts the first web request (or rather web requests until the user has authenticated by some means like clicking a button) ?

        – Dominik
        Feb 11 '16 at 0:57













      13












      13








      13







      It certainly varies by vendor of the wireless product but in my experience it usually works something like this:



      1. Your laptop makes a wireless connection to an intelligent access point, which may be connected to a centralized management station.

      2. Your first web request is intercepted and replied to with a Location: header that redirects you to a login/policy page (e.g. http://hotelwireless.net/login). This might live directly on the intelligent access point, or on a central management station.

      3. Once you've completed authentication, your MAC address is added to a list of allowed clients causing future requests to be correctly routed to the Internet, or accessible Intranet resources.

      With regards to what to call it, I've heard it referred to as a "captive portal" or "wireless access portal" most frequently.






      share|improve this answer













      It certainly varies by vendor of the wireless product but in my experience it usually works something like this:



      1. Your laptop makes a wireless connection to an intelligent access point, which may be connected to a centralized management station.

      2. Your first web request is intercepted and replied to with a Location: header that redirects you to a login/policy page (e.g. http://hotelwireless.net/login). This might live directly on the intelligent access point, or on a central management station.

      3. Once you've completed authentication, your MAC address is added to a list of allowed clients causing future requests to be correctly routed to the Internet, or accessible Intranet resources.

      With regards to what to call it, I've heard it referred to as a "captive portal" or "wireless access portal" most frequently.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Mar 12 '12 at 0:49









      Kyle SmithKyle Smith

      8,62512530




      8,62512530







      • 2





        I have also seen it using dns, so the first dns query will be resolved to the login/policy page.

        – Niko S P
        Mar 12 '12 at 1:19






      • 1





        Are you looking to set one up? There are some quick, easy and secure linux distros like pfSense that you can deploy in less than an hour.

        – G Koe
        Mar 12 '12 at 2:39






      • 1





        How does the client side work? Windows 10, upon getting such a wifi connection, will launch default browser to go to the portal. Android 5 phones will launch a Sign-in to Network app (not the default browser) which basically just show that portal page. Is there a new protocol involved? What are its specifications?

        – Old Geezer
        Jan 4 '16 at 14:49











      • I know it's an old post, but how do you intercept juts the first web request (or rather web requests until the user has authenticated by some means like clicking a button) ?

        – Dominik
        Feb 11 '16 at 0:57












      • 2





        I have also seen it using dns, so the first dns query will be resolved to the login/policy page.

        – Niko S P
        Mar 12 '12 at 1:19






      • 1





        Are you looking to set one up? There are some quick, easy and secure linux distros like pfSense that you can deploy in less than an hour.

        – G Koe
        Mar 12 '12 at 2:39






      • 1





        How does the client side work? Windows 10, upon getting such a wifi connection, will launch default browser to go to the portal. Android 5 phones will launch a Sign-in to Network app (not the default browser) which basically just show that portal page. Is there a new protocol involved? What are its specifications?

        – Old Geezer
        Jan 4 '16 at 14:49











      • I know it's an old post, but how do you intercept juts the first web request (or rather web requests until the user has authenticated by some means like clicking a button) ?

        – Dominik
        Feb 11 '16 at 0:57







      2




      2





      I have also seen it using dns, so the first dns query will be resolved to the login/policy page.

      – Niko S P
      Mar 12 '12 at 1:19





      I have also seen it using dns, so the first dns query will be resolved to the login/policy page.

      – Niko S P
      Mar 12 '12 at 1:19




      1




      1





      Are you looking to set one up? There are some quick, easy and secure linux distros like pfSense that you can deploy in less than an hour.

      – G Koe
      Mar 12 '12 at 2:39





      Are you looking to set one up? There are some quick, easy and secure linux distros like pfSense that you can deploy in less than an hour.

      – G Koe
      Mar 12 '12 at 2:39




      1




      1





      How does the client side work? Windows 10, upon getting such a wifi connection, will launch default browser to go to the portal. Android 5 phones will launch a Sign-in to Network app (not the default browser) which basically just show that portal page. Is there a new protocol involved? What are its specifications?

      – Old Geezer
      Jan 4 '16 at 14:49





      How does the client side work? Windows 10, upon getting such a wifi connection, will launch default browser to go to the portal. Android 5 phones will launch a Sign-in to Network app (not the default browser) which basically just show that portal page. Is there a new protocol involved? What are its specifications?

      – Old Geezer
      Jan 4 '16 at 14:49













      I know it's an old post, but how do you intercept juts the first web request (or rather web requests until the user has authenticated by some means like clicking a button) ?

      – Dominik
      Feb 11 '16 at 0:57





      I know it's an old post, but how do you intercept juts the first web request (or rather web requests until the user has authenticated by some means like clicking a button) ?

      – Dominik
      Feb 11 '16 at 0:57













      4














      First for achieving the redirection, you need an inline authenticator (access controller).
      In context of your topic, you will need a Wireless lan controller if you opt for central management of AP. OR you can also place a captive portal type of network access controller with Wall garden features.



      NAS monitors the traffic entering the downlink (client side) through promiscuous mode raw socket and when the browser initiated traffic for a unauthenticated client is detected a HTTP redirection is given to it as response. So browser on receiving gets redirected to our CAPTIVE portal homepage, which can be hosted inline on authenticator or out of box at some external web server.



      The sole work of this page is to provide user a UI to enter credentials. the credentials entered are forwarded back to the authenticator Daemon like chilli in case of coova chilli, futher these credentials are passed as radius request to the RADIUS server or may be checked locally. Upon successful authentication the state of the client at authenticator is marked authorized and client is granted access.



      How Redirection is achieved



      The most widely used approach is to intercept the HTTP request initiated by user and 302 code as response to client. In chilli it is done via below function



      http_redirect2() 

      cat < < EOF
      HTTP/1.1 302 Redirect

      Location: $1

      Set-Cookie: PORTAL_SESSIONID=$PORTAL_SESSIONID

      Set-Cookie: COOVA_USERURL=$COOVA_USERURL

      Connection: close

      EOF
      exit




      This redirection can be easily achieved pragmatically controlled tun tap interface to client side interface which intercepts client traffic.
      Further redirection can be achieved via DNS poisoning too but may sometimes cause problem if responses got cached at client browser.
      Further things can be done more specifically according to the problem domain. I can help you with that if you want.






      share|improve this answer





























        4














        First for achieving the redirection, you need an inline authenticator (access controller).
        In context of your topic, you will need a Wireless lan controller if you opt for central management of AP. OR you can also place a captive portal type of network access controller with Wall garden features.



        NAS monitors the traffic entering the downlink (client side) through promiscuous mode raw socket and when the browser initiated traffic for a unauthenticated client is detected a HTTP redirection is given to it as response. So browser on receiving gets redirected to our CAPTIVE portal homepage, which can be hosted inline on authenticator or out of box at some external web server.



        The sole work of this page is to provide user a UI to enter credentials. the credentials entered are forwarded back to the authenticator Daemon like chilli in case of coova chilli, futher these credentials are passed as radius request to the RADIUS server or may be checked locally. Upon successful authentication the state of the client at authenticator is marked authorized and client is granted access.



        How Redirection is achieved



        The most widely used approach is to intercept the HTTP request initiated by user and 302 code as response to client. In chilli it is done via below function



        http_redirect2() 

        cat < < EOF
        HTTP/1.1 302 Redirect

        Location: $1

        Set-Cookie: PORTAL_SESSIONID=$PORTAL_SESSIONID

        Set-Cookie: COOVA_USERURL=$COOVA_USERURL

        Connection: close

        EOF
        exit




        This redirection can be easily achieved pragmatically controlled tun tap interface to client side interface which intercepts client traffic.
        Further redirection can be achieved via DNS poisoning too but may sometimes cause problem if responses got cached at client browser.
        Further things can be done more specifically according to the problem domain. I can help you with that if you want.






        share|improve this answer



























          4












          4








          4







          First for achieving the redirection, you need an inline authenticator (access controller).
          In context of your topic, you will need a Wireless lan controller if you opt for central management of AP. OR you can also place a captive portal type of network access controller with Wall garden features.



          NAS monitors the traffic entering the downlink (client side) through promiscuous mode raw socket and when the browser initiated traffic for a unauthenticated client is detected a HTTP redirection is given to it as response. So browser on receiving gets redirected to our CAPTIVE portal homepage, which can be hosted inline on authenticator or out of box at some external web server.



          The sole work of this page is to provide user a UI to enter credentials. the credentials entered are forwarded back to the authenticator Daemon like chilli in case of coova chilli, futher these credentials are passed as radius request to the RADIUS server or may be checked locally. Upon successful authentication the state of the client at authenticator is marked authorized and client is granted access.



          How Redirection is achieved



          The most widely used approach is to intercept the HTTP request initiated by user and 302 code as response to client. In chilli it is done via below function



          http_redirect2() 

          cat < < EOF
          HTTP/1.1 302 Redirect

          Location: $1

          Set-Cookie: PORTAL_SESSIONID=$PORTAL_SESSIONID

          Set-Cookie: COOVA_USERURL=$COOVA_USERURL

          Connection: close

          EOF
          exit




          This redirection can be easily achieved pragmatically controlled tun tap interface to client side interface which intercepts client traffic.
          Further redirection can be achieved via DNS poisoning too but may sometimes cause problem if responses got cached at client browser.
          Further things can be done more specifically according to the problem domain. I can help you with that if you want.






          share|improve this answer















          First for achieving the redirection, you need an inline authenticator (access controller).
          In context of your topic, you will need a Wireless lan controller if you opt for central management of AP. OR you can also place a captive portal type of network access controller with Wall garden features.



          NAS monitors the traffic entering the downlink (client side) through promiscuous mode raw socket and when the browser initiated traffic for a unauthenticated client is detected a HTTP redirection is given to it as response. So browser on receiving gets redirected to our CAPTIVE portal homepage, which can be hosted inline on authenticator or out of box at some external web server.



          The sole work of this page is to provide user a UI to enter credentials. the credentials entered are forwarded back to the authenticator Daemon like chilli in case of coova chilli, futher these credentials are passed as radius request to the RADIUS server or may be checked locally. Upon successful authentication the state of the client at authenticator is marked authorized and client is granted access.



          How Redirection is achieved



          The most widely used approach is to intercept the HTTP request initiated by user and 302 code as response to client. In chilli it is done via below function



          http_redirect2() 

          cat < < EOF
          HTTP/1.1 302 Redirect

          Location: $1

          Set-Cookie: PORTAL_SESSIONID=$PORTAL_SESSIONID

          Set-Cookie: COOVA_USERURL=$COOVA_USERURL

          Connection: close

          EOF
          exit




          This redirection can be easily achieved pragmatically controlled tun tap interface to client side interface which intercepts client traffic.
          Further redirection can be achieved via DNS poisoning too but may sometimes cause problem if responses got cached at client browser.
          Further things can be done more specifically according to the problem domain. I can help you with that if you want.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Oct 20 '16 at 1:54









          Weaver

          1,857912




          1,857912










          answered Oct 17 '16 at 10:50









          8zero2.ops8zero2.ops

          54728




          54728





















              0














              There is a great description of this at https://www.arubanetworks.com/vrd/GuestAccessAppNote/wwhelp/wwhimpl/js/html/wwhelp.htm.



              Here's part of it:




              Captive Portal Authentication Process



              Captive portal is a Layer 3 authentication, which requires that the devices connect to the network and obtain an IP address and related DNS information before authenticating through the captive portal. The following steps explain the entire captive portal process when the native ArubaOS is used for captive portal authentication:



              1.
              The device that is associating to the guest SSID is assigned an initial role (guest-logon role in the example configuration). This initial role allows DHCP, so the user gets an IP address.



              2.
              The user opens a browser and makes an HTTP (or HTTPS) request to some destination (for example, www.bbc.com).



              3.
              The resolver in the device sends a DNS request to resolve the www.bbc.com. The initial role (guest-logon role) permits DNS services, so the resolver can communicate with the DNS server.



              4.
              The DNS server replies with the correct address to www.bbc.com.



              5.
              The resolver tells the browser which IP address to use based on the DNS reply.



              6.
              The browser initiates a TCP connection to port 80 of the www.bbc.com address.



              7.
              The controller intercepts the connection and spoofs the initial TCP handshakes of the HTTP process. At this moment, the client browser thinks it is communicating with the bbc.com server.



              8.
              When the browser sends the HTTP GET request for the web page, the controller replies saying that bbc.com has “temporarily moved” to .



              9.
              The browser closes the connection.



              10.
              The browser attempts to connect with , but it first needs to send a DNS request for the address.



              11.
              The actual DNS server responds that it cannot resolve
              https://securelogin.arubanetworks.com, but the controller intercepts that reply and changes the packet to say that securelogin.arubanetworks.com is at the IP address of the controller itself. Remember that it is critical that the DNS server sends back a reply to the query. It is only then that the controller can spoof the reply back from the DNS server. Sending a DNS request without receiving a reply is not sufficient, since without a reply the controller will never help the client resolve securelogin.arubanetworks.com.



              12.
              The browser initiates an HTTPS connection to address of controller, which responds with the captive portal login page, where the guest authenticates.



              13.
              After successful authentication, the user is assigned the post authentication role (auth-guest role in the example configuration). This is the default role in the captive portal profile.



              14.
              After authentication, the browser is redirected to bbc.com at the address originally resolved by the DNS. Alternatively, if a welcome page is configured, the browser is redirected to the welcome page.



              15.
              To successfully redirect to the original web page the controller spoofs a reply from bbc.com to tell the client that bbc.com has “permanently moved” to bbc.com. This step corrects the “temporary relocation” that occurred as part of the captive portal login.



              16.
              This causes the client to re-query DNS for the address of www.bbc.com.



              17.
              The browser starts to communicate with the actual bbc.com server.







              share|improve this answer








              New contributor




              ratskin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.
























                0














                There is a great description of this at https://www.arubanetworks.com/vrd/GuestAccessAppNote/wwhelp/wwhimpl/js/html/wwhelp.htm.



                Here's part of it:




                Captive Portal Authentication Process



                Captive portal is a Layer 3 authentication, which requires that the devices connect to the network and obtain an IP address and related DNS information before authenticating through the captive portal. The following steps explain the entire captive portal process when the native ArubaOS is used for captive portal authentication:



                1.
                The device that is associating to the guest SSID is assigned an initial role (guest-logon role in the example configuration). This initial role allows DHCP, so the user gets an IP address.



                2.
                The user opens a browser and makes an HTTP (or HTTPS) request to some destination (for example, www.bbc.com).



                3.
                The resolver in the device sends a DNS request to resolve the www.bbc.com. The initial role (guest-logon role) permits DNS services, so the resolver can communicate with the DNS server.



                4.
                The DNS server replies with the correct address to www.bbc.com.



                5.
                The resolver tells the browser which IP address to use based on the DNS reply.



                6.
                The browser initiates a TCP connection to port 80 of the www.bbc.com address.



                7.
                The controller intercepts the connection and spoofs the initial TCP handshakes of the HTTP process. At this moment, the client browser thinks it is communicating with the bbc.com server.



                8.
                When the browser sends the HTTP GET request for the web page, the controller replies saying that bbc.com has “temporarily moved” to .



                9.
                The browser closes the connection.



                10.
                The browser attempts to connect with , but it first needs to send a DNS request for the address.



                11.
                The actual DNS server responds that it cannot resolve
                https://securelogin.arubanetworks.com, but the controller intercepts that reply and changes the packet to say that securelogin.arubanetworks.com is at the IP address of the controller itself. Remember that it is critical that the DNS server sends back a reply to the query. It is only then that the controller can spoof the reply back from the DNS server. Sending a DNS request without receiving a reply is not sufficient, since without a reply the controller will never help the client resolve securelogin.arubanetworks.com.



                12.
                The browser initiates an HTTPS connection to address of controller, which responds with the captive portal login page, where the guest authenticates.



                13.
                After successful authentication, the user is assigned the post authentication role (auth-guest role in the example configuration). This is the default role in the captive portal profile.



                14.
                After authentication, the browser is redirected to bbc.com at the address originally resolved by the DNS. Alternatively, if a welcome page is configured, the browser is redirected to the welcome page.



                15.
                To successfully redirect to the original web page the controller spoofs a reply from bbc.com to tell the client that bbc.com has “permanently moved” to bbc.com. This step corrects the “temporary relocation” that occurred as part of the captive portal login.



                16.
                This causes the client to re-query DNS for the address of www.bbc.com.



                17.
                The browser starts to communicate with the actual bbc.com server.







                share|improve this answer








                New contributor




                ratskin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






















                  0












                  0








                  0







                  There is a great description of this at https://www.arubanetworks.com/vrd/GuestAccessAppNote/wwhelp/wwhimpl/js/html/wwhelp.htm.



                  Here's part of it:




                  Captive Portal Authentication Process



                  Captive portal is a Layer 3 authentication, which requires that the devices connect to the network and obtain an IP address and related DNS information before authenticating through the captive portal. The following steps explain the entire captive portal process when the native ArubaOS is used for captive portal authentication:



                  1.
                  The device that is associating to the guest SSID is assigned an initial role (guest-logon role in the example configuration). This initial role allows DHCP, so the user gets an IP address.



                  2.
                  The user opens a browser and makes an HTTP (or HTTPS) request to some destination (for example, www.bbc.com).



                  3.
                  The resolver in the device sends a DNS request to resolve the www.bbc.com. The initial role (guest-logon role) permits DNS services, so the resolver can communicate with the DNS server.



                  4.
                  The DNS server replies with the correct address to www.bbc.com.



                  5.
                  The resolver tells the browser which IP address to use based on the DNS reply.



                  6.
                  The browser initiates a TCP connection to port 80 of the www.bbc.com address.



                  7.
                  The controller intercepts the connection and spoofs the initial TCP handshakes of the HTTP process. At this moment, the client browser thinks it is communicating with the bbc.com server.



                  8.
                  When the browser sends the HTTP GET request for the web page, the controller replies saying that bbc.com has “temporarily moved” to .



                  9.
                  The browser closes the connection.



                  10.
                  The browser attempts to connect with , but it first needs to send a DNS request for the address.



                  11.
                  The actual DNS server responds that it cannot resolve
                  https://securelogin.arubanetworks.com, but the controller intercepts that reply and changes the packet to say that securelogin.arubanetworks.com is at the IP address of the controller itself. Remember that it is critical that the DNS server sends back a reply to the query. It is only then that the controller can spoof the reply back from the DNS server. Sending a DNS request without receiving a reply is not sufficient, since without a reply the controller will never help the client resolve securelogin.arubanetworks.com.



                  12.
                  The browser initiates an HTTPS connection to address of controller, which responds with the captive portal login page, where the guest authenticates.



                  13.
                  After successful authentication, the user is assigned the post authentication role (auth-guest role in the example configuration). This is the default role in the captive portal profile.



                  14.
                  After authentication, the browser is redirected to bbc.com at the address originally resolved by the DNS. Alternatively, if a welcome page is configured, the browser is redirected to the welcome page.



                  15.
                  To successfully redirect to the original web page the controller spoofs a reply from bbc.com to tell the client that bbc.com has “permanently moved” to bbc.com. This step corrects the “temporary relocation” that occurred as part of the captive portal login.



                  16.
                  This causes the client to re-query DNS for the address of www.bbc.com.



                  17.
                  The browser starts to communicate with the actual bbc.com server.







                  share|improve this answer








                  New contributor




                  ratskin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.










                  There is a great description of this at https://www.arubanetworks.com/vrd/GuestAccessAppNote/wwhelp/wwhimpl/js/html/wwhelp.htm.



                  Here's part of it:




                  Captive Portal Authentication Process



                  Captive portal is a Layer 3 authentication, which requires that the devices connect to the network and obtain an IP address and related DNS information before authenticating through the captive portal. The following steps explain the entire captive portal process when the native ArubaOS is used for captive portal authentication:



                  1.
                  The device that is associating to the guest SSID is assigned an initial role (guest-logon role in the example configuration). This initial role allows DHCP, so the user gets an IP address.



                  2.
                  The user opens a browser and makes an HTTP (or HTTPS) request to some destination (for example, www.bbc.com).



                  3.
                  The resolver in the device sends a DNS request to resolve the www.bbc.com. The initial role (guest-logon role) permits DNS services, so the resolver can communicate with the DNS server.



                  4.
                  The DNS server replies with the correct address to www.bbc.com.



                  5.
                  The resolver tells the browser which IP address to use based on the DNS reply.



                  6.
                  The browser initiates a TCP connection to port 80 of the www.bbc.com address.



                  7.
                  The controller intercepts the connection and spoofs the initial TCP handshakes of the HTTP process. At this moment, the client browser thinks it is communicating with the bbc.com server.



                  8.
                  When the browser sends the HTTP GET request for the web page, the controller replies saying that bbc.com has “temporarily moved” to .



                  9.
                  The browser closes the connection.



                  10.
                  The browser attempts to connect with , but it first needs to send a DNS request for the address.



                  11.
                  The actual DNS server responds that it cannot resolve
                  https://securelogin.arubanetworks.com, but the controller intercepts that reply and changes the packet to say that securelogin.arubanetworks.com is at the IP address of the controller itself. Remember that it is critical that the DNS server sends back a reply to the query. It is only then that the controller can spoof the reply back from the DNS server. Sending a DNS request without receiving a reply is not sufficient, since without a reply the controller will never help the client resolve securelogin.arubanetworks.com.



                  12.
                  The browser initiates an HTTPS connection to address of controller, which responds with the captive portal login page, where the guest authenticates.



                  13.
                  After successful authentication, the user is assigned the post authentication role (auth-guest role in the example configuration). This is the default role in the captive portal profile.



                  14.
                  After authentication, the browser is redirected to bbc.com at the address originally resolved by the DNS. Alternatively, if a welcome page is configured, the browser is redirected to the welcome page.



                  15.
                  To successfully redirect to the original web page the controller spoofs a reply from bbc.com to tell the client that bbc.com has “permanently moved” to bbc.com. This step corrects the “temporary relocation” that occurred as part of the captive portal login.



                  16.
                  This causes the client to re-query DNS for the address of www.bbc.com.



                  17.
                  The browser starts to communicate with the actual bbc.com server.








                  share|improve this answer








                  New contributor




                  ratskin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  ratskin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered Apr 6 at 14:46









                  ratskinratskin

                  1011




                  1011




                  New contributor




                  ratskin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  ratskin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  ratskin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Server Fault!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f368644%2fhow-do-captive-portal-network-connections-work%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

                      What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

                      Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos