Endian Firewall Community เป็น linux security distribution ที่มีฟังก์ชันของระบบการจัดการความปลอดภัยทางเครือข่ายแบบรวม (UTM : Unified Threat Management)  เป็นซอฟต์แวร์ที่ได้ออกแบบมาเพื่อให้จัดการและใช้งานได้ง่าย  โดยมีคุณสมบัติที่ประกอบด้วย Stateful Packet Inspection (SPI) Firewall แอพพลิเคชันพร๊อกซี่สำหรับ HTTP,FTP, POP3,SMTP และ DNS  เครื่องมือในการกลั่นกรองเว็บรวมถึง VPN แบบ OpenVPN และ IPSec  โดยข้อดีหลักของ Endian Firewall Community คือเป็น Open Source ที่สามารถประยุกต์ใช้งานกับเครือของเราได้ฟรี

ความสามารถที่ทางเว็บไซต์ของ EFW (http://www.efw.it) แจ้งไว้มีดังนี้·      

การสำรองข้อมูล
สามารถบันทึกและกู้คืนผ่าน
USB device   สามารถตั้งเวลาให้มีการสำรองข้อมูลแบบอัตโนมัติและส่งข้อมูลการสำรองที่ผ่านการเข้ารหัสแล้วผ่านทางอีเมล์·      

Dashboard
หน้าเพจหลักจะถูกแทนที่ด้วย
dashboard ซึ่งเป็นสถิติเกี่ยวกับระบบและบริการต่างๆ อันเป็นกราฟแบบ live-graphs สำหรับทราฟฟิกขาเข้าและขาออก·      

ระบบแจ้งเตือนทางอีเมล์
เป็นการส่งอีเมล์โดยอัตโนมัติตามที่ได้กำหนด  เมี่อมีเหตุการณ์ต่างๆ เกิดขึ้น·      

HTTP proxy time based access control
เป็นการควบคุมการเข้าใช้งาน
HTTP Proxy โดยกำหนดช่วงเวลาในการใช้งานได้·      

HTTP proxy with user- and group-based content filtering
เป็นความสามารถในการกำหนดผู้ใช้งานและกลุ่มผู้ใช้งานเพื่อควบคุมการกลั่นกรองการเข้าใช้งานเว็บไซต์
·      

Intrusion Prevention
มีระบบการการป้องการการบุกรุกทางเครือข่ายโดยใช้กฎของ Snort ที่สามารถคอนฟิกได้  ซึ่งสามารถที่จะละทิ้งแพ็กเกตการบุกรุกที่เหมือนกับข้อมูลใน Log ได้·      

Policy routing
สามารถสร้างกฎการจัดเส้นทางโดยยึดถืออินเตอร์เฟส
, MAC Address หรือพอร์ตของแพ็กเกตได้·      

Port forwarding rewrite
การทำ
 Porwarding ในเวอร์ชันก่อน 2.3 สามารถฟอร์เวิร์ดได้เฉพาะ Red zone เท่านั้น แต่ในเวอร์ชันนี้สามารถทำได้จากทุกโซนโดยปราศจากการทำ NAT·      

Quality of Service and Bandwidth Management
การจัดรูปร่างของทราฟฟิก
(Traffic Shaping) ได้ถูกแทนที่ด้วย QoS Module ซึ่งสามารถทำได้โดยใช้ device, classes และ rules·      

SNMP support
สนับสนุน
SNMP แบบพื้นฐาน  ซึ่งการใช้งานต้องทำการ Enable SNMP Server พร้อมป้อนค่าที่เกี่ยวข้อง·      

SMTP proxy web interface rewrite
ได้มีการปรับปรุง
Web Interface ในส่วน SMTP Proxy โดยเน้นการใช้งานที่สะดวก·      

VLAN support (IEEE 802.1Q trunking)
เวอร์ชันนี้สามารถสร้าง
VLANs บนทุก Interface ได้  โดย VLAN Interface สามารถใช้งานเพื่อแบ่งแยกการเชื่อมต่อในโซนเดียวกัน  การเซ็ตอัพเครือข่ายทำได้ด้วยเลือกเมนู System จาก Menu bar ส่วนบนของหน้าจอ แล้วเลือกเมนูย่อย Network configuration ทางด้านซ้ายของหน้าจอ   

การเลือกชนิดของ Red Interfaceเมื่อเราติดตั้ง Endian Firewall Community แล้ว  อินเตอร์เฟสที่เป็น trusted network (เรียกว่า Green Interface) จะถูกเลือกและเซ็ตอัพ   และการเลือก untrusted interface network (เรียกว่า Red Interface) เพื่อเชื่อมต่อไปยังผู้ให้บริการอินเตอร์เน็ต (outside) สามารถใช้งานได้เป็น 7  รูปแบบดังนี้
1.             ETHERNET STATIC
ต้องมีการเซ็ตอัพค่าข้อมูลเครือข่ายของ Ethernet Adapter เช่น IP และ Netmask เป็นแบบ manual  การใช้งานแบบนี้โดยทั่วไปจะเชื่อมต่อ RED Interface กับเราเตอร์โดยใช้สายอีเทอร์เน็ต แบบ crossover

2.               ETHERNET DHCP
เป็นการเซ็ตอัพค่าข้อมูลเครือข่ายของ Ethernet Adapter ให้รับค่าจาก DHCP การใช้งานแบบนี้ใช้สำหรับการเชื่อมต่อ RED Interface กับ cable modem/router หรือ ADSL/ISDN router โดยใช้สายอีเทอร์เน็ตแบบ crossover

3.              PPPoE
เป็นการเชื่อมต่อ Ethernet adapter แบบ crossover เข้ากับ ADSL modem การใช้งานแบบนี้ต้องเซ็ตค่าที่โมเด็มเป็นแบบบริดจ์  และให้เครื่องที่เป็น EFW Community ใช้ PPPoE เชื่อมต่อกับผู้ให้บริการ  ทั้งนี้อย่าสับสนกับการใช้งานผ่าน ADSL modem ที่เป็นแบบ ETHERNET STATIC และ ETHERNET DHCP ซึ่งทั้งสองแบบนี้มีการทำ PPPoE บนตัว Router เอง

4.              ADSL (USB, PCI)
เป็นการใช้งานกับ ADSL modem แบบ USB และ PCI

5.              ISDN
เป็นการใช้งานกับ ISDN adapter

6.              ANALOG/UMTS Modem
เป็นการใช้งานกับระบบอานาล็อก (dial-up) หรือ UMTS (cell-phone) modem

7.              GATEWAY
เป็นการใช้งานกับเครื่องที่ไม่มี RED Interface  การใช้งาน Firewall โดยทั่วไปจะต้องมีสองอินเตอร์เฟสเป็นอย่างน้อย  แต่บางสถานการณ์เราสามารถใช้แค่อินเตอร์เฟสเดียวได้  เช่น  การใช้งานที่ต้องการทำเป็น Firewall อย่างเดียวเท่านั้น  หรืออีกแบบอาจจะใช้ในกรณีที่ BLUE zone ของ EFW ถูกเชื่อมต่อกับ VPN ผ่าน GREEN interface ของ EFW ตัวที่สอง ในสถานการณ์แบบนี้ IP Address ของ Green interface ของ Firewall ตัวที่สอง สามารถถูกใช้เป็น backup uplink บน Firewall ตัวแรก  ซึ่งถ้าเลือกออฟชันนี้จะต้องมีการคอนฟิก default gateway ในภายหลัง

Dec-12-09

การติดตั้ง Cloud Computing (Ubuntu Enterprise Cloud : UEC)

posted by อดิศร ขาวสังข์

ที่ Link ข้างล่างครับ

https://help.ubuntu.com/community/UEC?highlight=%28%28UEC%7CCDInstall%29%29

Dec-7-09

วิธีแก้ปัญหา Excel 2007 บน Vista เกิด stop working

posted by อดิศร ขาวสังข์

ผมดูใน web เขามีหลายวิธี 1 ในนั้นเขาแก้ดังนี้ และผมก็แก้ตามได้ผลครับ
1.Run - -> Regedit
2.HKEY_LOCAL_MACHINE \ SOFTWARE\Microsoft \ Office \ Excel \ Addins \ BtOfficeAddin.BtOfficeIntegration.1
3.ดูช่องทางด้านขวาใน column : Name : Loadbehavior  type :REG_DWORD   ,Data : 0×00000000 (3) ให้แก้ไขModifyเป็น 0 ก็ใช้ได้แล้วครับ

Dec-1-09

นิยามคำว่า Cloud Computing

posted by อดิศร ขาวสังข์

ที่มา http://javaboom.wordpress.com/2008/07/23/whatiscloudcomputing/

Cloud Computing คืออะไร

นี่คือการนิยามคร่าวๆของผมสำหรับความหมายของ Cloud Computing

Cloud Computing คือวิธีการประมวลผลที่อิงกับความต้องการของผู้ใช้ โดยผู้ใช้สามารถระบุความต้องการไปยังซอฟต์แวร์ของระบบCloud Computing จากนั้นซอฟต์แวร์จะร้องขอให้ระบบจัดสรรทรัพยากรและบริการให้ตรงกับความต้องการผู้ใช้ ทั้งนี้ระบบสามารถเพิ่มและลดจำนวนของทรัพยากร รวมถึงเสนอบริการให้พอเหมาะกับความต้องการของผู้ใช้ได้ตลอดเวลา โดยที่ผู้ใช้ไม่จำเป็นต้องทราบเลยว่าการทำงานหรือเหตุการณ์เบื้องหลังเป็นเช่นไร

ผมได้นิยามคำว่า Cloud Computing ในรูปแบบที่ (น่าจะ) เข้าใจง่ายขึ้นที่ นิยามคำว่า Cloud Computing ภาค 2 สำหรับท่านที่กำลังค้นหาหัวข้อวิจัยและพัฒนาเกี่ยวกับ Cloud Computing สามารถไปอ่านบทความของผมได้ในหัวข้อชื่อ หมวดงานวิจัยเกี่ยวกับ Cloud Computing

รายละเอียดของนิยามมีอีกครับ เข้ามาติดตามได้เลย

ผมขอนิยามความหมายของคำหลักๆ 3 คำที่เกี่ยวข้องกับ Cloud Computing ต่อไปนี้

ความต้องการ (Requirement) คือโจทย์ปัญหาที่ผู้ใช้ต้องการให้ระบบคอมพิวเตอร์แก้ไขปัญหาหรือตอบปัญหาตามที่ผู้ใช้กำหนดได้ ยกตัวอย่างเช่น ความต้องการพื้นที่จัดเก็บข้อมูลขนาด 1,000,000 GB, ความต้องการประมวลผลโปรแกรมแบบขนานเพื่อค้นหายารักษาโรคไข้หวัดนกให้ได้สูตรยาภายใน 90 วัน, ความต้องการโปรแกรมและพลังการประมวลผลสำหรับสร้างภาพยนต์แอนนิเมชันความยาว 2 ชั่วโมงให้แล้วเสร็จภายใน 4 เดือน, และความต้องการค้นหาข้อมูลท่องเที่ยวและโปรแกรมทัวร์ในประเทศอิตาลีในราคาที่ถูกที่สุดในโลกแต่ปลอดภัยในการเดินทางด้วย เป็นต้น

ทรัพยากร (Resource) หมายถึง ปัจจัยหรือสรรพสิ่งที่เกี่ยวข้องกับการประมวลผลหรือเกี่ยวข้องกับการแก้ไขปัญหาตามโจทย์ที่ความต้องการของผู้ใช้ได้ระบุไว้ อาทิเช่น CPU, Memory (เช่น RAM), Storage (เช่น harddisk), Database, Information, Data, Network, Application Software, Remote Sensor เป็นต้น

บริการ (Service) ถือว่าเป็นทรัพยากร และในทางกลับกันก็สามารถบอกได้ว่าทรัพยากรก็คือบริการ โดยเฉพาะอย่างยิ่งในด้านCloud Computingแล้ว เราจะใช้คำว่าบริการแทนคำว่าทรัพยากร คำว่าบริการหมายถึงการกระทำ (operation) เพื่อให้เกิดผลลัพธ์ที่สนองต่อความต้องการ (requirement) แต่การกระทำของบริการจะเกิดขึ้นได้จำเป็นต้องพึ่งพาทรัพยากร โดยการใช้ทรัพยากรที่เกี่ยวข้องเพื่อแก้ปัญหาให้เกิดผลลัพธ์สนองต่อความต้องการ

สำหรับCloud Computingแล้ว ผู้ใช้ไม่จำเป็นต้องสนใจเลยว่าระบบเบื้องล่างทำงานอย่างไร ประกอบไปด้วยทรัพยากร(resource) อะไรบ้าง ผู้ใช้แค่ระบุความต้องการ(requirement) จากนั้นบริการ(service)ก็เพียงให้ผลลัพธ์แก่ผู้ใช้ ส่วนบริการจะไปจัดการกับทรัพยากรอย่างไรนั้นผู้ใช้ไม่จำเป็นต้องสนใจ สรุปได้ว่า ผู้ใช้มองเห็นเพียงบริการซึ่งทำหน้าที่เสมือนซอฟต์แวร์ที่ทำงานตามโจทย์ของผู้ใช้ โดยที่ผู้ใช้ไม่จำเป็นต้องรับทราบถึงทรัพยากรที่แท้จริงว่ามีอะไรบ้างและถูกจัดการเช่นไร หรือไม่จำเป็นต้องทราบว่าทรัพยากรเหล่านั้นอยู่ที่ไหน

Nov-5-09

การ Disable การทำงานของ MailScanner ชั่วคราว

posted by อดิศร ขาวสังข์

การ Disable การทำงานของ MailScanner ที่ทำงานร่วมกับ Postfix ชั่วคราวทำได้ดังนี้

  1. หยุดทำการทำงานของ MailScanner ด้วยคำสั่ง
    /etc/init.d/mailscanner stop
  2. เปลี่ยนชื่อไฟล์ /etc/postfix/header_checks เป็นชื่ออื่น
  3. เปิดไฟล์ /etc/postfix/main.cf แล้วเอาเครื่องหมาย # ไว้หน้าข้อความต่อไปนี้
    header_checks = regexp:/etc/postfix/header_checks
  4. เปลี่ยนชื่อ /etc/MailScanner/MailScanner.conf เป็นชื่ออื่น  เพื่อว่าตอน boot เครื่องใหม่ตัว MailScanner จะไม่สามารถทำงานได้เพราะไฟล์คอนฟิกไม่มี
Oct-24-09

Upgrading from Ubuntu 9.04 to Ubuntu 9.10

posted by อดิศร ขาวสังข์

มีขั้นตอนดังนี้

  1. ติดตั้ง Package ที่ชื่อว่า update-manager-core
  2. ถ้าติดตั้งไม่ได้ให้แก้ไขไฟล์ /etc/update-manager/release-upgrades  โดยเซ็ตค่า Prompt=normal
  3. upgrade ด้วยคำสั่ง sudo do-release-upgrade -d
  4. จากนั้นให้ทำตามคำแนะนำบนหน้าจอ

อ้างอิง http://wiki.zyntag.com/Ubuntu:Add_New_Harddisk

ตรวจดูเห็นฮาร์ดดิสก์ใหม่หรือไม่

# fdisk -lDisk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xdbe8dbe8

    Device    Boot      Start    End          Blocks             Id         System
/dev/sda1      *              1      29650    238163593+       83      Linux
/dev/sda2             29651      30401        6032407+         5      Extended
/dev/sda5             29651      30401         6032376        82      Linux swap / Solaris

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xec5563c4

    Device    Boot     Start           End          Blocks             Id         System
/dev/sdb1                     1          60801   488384001         83          Linux

หมายเหตุ ในกรณีที่ท่านใช้ HDD ตัวใหม่ที่เคยลง Linux แล้ว อาจจะมี device ตัวใหม่ที่ต่างออกไปดังต่อไปนี้

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0×000e0f47  Device      Boot      Start         End          Blocks         Id      System
/dev/sdb1                      1             3           24097       83       Linux
/dev/sdb2                      4         391       3116610       82       Linux swap / Solaris
/dev/sdb3                  392     20529   161758485       83       Linux
/dev/sdb4        *     20530     60801   323484840       83       Linux

ซึ่งถ้าเป็น case แบบนี้ ค่าของ sdb ก็จะต่างออกไป ให้เืลือกจัดการกับ device ให้ถูกต้องด้วย

สร้างพาร์ติชันใหม่

#fdisk /dev/sdb1
# n
# p
# 1
# enter
# enter
# w
=>Fdisk will display the following menu
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition’s system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)Command (m for help):

