59
ออออออออออออ Basic Network Security: Authentication and Centralize Log (20 – 22 Feb 2012) Page1 Authentication and Centralize Log Course 1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin 8. Squid3 อออออออ [email protected] Tel. 081-8455569 อออออออออออออออออออออออออออออออออออออ http://service.sru.ac.th/VM/ อออออออออออออออออออออออ http://www.krujeen.com/th/index.php? option=com_phocadownload&view=category&id=25:bas ic-network-security-authentication-and- centralize-log&Itemid=88 http://www.krujeen.com Mr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

 · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page1

Authentication and Centralize Log Course

1. NTP Server (Network Time Protocol) : xntpd2. Radius Server (Remote Authentication Dial-up

User Service) : freeRedius3. pfSense4. Apache5. PHP6. Mysql7. phpmyadmin8. Squid3

วทยากร [email protected]. 081-8455569

โหลดไฟลประกอบการอบรมและโปรแกรมทใช http://service.sru.ac.th/VM/โหลดเอกสารประกอบการอบรมhttp://www.krujeen.com/th/index.php?option=com_phocadownload&view=category&id=25:basic-network-security-authentication-and-centralize-log&Itemid=88

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 2:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page2

Network Map

รปท 1 แผนผงระบบเครอขาย

Pfsense Server IP WAN : 172.18.150.227/24IP LAN : 192.168.227.1/24

Radius Server IP WAN : 172.18.150.227

Windows Server IP LAN : 192.168.227.10/24debian Server IP LAN : 192.168.227.20/24

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 3:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page3

Citrix XenServerHypervisor ชนดท 1 (เปนการสราง Server หลายๆ เครองภาย

ใตเครองเดยว)http://www.citrix.com/xenserver_freeการตดตง Citrix XenServer อยใน slide 26

Network Time Protocol (NTP)เปน Protocol มาตรฐานทใชในการอางองเวลาของอปกรณและ

