Ubuntu+Chillispot+Radius
posted on 18 Sep 2009 18:47 by pandamaster in Internetในปัจจุบันนี้การใช้งาน Computer เริ่มแพร่หลายมากขึ้น ทำให้ปัจจุบันมีคนที่เข้าใช้ Internet มากขึ้นทำให้มีการติดต่อสื่อสารกันได้สะดวกยิ่งขึ้นซึ่งการใช้งาน Internet นั้นสามารถใช้งานได้หลายทาง เช่น Modem , ADSL , LAN , Wireless LAN ในที่นี้จะกล่าวถึงในส่วน Wireless LAN เท่านั้น โดยที่ Wireless LAN นั้นทำให้การใช้งาน Internet ได้สะดวกสบายมากยิ่งขึ้นเนื่องจาก เป็นระบบไร้สาย ทำให้สามารถเข้าถึง Internet ได้ทุกที่ทุกเวลา การที่ Wireless LAN นั้นสามารถใช้งานได้ทุกทีทุกเวลานั้นทำให้เกิดความไม่ปลอดภัยในการใช้งานเครือข่ายเนื่องจาก ระบบ Wireless LAN นั้น ใช้เป็นระบบคลื่นแม่เหล็ก ความถี่ 2.4-5 GHz เนื่องด้วยจากเป็นคลื่น ที่สามารถกระจายตัวไปได้ในทุกๆที่ ทำให้ขาดการควบคุมและทำให้มีการควบคุมการใช้งาน Internet ได้ลำบาก ซึ่งในการใช้งาน Internet นั้น จะต้องมีการควบคุมดูแลให้เป็นระบบระเบียบ ตามที่ เจ้าของเครือข่ายได้ ติดตั่งให้ใช้งาน ซึ่งทำให้จะต้องมีการ พิสูจน์ตัวตนว่า ตนเองมีสิทธิ เข้าใช้งาน Internet นั้นๆ หรือไม่ โดยการพิสุจน์ นั้น จะทำได้โดยใช้ Server โดยรายละเอียดในการติดตั่งและการทำงานมีดังนี้
ถ้าไม่สามารถ เปิด VDO ได้เข้าไปที่ Wireless Movie.avi
ทำการติดตั่ง Ubuntu เมื่อติดตั่งเสร็จเรียบร้อยแล้วนั้น
ทำการแก้ไข Network
#sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
auto eth1
iface eth1 inet dhcp
ทำการแก้ไขไฟล์ sysctl.conf
#sudo nano /etc/sysctl.conf
net.ipv4.ip_forward=1
ทำการเปิดการใช้งาน
#echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
เริ่มการทำงานของ Network ใหม่
#sudo /etc/init.d/networking restart
ทำการแก้ไขไฟล์ modules
#sudo nano /etc/modules
tun
ทำการเปิดใช้
#sudo modprobe tun
กำหนดให้ Apache ทำงานในรูปแบบ https
#sudo a2enmod ssl
ติดต่ังไฟล์ apache2-ssl.tar.gz
#sudo wget ftp://ftp.psu.ac.th/pub/apache/apache2-ssl.tar.gz
#sudo tar –zxvf apache2-ssl.tar.gz –C tmp
#sudo mv /tmp/ssleay.cnf /usr/share/apache2
#sudo mv /tmp/apache2-ssl-certificate /usr/sbin
#sudo mkdir –p /etc/apache2/ssl
สร้าง certification ระบบจะมีการให้ตอบข้อความให้กด Enter อย่างเดียวจนเสร็จ
#sudo apache2-ssl-certificate
แก้ไขไฟล์ ตามด้านล่าง
#sudo nano /etc/apache2/sites-available/default
NameVirtualHost 10.0.134.1:80
NameVirtualHost 10.0.134.1:443
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
ServerName origin.hostname.domain
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
ServerAdmin webmaster@localhost
DocumentRoot /var/www/secure/
ServerName new.name.domain
Options FollowSymLinks
AllowOverride None
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /var/www/secure/cgi-bin/
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
Alias /doc/ "/usr/share/doc/"
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
ทำการrestart apache
#sudo /etc/init.d/apache2 force-reload
ติดตั่ง Freeradius
#sudo apt-get install freeradius
สั่งให้ทำงาน
#sudo /etc/init.d/freeradius start
Test user pass
#sudo radtest root admin localhost 0 testing123
ทำการติดตั่ง chilli spot แล้วกำหนดค่าตามด้านล่าง
#sudo apt-get install chillispot
127.0.0.1
sharedsecret
eth0
https://10.0.134.1/cgi-bin/hotspotlogin.cgi
http://10.0.134.1/welcome.html
sharedsecret
ทำการแก้ไขไฟล์
#sudo nano /etc/default/chillispot
ENABLED=1
ทำการแก้ไขไฟล์
#sudo nano /etc/chilli.conf
net 10.0.134.0/24
radiusserver1 127.0.0.1
radiusserver2 127.0.0.1
radiussecret sharedsecret
dhcpif eth0
uamserver https://10.0.134.1/cgi-bin/hotspotlogin.cgi
uamhomepage http://10.0.134.1/welcome.html
uamsecret sharedsecret
uamlisten 10.0.134.1
uamallowed www.psu.ac.th,redirect.psu.ac.th
ทำการ copy firewall.iptable ไปไว้ที่ /etc/init.d/chilli.iptable
#sudo cp /usr/share/doc/chillispot/firewall.iptables /etc/init.d/chilli.iptables
ทำการแก้ไข
#sudo chmod a+x /etc/init.d/chilli.iptables
#sudo ln –s ../init.d/chilli.iptables /etc/scS.d/S41chilli.iptables
ทำการแก้ไขไฟล์
#sudo nano /etc/init.d/chilli.iptables
EXTIF="eth1"
INTIF="eth0"
#sudo /etc/init.d/chilli.iptables
#sudo mkdir –p /var/www/secure/cgi-bin
#zcat –c /usr/share/doc/chillispot/hotspotlogin.cgi.gz | sudo tee /var/ww/secure/cgi-bin/hotspotlogin.cgi
#sudo chmod a+x /var/www/secure/cgi-bin/hotspotlogin.cgi
ทำการแก้ไขไฟล์
#sudo nano /var/www/secure/cgi-bin/hotspotlogin.cgi
$uamsecret = "sharedsecret";
$userpassword=1;
ทำการสร้างไฟล์
#sudo vi /var/www/welcome.html
TESTING ONLY