=> We want to add a new partition. Type “n” and press enter.
Command action
e extended
p primary partition (1-4)

=>We want a primary partition. Enter “p” and enter.
Partition number (1-4):
=>Since this will be the only partition on the drive, number 1. Enter “1″ and enter.
Command (m for help):
=> Now that the partition is entered, choose option “w” to write the partition table to the disk. Type “w” and enter.
The partition table has been altered!
=>If all went well, you now have a properly partitioned hard drive that’s ready to be formatted.

ฟอร์แมตพาร์ติชัน

#mkfs.ext3 /dev/sdb1

สร้าง mount

$mkdir /disk2
$mount /disk2 /dev/sdb1

สร้าง auto mount

vi /etc/fstab
เพิ่มที่ท้ายไฟล์ /dev/sdb1    /disk2    ext3    defaults,errors=remount-ro    0    1

จบครับ

บทนำ
ในที่นี้จะอธิบายการติดตั้ง Samba File Server บน Ubuntu และการคอนฟิกเพื่อการ Share files บน SMB protocal รวมถึงการเพิ่ม user โดยจะคอนฟิก Samba ให้เป็น standalone server ไม่ใช่ domain controller ในการเซ็ตอัพใช้ Ubuntu Server installation CD แต่ขบวนการติดตั้งจะทำงานเหมือนบน Ubuntu desktop

