is there an  easy ubuntu server redirect / captive portal software?

Posted on 2011-10-30
Last Modified: 2013-12-06

I have an office file/webserver running on ubuntu server. I have a small company employee info site. Is there an easy way to set up a captive portal for internal/intranet traffic to go to that portal first and then be sent to the internet? I don't require authentication, although if I had it, it would have to check against a pop3 server as this current setup does not use AD (which I will change soon). I also have clearOS and a centOS server but I can not use the centOS since its a centralized syslog server. I can make another centOS if needed.


Question by:kaosmadness
    LVL 31

    Expert Comment

    You can redirect the traffic using NAT.  On Redhat/CentOS you can use IPtables to accomplish this.
    Search transparent proxy
    You can also do so my setting the proxy settings in the web browser

    Author Comment

    Thanks... I did not want to "redirect them per se" but if they open a captive portal would taken them to my until they click on terms and conditions or they authenticate. Kinda like at Starbucks or something.
    LVL 19

    Expert Comment

    This isn't a function of the webserver - normally what happens is the DHCP server hands out an IP of a DNS server which is set up to respond to any query, no matter for what name, to a single IP, that of your captive portal.

    Then the captive portal authorizes the user, bashes the IP of the client against the DHCP server to get the mac address, and then puts a custom config into the DHCP server that says "okay, now mac address so and so gets these other DNS servers and they are now put in a routable profile that will let them get to the Internet"  Then it'll flush the lease and redirect the user to the original URL, which causes the user to apply for a new lease and gets the new enabled profile.

    There are some other network appliance means of accomplishing this, but none of it actually is done by your web server - the web server just answers requests that are pushed its way.

    As to farzanj's comment, you can redirect traffic using NAT, but only if all your users have a gateway of your Linux router - if they're not actually routing through your Linux box, there's no way to actually push them where you need to be.

    If all of your user's web browsers are set to use a proxy server (which of course, they could disable) then you could run a squid proxy and do certain rules to push the users into your captive portal too.  But keep in mind, its very defeatable.
    LVL 39

    Accepted Solution

    I gues you mean something like:

    Author Closing Comment

    Thanks!! I have coova chill installed!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
    You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now