Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Wifi Captive Portal Using Raspberry Pi

Wifi Captive Portal Using Raspberry Pi

Aniket Maithani

September 04, 2017
Tweet

More Decks by Aniket Maithani

Other Decks in Technology

Transcript

  1. About Me My name is Aniket Maithani. I'll keep this

    short • Works @Radiowalla Network Pvt. Ltd • Handles Development & Dev-Ops • B.Tech (CS&E) graduate from Amity University, Noida (UP) • Loves to travel • Blog during free time • Cricket Lover • "CHAI" addict • Plays Guitar too!
  2. Definition : A captive portal is a Web page that

    the user of a public-access network is obliged to view and interact with before access is granted. Captive portals are typically used by business centers, airports, hotel lobbies, coffee shops, and other venues that offer free Wi-Fi hot spots for Internet users.
  3. - You need a page identifying it is your business

    and your Wi-Fi network - Using Data to Improve the User Experience - Allowing user’s to accept Terms and Condition for usage.
  4. Well let’s simplify things - In order to have a

    fully functional Captive Portal we need following things - ROUTER with CUSTOM OS / SOFTWARE - WIFI Enabled Access - ACCESS TO INTERNET [OF COURSE!]
  5. Raspberry Pi [ as a router] The Raspberry Pi is

    a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. Hence just like a normal computer you can turn Raspberry Pi into a router all you need is external wifi adapter and bit of configuration on the device.
  6. Tornado ? Tornado is a Python web framework and asynchronous

    networking library, originally developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user.
  7. So let’s dive into a problem statement. - Mr. Rawat

    owns a cafe and most of the evenings are quite hectic for him since there is a huge line of customer he needs to serve. - Recently, he has been seeing some drop in the customer check-in during the evening time. - On inquiring he came to know that his place doesn’t have an internet access. - Mr. Rawat now wants to install Hotspot in his location and also wants to show advertisements/offers when a user gets connected to the wifi hotspot.
  8. RASPBERRY PI WITH WI-FI Dongle External Internet Connection Internal Wi-Fi

    Adapter as a Base Station Running Tornado coupled with IPSet and IPTables for Traffic Management. Includes HOSTAPD and DHCP Configurations
  9. User Connects to the Open Wifi with a given SSID.

    Request gets passed onto the machine IP Traffic Rules in the machines blocks requests to external side temporarily User is redirected to inbuilt captive portal. Authentication / OTP Page If Auth = Success { Internet_access: “granted” }
  10. Let’s fuel up the machine - To get started we

    need Rasberry-Pi machine with Raspbian Wheezy installed in it. - For better performance we can use premium grade SD Card Class 10 for this. - The easy way is download Raspbian Image from [https://www.raspberrypi.org/downloads/] and burn it on the SD card using software like etcher.
  11. Once done - Plug the device. Put in the SD

    card and boot up the machine. - Use default username and password : pi and raspberry for log in. - Once logged in we need to install following packages.
  12. Queries? Follow me on : FB : fb.com/aniket.maithani GitHub :

    github.com/aniketmaithani Twitter : @2aniketmaithani