ผลที่ได้จากการเซ็ตอัพทุก user สามารถเข้าสู่ home directory ของตัวเองผ่าน SMB protocol และทุก user จะมี shared ที่สามารถอ่านและเขียนได้

What is tdmsam
Samba สามารถเก็บ user และ machine account data ใน “TDB” (trivial database) การใช้ backend ไม่ต้องการการคอนฟิกเพิ่มเติมใด ๆ  ซึ่ง backend นี้ถูกแนะนำสำหรับการติดตั้งใหม่ที่ไม่ใช้ LDAPการแนะนำโดยทั่วไปทีม samba ไม่แนะนำให้ใช้ tdbsam backend สำหรับ site ที่มียูสเซอร์เป็น 250 หรือมากกว่า นอกจากนั้น tdmsam ไม่มีความสามารถที่จะใช้สำหรับ site ที่ต้องการใช้ระบบ PDC/BDC ที่ต้องการการตอบ (replication) ของ account database

การติดตั้ง Samba

  1. เชื่อมต่อไปยัง Server ผ่าน shell หรือเปิด shell window ในกรณี Ubuntu Server มีการติดตั้ง desktop เอาไว้ แล้วเปลี่ยน สถานะให้เป็น root user ด้วยการรันคำสั่ง :
    sudo su
    แล้วป้อนรหัสผ่านของ user ที่ถูกสร้างในระหว่างการติดตั้ง Ubuntu
  2. ติดตั้ง Samba package ด้วยคำสั่ง :
    apt-get install libcupsys2 samba samba-common
  3. แก้ไขไฟล์ smb.conf ด้วยคำสั่ง :
    vi /etc/samba/smb.conf
    ในส่วนของ global section ให้ลบเครื่องหมาย “;” หน้าคำว่า security = user ออก ให้เหลือเป็นแบบนี้ :
    security = user
    เพื่ออีนาเบิ้ล Linux system users ให้สามารถ login เข้าสู่ Samba server ได้
  4. ปิดไฟล์และ restart samba ด้วยคำสั่ง :
    /etc/init.d/samba restart