คอมพวเตอรเครอขาย– RFC 5905 (NTP version 4

NTPv4 มระดบความเทยงตรงของการอางองเวลาตำากวา 10 มลลวนาท ในเครอขาย WAN พฒนาโดย Professor David L. Mills ท University of Delaware

รปท 2 รปแบบการจดลำาดบการอางองเวลา

แหลงอางองเวลาในประเทศไทยStratum 1

– UniNet• NTP2.UNI.NET.TH

– สถาบนมาตรวทยาแหงชาต• 203.185.69.60

– กรมอทกศาสตร กองทพเรอ

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 4:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page4

• TIME.NAVY.MI.THStratum 2

– UniNet• TIME.UNI.NET.TH

Oracle VM VirtualBox : debian

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 5:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page5

การตดตง debian1. เลอก language

2. เลอก location

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 6:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page6

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 7:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page7

3. เลอก location >> Asia

4. เลอก location >>Thailand

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 8:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page8

5. เลอก location >>United States

6. เลอก Keyboard >> American English

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 9:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page9

7. รอการตดตง

8. กำาหนดชอเครอง (hostname)

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 10:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page10

9. กำาหนดชอ network (Domain name)

10. กำาหนด password rootUser : rootPassword : de456789

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 11:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page11

11. กำาหนด Full name fot the new user

12. กำาหนด username ของคณ

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 12:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page12

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 13:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page13

13. กำาหนด password ของคณUser :surasakPassword : de123456

14. กำาหนด partition

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 14:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page14

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 15:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page15

15. กำาหนด partitiondisk

16. กำาหนด partitiondisk

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 16:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page16

17. กำาหนด partitiondisk

18. เลอก Yes

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 17:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page17

19. รอการตดตง

20. เลอกเมองทตดตง Thailand

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 18:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page18

21. เลอกเครองทโหลดไฟล

22. กำาหนด HTTP proxy

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 19:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page19

23. รอการโหลดไฟลและตดตง

24. ตองการตดตงโปรแกรมเสรมหรอไม

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 20:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page20

25. เลอกโปรแกรมเสรมทตองการตดตง

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 21:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page21

26. เลอก Yes เพอตดตง GRUB boot loader

27. เสรจสนการตดตง debian

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 22:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page22

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 23:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page23

การใชงาน debian

#ifconfig สำาหรบตรวจสอบการดแลน

#nano /etc/network/interfaces Configipaddressแกดงน

# The primary network interfaceallow-hotplug eth0iface eth0 inet staticaddress172.18.150.98netmask255.255.255.0gateway172.18.150.1

#nano /etc/resolv.conf Config DNSแกดงน

nameserver202.29.18.1nameserver203.155.33.1

#reboot

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 24:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page24

การตดตง NTP SERVERUp ไฟล Package NTP

libopts25_5.10-1.1_i386.debntp_4.2.6.p2+dfsg-1+b1_i386.deb

# apt-get install ntpff คำาสงตดตง ntp แบบยอ

การตดตง package ใชทำาสง #dpkg –install package# dpkg --install libopts25_5.10-1.1_i386.deb ตดตง libopts25_5.10-1.1_i386.deb# dpkg --install ntp_4.2.6.p2+dfsg-1+b1_i386.deb

ตดตง ntp_4.2.6.p2+dfsg-1+b1_i386.deb# ps aux |grepntp ตรวจสอบการทำางาน ntp

# nano /etc/ntp.conf การตงคาไฟล /etc/ntp.conf

คนหา driftfile /var/lib/ntp/ntp.drift กำาหนดไฟลทเกบคาการเบยงเบนของเวลาในเครอง

กำาหนดใหปฏเสธการสอสารกบเครองคอมพวเตอรใดๆ เปนคาเรมตนพมพคำาสงนตอดานลาง #statsdir /var/log/ntpstats/

restrict default ignorerestrict -5 default ignoreserver ntp2.uni.net.threstrictntp2.uni.net.th

nomodifynotrapnopeernoqueryserver time.navy.mi.threstrict time.navy.mi.th

nomodifynotrapnopeernoqueryrestrict 192.168.1.0 mask 255.255.255.0

nomodifynotrapnopeernoquery

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 25:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page25

# /etc/init.d/ntp restart restart ntp (คำาสงท1)# service ntp restart restart ntp (คำาสงท2 เหมอนกน)การสง restrart service ใชคำาสงได คอ # /etc/init.d/ตามดวย service ทตองการ# ps aux |grepntp ตรวจสอบวาโปรเซสทำางานเปนปรกต

$ ntptrace ตรวจสอบการเทยบเวลา

การตดตง Radius Server (Remote Authentication Dial-up User Service) : freeRedius

Up ไฟล Package freeRediusfreeradius_2.1.10+dfsg-2_i386.debfreeradius-common_2.1.10+dfsg-2_all.deblibfreeradius2_2.1.10+dfsg-2_i386.debfreeradius-ldap_2.1.10+dfsg-2_i386.debfreeradius-utils_2.1.10+dfsg-2_i386.deb

# apt-get install freeradius คำาสงตดตง freeradius แบบยอ

เมอการตดตงเกด error ใชคำาสงตอไปน# apt-get update การ update package# apt-get upgrade การ upgrade package เพอแกไข error

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 26:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page26

# apt-get –f install เปนการตดตงใหม แลวตอง config อกครง

การตดตง package ใชทำาสง #dpkg –install package# dpkg --install freeradius_2.1.10+dfsg-2_i386.deb

ตดตง freeradius_2.1.10+dfsg-2_i386.deb# dpkg --install freeradius-common_2.1.10+dfsg-2_all.deb ตดตง freeradius-common_2.1.10+dfsg-2_all.deb# dpkg --install libfreeradius2_2.1.10+dfsg-2_i386.deb

ตดตง libfreeradius2_2.1.10+dfsg-2_i386.deb# dpkg --install freeradius-ldap_2.1.10+dfsg-2_i386.deb

ตดตง freeradius-ldap_2.1.10+dfsg-2_i386.deb# dpkg --install freeradius-utils_2.1.10+dfsg-2_i386.deb

ตดตง freeradius-utils_2.1.10+dfsg-2_i386.deb

# dpkg --list |grep freeradius ตรวจสอบวา Package ไดตดตงเรยบรอยแลว

# ps aux | grep freeradius ตรวจสอบโปรเซส freeradius ทำางานปกต

ทดสอบโปรแกรมทตดตงเบองตน# nano /etc/freeradius/users สราง Username ทดสอบในไฟล

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 27:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page27

ในบรรทดบนสดของไฟล uninet Cleartext-Password := “password” User : uninetPassword : password

# service freeradius stop ปดโปรเซส freeRadius ปจจบนกอนเปด Debug mode# /usr/sbin/freeradius –X เรมการใชงานโปรแกรมใน Debug mode

และเปด Terminal นคางไว# radtest uninet password localhost 0 testing123

เปดอกหนง Terminal และใชคำาสงทดสอบการทำางานของ

โปรแกรม\Password ถกตองใชงานได

Password ผด

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 28:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page28

pfSense

โปรแกรม pfSense เพอใชในการยนยนตวตนในลกษณะของ Captive Portal

คณสมบตหลกของโปรแกรม pfSense- Firewall- Traffic Shaping- Hardware failover (Active/Standby)- Load Balancing- VPN – IPSec, PPTP- Graphs Reporting- Proxy Server- Captive Portal

การวาง pfSense ในระบบเครอขาย

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 29:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page29

Oracle VM VirtualBox : pfsense

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 30:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page30

การตดตง pfSense

1. ตองการกำาหนด VLAN หรอไม No

2. กำาหนดการด WAN

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 31:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page31

3. กำาหนดการด LAN

4. ยนยนการด LAN และ WAN

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 32:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page32

5. เลอก 2 กำาหนด WAN

6. เลอก 1 กำาหนด WAN

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 33:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page33

7. เลอก n กำาหนด ip address เอง

8. กำาหนด ip address ของ WAN เปน 172.18.150.227

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 34:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page34

9. กำาหนด subnet ของ WAN เปน 24 คอ 255.255.255.0

10. ใชงาน HTTP เลอก Y

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 35:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page35

11. เลอก 2 กำาหนด LAN

12. กำาหนด ip address ของ LAN เปน 192.168.227.113. กำาหนด subnet ของ LAN เปน 24 คอ 255.255.255.0

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 36:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page36

14. ปดการทำางาน DHCP ของ LAN สำาหรบโรงเรยนอาจใชงานในสวนน

15. ตรวจสอบการกำาหนดคา LAN

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 37:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page37

16. เลอก 99 เพอตดตง pfSense ลงเครอง Server

17. เลอก Accept these Settings

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 38:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page38

18. เลอก Quick/Easy Install

19. เลอก OK เพอยนยนการตดตง pfSense

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 39:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page39

20. เลอก Symmetric multiprocessing kernel

21. นำาแผน CD ออก และเลอก Reboot

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 40:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page40

การตงคาเรมตนโปรแกรม pfSense

เปดเวบบราวเซอร เขาไปท http://192.168.227.10 เขาสหนาเวบ Administrator ของ pfSense

Username : adminPassword : pfsense

System: User Manager

เลอก System: User Manager แลวกำาหนด password ใหมUsername : adminPassword : pfsense

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 41:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page41

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 42:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page42

System: Gateways: Edit gateway

กำาหนด Gateways แลวคลกเลอก Default Gateway คลก Save แลว Apply

System: General Setup

กำาหนด DNS Server ของเครอขายใหตรงกบเครอขายทใชงาน แลวคลก Save

Services: Captive portalเลอก Enable captive portalInterfaces เลอก LANIdle timeout : เวลาหลงจากไมไดใชงาน (นาท)Hard timeout : อนญาตใหใชงานครงละ (นาท)Logout popup window : ออกจากระบบผานหนาตางAfter authentication Redirection URL : หลงจากเขาสระบบแลวใหเขาไปทหนาเวบ

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 43:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page43

MAC filtering : การกรอง MAC AddressPer-user bandwidth restriction : กำาหนดขนาดของ bandwidth ทก userAuthentication : ใชเลอกท RADIUS Authentication

Interfaces: WAN เลอก Gateway ทเรากำาหนดไวการตงคา freeRadius เพอรองรบขอมลจาก pfSense (ทำาในเครอง debian server)# nano /etc/freeradius/clients.conf การตงคา freeRadius เพอรองรบขอมลจาก pfSenseพมพขอความตอไปกำาหนดเครองทสามารถรบสงขอมลจาก pfSense เขามาเครองเดยว

client 172.18.150.227 {secret = uninet

}

กำาหนดเครองทสามารถรบสงขอมลจาก pfSense เขามาเฉพาะวงทกำาหนดclient 172.18.150.0/24{

secret = uninet}

# service freeradius restart restart freeRadius

(ทำาในเครอง pfSense server)Services: Captive portal Authentication

# apt-get remove freereadius

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 44:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page44

การตดตง Radius โดยการดงขอมลผใชงานจาก Mysql และหนาเวบทำาหรบบรหารจดการผใชงาน

# apt-get install apache2 ตดตง Apache# apt-get install php5-common php5-gd php-pear php-db libapache2-mod-php5 ตดตง PHP# apt-get install php5-mysql mysql-server ตดตง Mysql

ขณะตดตงระบบจะถามรหสผานของ MySql

# apt-get install freeradius freeradius-mysql ตดตง freeRadius# apt-get install phpmyadmin ตดตง phpmyadmin

# mysql –u root –p เขาไปใน MySql > CREATE DATABASE radius; เพมฐานขอมล “radius”> quit; ออกจาก MySql

# mysql -u root -p radius < /etc/freeradius/sql/mysql/schema.sql –p เพมตารางลงในฐานขอมล# mysql -u root -p radius < /etc/freeradius/sql/mysql/nas.sql เพมตารางลงในฐานขอมล

# nano /etc/freeradius/sql.conf แกไขไฟล sql.conf

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 45:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page45

server = "localhost"login = "root"password = "xxxxxxxx"แลวเอา # หนา readclient =yes ออก

# nano /etc/freeradius/radiusd.conf แกไขไฟล radiusd.conf

$INCLUDE sql.conf ---------------------------> บรรทดท 683เอาเครองหมาย # ดานหนาออก

$INCLUDE sql/mysql/counter.conf -----------> บรรทดท 695 เอาเครองหมาย # ดานหนาออก

# nano -w /etc/freeradius/clients.conf แกไขไฟล clients.conf

เพอใหเครองอนสามารถดงขอมลผใชงาน เพมขอความตอไปนลงในไฟล

client 172.18.150.0/24 {secret = 123456}

# nano -w /etc/freeradius/sites-available/default แกไขไฟล default เพอให Radius ดงขอมลจาก Mysql

ใหเอาเครองหมาย # ใสดานหนา file และเครองหมาย # ออก หนา sql ดงน

authorize {#file ---------------------------> บรรทดท 152sql ---------------------------> บรรทดท 159}accounting {sql ---------------------------> บรรทดท 388

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 46:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page46

}session {sql ---------------------------> บรรทดท 436}

การตดตงโปรแกรมบรหารจดการผใชงาน (Download จาก service.sru.ac.th/VM/manage)upload ไฟล administrator.tgz เขาไปทเครองแมขาย # mv administrator.tgz /var/www การยายไฟลไปท /var/www# tar zxvf administrator.tgz แตกไฟล administrator.tgz# nano /var/www/administrator/include/config.inc.php

แกไขไฟลเพอตดตอกบฐานขอมล$_config['database']['hostname'] = "localhost";$_config['database']['username'] = "root";$_config['database']['password'] = "123456";$_config['database']['database'] = "radius";

เขาไปใน phpmyadmin แลว import ไฟล radius.sql.bz2 ในฐานขอมล radius

ทดสอบเขาใชงานระบบโดย 172.18.150.227/administratorUsername : adminPassword : p@ssw0rd

การตดตงโปรแกรมสำาหรบผใชงานทวไปupload ไฟล user.tgz เขาไปทเครองแมขาย

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 47:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page47

# mv user.tgz /var/www การยายไฟลไปท /var/www# tar zxvf user.tgz แตกไฟล user.tgz# nano /var/www/user/config.inc.php แกไขไฟลเพอตดตอกบฐานขอมล

$host = "localhost";$user = "root";$passwd = "123456";$dbname = "radius";

ทดสอบเขาใชงานระบบโดย 172.18.150.227/user

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 48:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page48

การตงคาเรมตนโปรแกรม rsyslogเปนโปรโตคอลมาตรฐาน RFC 5424 มรปแบบการทำาางานเปน

ลกษณะ Client/Server– โดยโปรแกรมจะสงขอความ Log ไปยง Syslog เซรฟเวอร– โดยปรกตจะตดตอสอสารผานพอรต UDP 514 ใน

ลกษณะ Cleartext– สามารถทำางานรวมกบ SSL ผานโปรแกรมประเภท Stunnel

เพอใหสงผานขอมลในเครอขายแบบเขารหส

Message Priorityเปน field ทสำาคญในขอความ Syslog ซงบงบอกถงความสำาคญของ

ขอความและโปรแกรมหรอโปรเซสทสงขอความนน ลำาดบความสำาคญของขอความ (Message Severity)

# nano /etc/rsyslog.conf แกไข rsyslog.conf รองรบ log ท port UDP 514

#$ModLoad imudp นำาเครองหมาย # ออก#$UDPServerRun 514 นำาเครองหมาย # ออก

# service rsyslog restart restart rsyslog

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 49:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page49

# nano /etc/rsyslog.conf แกไข rsyslog.conf ใหเกบ log แบงแยกไฟล

เพมในบรรทดสดทาย:fromhost-ip, isequal, “<pfsense_ip>”

/var/log/pfsense.log# service rsyslog restart restart rsyslog# tail –f /var/log/pfsense.log ตรวจสอบ log

# nano /etc/freeradius/radius.conf แกไขคา freeradius ใหเกบ Authentication log

strupped_names = yesauth = yesauth_badpass = yesauth_goodpass = no

# service freeradius restart restart freeradius# tail –f /var/freeradius/radius.log ตรวจสอบ log

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.

Page 50:  · Web view1. NTP Server (Network Time Protocol) : xntpd 2. Radius Server (Remote Authentication Dial-up User Service) : freeRedius 3. pfSense 4. Apache 5. PHP 6. Mysql 7. phpmyadmin

อบรมหลกสตร Basic Network Security: Authentication and Centralize

Log (20 – 22 Feb 2012) Page50

การตดตง Package Squid3เพอใชในการจดการ web proxy

http://www.krujeen.comMr.SurasakTippimon:: Saard Paderm Wittaya School, Chumphon.