Welcome to Eiffel Hotspot, Wireless
Network.
You are connected to an authentication and restricted network access point.
Enjoy.
#sudo /etc/init.d/chillispot start
เมื่อทำการ Setup ระบบเรียบร้อยแล้ว ให้ต่อ สาย LAN เข้ากับ Access Point
เมื่อทำการเชื่อมต่อ Internet จะเข้าสู่หน้า Login
ใช้ Username Password ของ root


IEEE 802.1x เป็นกระบวนการเพิ่มความปลอดภัยในการเข้าใช้เครื่อข่าย
การทำงานของ 802.1x ต้องอาศัย Authentication, Authorization and Accountion เป็นตัวกลาง ซึ่งใช้ Radius Server และใช้ Extensible Authentication Protocol ในการสื่อสาร โดยมีการทำงานดังรูป

การทำงานของ EAP Protocol จะมีด้วยกัน ดังรูป
รูปจาก http://layer3.wordpress.com/2009/08/16/eap-authentication-protocols/
รูปจาก http://layer3.wordpress.com/2009/08/16/eap-authentication-protocols/
รูปจาก http://layer3.wordpress.com/2009/08/16/eap-authentication-protocols/
รูปจาก http://layer3.wordpress.com/2009/08/16/eap-authentication-protocols/
LEAP : Lightweight EAP เป็นของบริษัท Cisco system การใช้งานจะต้องใช้งานกับผลิตภัณฑ์ ของ Cisco
EAP-TLS : EAP-Transport Layer Security มีการใช้งานบน Windows
PEAP : Protected EAP เป็น Protocol ที่ร่วมมือกันระหว่าง Microsoft และ Cisco
รายละเอียดเพิ่มเติมอ่านได้จาก EAP Authentication Protocols.pdf
เอกสารอ้างอิง
เอกสารจาก https://help.ubuntu.com/
เอกสารจาก http://technet.microsoft.com/en-us/default.aspx
เอกสารจาก http://mamboeasy.psu.ac.th/~wiboon.w/content/view/29/40/
บทความจาก http://www.linuxthai.org/forum/index.php?board=18.0
เอกสารเพิ่มเติ่มอื่นๆ http://mamboeasy.psu.ac.th/~wiboon.w/content/view/29/40/
เอกสารเพิ่มเติ่มอื่นๆ http://mamboeasy.psu.ac.th/~wiboon.w/images/stories/chillispot/wiboon-chillispot.pdfedit @ 23 Sep 2009 10:40:17 by Ming:PandaMaster
edit @ 23 Sep 2009 11:46:57 by Ming:PandaMaster
edit @ 23 Sep 2009 11:47:53 by Ming:PandaMaster