การเพิ่ม Samba shares
ต่อเป็นการเพิ่มส่วนที่ share ให้ user ทุกคนสามารถเข้าใช้งานได้

  1. เพิ่มไดเร็คทอรี่สำหรับการแชร์ไฟล์และเปลี่ยนเ้จ้าของไปเป็น users group ดังนี้ :
    mkdir -p /home/shares/allusers
    chown -R root:users /home/shares/allusers/
    chmod -R ug+rwx,o+rx-w /home/shares/allusers/
  2. ที่ท้ายไฟล์ /etc/samba/smb.conf ให้เพิ่มบรรทัดต่อไปนี้
    [allusers]
       comment = All Users
       path = /home/shares/allusers
       valid users = @users
       force group = users
       create mask = 0660
       directory mask = 0771
       writable = yes

  3. การทำให้ทุก user สามารถอ่านและเขียนใน home directory ของตัวเองผ่าน samba ได้ ให้เพิ่มบรรทัดต่อไปนี้เข้าไปในไฟล์ /etc/samba/smb.conf
    [homes]
       comment = Home Directories
       browseable = no
       valid users = %S
       writable = yes
       create mask = 0700
       directory mask = 0700
  4. restart Samba ด้วยคำสั่ง :
    /etc/init.d/samba restart

