you're reading...
howto, OpenSource, security, SSO, System Integration, WiFi

Using m0n0wall to Create a WiFi Captive Portal

m0n0wall, is a very powereful firewall based on FreeBSD.
For the Captive Portal setup, i used ;

1. a diskless PC with 2xethernet ports
2. an Access Point 
3. a Broadband ADSL+2 router
4. a switch 
5. a compact flash card (from my canon ixus:)
6. my linux laptop to flash the image on the mmc 
7. FreeRADIUS authentication (runs on my linux laptop) 
8. an HTC wildfire smartphone (to test through WiFi)

- From the AP, i disabled the DHCP service and i set the security mode to
  open and SSID  to a name of my choice. 

- On the firewall, i configured the wan and lan interfaces accordingly and
  i enabled the captive portal fuctionality. 

 * The DHCP service was enabled on the lan interface.
 * Wan IF goes to the ADSL, Lan IF goes to the AP.

- I created the following Portal Page through the WebGUI
  (at the captive portal services section)

 Welcome to my HotSpot - Pilio <br>
<form method="post" action="$PORTAL_ACTION$">
 <input name="auth_user" type="text"> <br>
 <input name="auth_pass" type="password"> <br>
 <input name="redirurl" type="hidden" value="$PORTAL_REDIRURL$">
 <input name="accept" type="submit" value="Continue">

- The following command shows how i flashed the bootable image on the mmc

root@pilio-laptop:/tmp# gunzip -c generic-pc-1.33.img | dd of=/dev/sdb bs=16k

gzip: generic-pc-1.33.img: decompression OK, trailing garbage ignored
640+0 records in
640+0 records out
10485760 bytes (10 MB) copied, 2.11757 s, 5.0 MB/s

root@pilio-laptop:/tmp# fdisk /dev/sdb
This disk has both DOS and BSD magic.
Give the 'b' command to go to BSD mode.

Command (m for help): p

Disk /dev/sdb: 507 MB, 507379712 bytes
255 heads, 63 sectors/track, 61 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x90909090

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb4 * 1 4 25000 a5 FreeBSD
Partition 4 has different physical/logical endings:
     phys=(1023, 254, 63) logical=(3, 28, 41)

Command (m for help): q


Comments are closed.