การเพิ่มและจัดการ users
ในตัวอย่างนี้จะเพิ่ม user ที่ชื่อว่า tom คุณสามารถเพิ่ม user จำนวนมากตามต้องการในวิธีการเดียวกัน ด้วยการแทนที่ username tom เป็น user อื่น ๆ ตามต้องการ

  1. เพิ่ม user ด้วยการใช้คำสั่ง :
    useradd tom -m -G users

  2. เซ็ตรหัสผ่านสำหรับ tom ใน Linux system user database โดยถ้าไม่ต้องการให้ user tom สามารถ login เข้า Linux system ได้ ก็ให้ข้ามขั้นตอนนี้ไป
    passwd tom
    แล้วป้อนรหัสผ่านของ tom ซึ่งเป็น new user
  3. เพิ่ม user tom ให้กับ Samba user database ด้วยคำสั่ง
    smbpasswd -a tom
    แล้วป้อนรหัสผ่านสำหรับ new user

มาถึงตอนนี้คุณควรจะสามารถ login จาก Windows Workstation ด้วย file explorer โดยใช้ username เป็น tom และรหัสผ่านที่ได้เคยกำหนดไว ้เพื่อเก็บไฟล์ไว้บน Linux Server ทั้งในตำแหน่งของ home directory และ public share directory ได้

จบครับ

Oct-15-09

การติดตั้ง IPCop จาก USB Drive

posted by อดิศร ขาวสังข์

ขั้นตอนการติดตั้ง

  1. ดาวน์โหลด IPCop เวอร์ชันที่เป็น “usb-fdd” จาก IPCop Download Page
  2. ดาวน์โหลด Utility ที่ชื่อว่า dd for windows ได้จาก ที่นี่ หรือ ที่นี่ หรือที่ ITWizard
  3. แตก zip file ไปเป็น dd.exe และแตกไฟล์ IPCop จากสกุลที่เป็น .gz ไปเป็น .img (ipcop-[version]-install-usb-fdd.i386.img) แล้วนำสองไฟล์นี้ไปไว้ใน Directory เดียวกัน
  4. เสียบ USB Drive โดยไฟล์ทั้่งหมดใน USB จะถูกล้าง  ดังนั้ืนถ้ามีไฟล์สำคัญให้ทำการสำรองไปไว้ที่อื่น
  5. เปิด Command Window และ Chage Directory ไปยังตำแหน่ง dd.exe และ IPCop.img แล้วรันคำสั่งต่อไปนี้
    dd if=ipcop-1.4.20-install-usb-fdd.i386.img of=\\.\f: bs=1k
    ตัว f หมายถึง USB drive สามารถเปลี่ยนได้ตามความเป็นจริง
  6. จะใช้เวลาประมาณ 5 นาทีในการเขียน Image ไปยัง USB เื่มื่อ dd.exe ทำงานเสร็จแล้วก็จะกลับไปยัง command prompt จากนั้นคุณก็สามารถนำ USB Drive ดังกล่าวไปใช้งานเพื่อติดตั้ง IPCop ได้หมายเหตุ Utility ดังกล่าวนี้จะทำการ reformat USB Drive ของคุณ ให้มีขนาดที่จำเป็นสำหรับ Image (ประมาณ 50 Mb) และถ้าคุณต้องการใช้งาน USB Drive เป็นปกติ คุณจะต้องการการ format ผ่าน Windows โดยใช้ FAT32

จบครับ

บทนำ

ufw (Uncomplicated Firewall) เป็นเครื่องมีสำหรับการคอนฟิก default firewall บน Ubuntu ซึ่งถูกพัฒนาขึ้นมาเพื่อให้สามารถคอนฟิกใช้งาน iptables firewall ได้ง่ายขึ้น โดย ufw เป็น user friendly ในการสร้าง host-based firewall ทั้งแบบ IPv4 และ IPv6

โดย default แล้ว ufw จะถูก disable ไว้  ทั้งนี้ ufw ไม่มีเป้าหมายให้เป็น complete firewall functionality ผ่าน command line interface แต่พัฒนาขั้นเพื่อให้สามารถเพิ่มหรือลบกฎของ Firewall ที่ง่ายขึ้น  โดยในปัจจุบันสามารถใช้งานเป็น host-based firewall เป็นหลัก

ตัวอย่างการใช้งาน

  1. ขั้นแรกต้องทำการ enable ตัว ufw ด้วยคำสั่ง
    sudo ufw enable
  2. เราสามารถเปิดพอร์ต ssh ด้วยคำสั่ง
    sudo ufw allow 22
    ซึ่งมีค่าเท่ากับ :
    sudo ufw allow proto tcp from any to any port 22
  3. สามารถแทรกตำแหน่งของกฎด้วยการใช้ตัวเลขระบุเป็นตำแหน่งได้เช่น
    sudo ufw insert 1 allow 80
  4. สามารถปิดพอร์ตที่ได้เปิดเอาไว้ด้วยคำสั่ง
    sudo ufw deny 22
  5. สามารถลบกฎที่ได้สร้างไว้ด้วยคำสั่ง
    sudo ufw delete deny 22 หรือ
    sudo ufw delete allow 22
  6. สามารถระบุ IP Address ต้นทางและปลายทางของกฎได้ด้วยคำสั่ง:
    sudo ufw allow proto tcp from 192.168.0.2 to any port 22
  7. สามารถกำหนด IP Address เป็น subnet ได้เ่่่ช่น
    sudo ufw allow proto tcp from 192.168.1.0/24 to any port 22
  8. เราสามารถ disable ufw ด้วยคำสั่ง
    sudo ufw disable
  9. สามารถดูสถานะของ ufw ด้วยคำสั่ง
    sudo ufw status (จะแสดงเฉพาะ user rule เท่านั้น)
  10. สามารถดูสถานะที่ีมีรายละเอียดเพิ่มเติมด้วยคำสั่ง
    sudo ufw status verbose (จะแสดงเฉพาะ user rule เท่านั้น)

สิ่งที่ควรรู้เพิ่มเติม

  1. เมื่อเราใ้้ช้ึคำสั่ง ufw enable แล้วโปรแกรมจะสร้างกฎพื้นฐานที่จำเป็นให้กับเครื่องโดยอัตโนมัติโดยสามารถดูได้จากคำสั่ง iptables -L ซึ่งจะได้ค่ากฎต่าง ๆ ดังนี้

    root@www:~# iptables -L
    Chain INPUT (policy DROP)
    target     prot opt source               destination
    ufw-before-logging-input  all  –  anywhere             anywhere
    ufw-before-input  all  –  anywhere             anywhere
    ufw-after-input  all  –  anywhere             anywhere
    ufw-after-logging-input  all  –  anywhere             anywhere
    ufw-reject-input  all  –  anywhere             anywhere

    Chain FORWARD (policy DROP)
    target     prot opt source               destination
    ufw-before-logging-forward  all  –  anywhere             anywhere
    ufw-before-forward  all  –  anywhere             anywhere
    ufw-after-forward  all  –  anywhere             anywhere
    ufw-after-logging-forward  all  –  anywhere             anywhere
    ufw-reject-forward  all  –  anywhere             anywhere

    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    ufw-before-logging-output  all  –  anywhere             anywhere
    ufw-before-output  all  –  anywhere             anywhere
    ufw-after-output  all  –  anywhere             anywhere
    ufw-after-logging-output  all  –  anywhere             anywhere
    ufw-reject-output  all  –  anywhere             anywhere

    Chain ufw-after-forward (1 references)
    target     prot opt source               destination

    Chain ufw-after-input (1 references)
    target     prot opt source               destination
    RETURN     udp  –  anywhere             anywhere            udp dpt:netbios-ns
    RETURN     udp  –  anywhere             anywhere            udp dpt:netbios-dgm
    RETURN     tcp  –  anywhere             anywhere            tcp dpt:netbios-ssn
    RETURN     tcp  –  anywhere             anywhere            tcp dpt:microsoft-ds
    RETURN     udp  –  anywhere             anywhere            udp dpt:bootps
    RETURN     udp  –  anywhere             anywhere            udp dpt:bootpc
    RETURN     all  –  anywhere             anywhere            ADDRTYPE match dst-type BROADCAST
    Chain ufw-after-logging-forward (1 references)
    target     prot opt source               destination

    Chain ufw-after-logging-input (1 references)
    target     prot opt source               destination

    Chain ufw-after-logging-output (1 references)
    target     prot opt source               destination

    Chain ufw-after-output (1 references)
    target     prot opt source               destination

    Chain ufw-before-forward (1 references)
    target     prot opt source               destination
    ufw-user-forward  all  –  anywhere             anywhere

    Chain ufw-before-input (1 references)
    target     prot opt source               destination
    ACCEPT     all  –  anywhere             anywhere
    ACCEPT     all  –  anywhere             anywhere            state RELATED,ESTABLISHED
    ufw-logging-deny  all  –  anywhere             anywhere            state INVALID
    DROP       all  –  anywhere             anywhere            state INVALID
    ACCEPT     icmp –  anywhere             anywhere            icmp destination-unreachable
    ACCEPT     icmp –  anywhere             anywhere            icmp source-quench
    ACCEPT     icmp –  anywhere             anywhere            icmp time-exceeded
    ACCEPT     icmp –  anywhere             anywhere            icmp parameter-problem
    ACCEPT     icmp –  anywhere             anywhere            icmp echo-request
    ACCEPT     udp  –  anywhere             anywhere            udp spt:bootps dpt:bootpc
    ufw-not-local  all  –  anywhere             anywhere
    ACCEPT     all  –  BASE-ADDRESS.MCAST.NET/4  anywhere
    ACCEPT     all  –  anywhere             BASE-ADDRESS.MCAST.NET/4
    ufw-user-input  all  –  anywhere             anywhere

    Chain ufw-before-logging-forward (1 references)
    target     prot opt source               destination

    Chain ufw-before-logging-input (1 references)
    target     prot opt source               destination

    Chain ufw-before-logging-output (1 references)
    target     prot opt source               destination

    Chain ufw-before-output (1 references)
    target     prot opt source               destination
    ACCEPT     all  –  anywhere             anywhere
    ACCEPT     tcp  –  anywhere             anywhere            state NEW,RELATED,ESTABLISHED
    ACCEPT     udp  –  anywhere             anywhere            state NEW,RELATED,ESTABLISHED
    ufw-user-output  all  –  anywhere             anywhere

    Chain ufw-logging-allow (0 references)
    target     prot opt source               destination

    Chain ufw-logging-deny (2 references)
    target     prot opt source               destination

    Chain ufw-not-local (1 references)
    target     prot opt source               destination
    RETURN     all  –  anywhere             anywhere            ADDRTYPE match dst-type LOCAL
    RETURN     all  –  anywhere             anywhere            ADDRTYPE match dst-type MULTICAST
    RETURN     all  –  anywhere             anywhere            ADDRTYPE match dst-type BROADCAST
    ufw-logging-deny  all  –  anywhere             anywhere            limit: avg 3/min burst 10
    DROP       all  –  anywhere             anywhere

    Chain ufw-reject-forward (1 references)
    target     prot opt source               destination

    Chain ufw-reject-input (1 references)
    target     prot opt source               destination

    Chain ufw-reject-output (1 references)
    target     prot opt source               destination

    Chain ufw-user-forward (1 references)
    target     prot opt source               destination

    Chain ufw-user-limit (0 references)
    target     prot opt source               destination
    LOG        all  –  anywhere             anywhere            limit: avg 3/min burst 5 LOG level warning prefix `[UFW LIMIT BLOCK] ‘
    REJECT     all  –  anywhere             anywhere            reject-with icmp-port-unreachable

    Chain ufw-user-limit-accept (0 references)
    target     prot opt source               destination
    ACCEPT     all  –  anywhere             anywhere

    Chain ufw-user-logging-forward (0 references)
    target     prot opt source               destination

    Chain ufw-user-logging-input (0 references)
    target     prot opt source               destination

    Chain ufw-user-logging-output (0 references)
    target     prot opt source               destination

    Chain ufw-user-output (1 references)
    target     prot opt source               destination
    root@www:~#

  2. โดยผมเข้าใจว่าแหล่งรวม firewall script ต่าง ๆ อยู่ที่ /etc/ufw
  3. สำหรับกฎที่สร้างเข้าไปเอง (user rule) จะอยู่ที่ไฟล์ /var/lib/ufw/user.rules

จบครับ