<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bass &#039;s Blog (เขียน Blog แบบ บ่นๆ ตามฉบับ นายเบส) &#187; Debian</title>
	<atom:link href="http://bass.bns.in.th/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://bass.bns.in.th</link>
	<description>ที่เขียนเรื่องบ้าๆ บ่อๆ กับความรู้ ของนายเบส ($BASS = &#34;Bass&#34;; print &#34;$BASS = 9Bass&#34;;) ปล. สถาที่นี้เป็นที่ส่วนบุคคล โปรดใช้วิจรญาณในการรับชมด้วยครับ</description>
	<lastBuildDate>Thu, 11 Mar 2010 10:02:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>IPSET Installation With Compile For iptables</title>
		<link>http://bass.bns.in.th/2010/01/01/ipset-installation-with-compile-for-iptables/</link>
		<comments>http://bass.bns.in.th/2010/01/01/ipset-installation-with-compile-for-iptables/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 05:45:11 +0000</pubDate>
		<dc:creator>bass</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[blockbit]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[ipset]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://bass.bns.in.th/?p=449</guid>
		<description><![CDATA[The installation requires the following steps
it is assumed that you have got the kernel source tree, configured and at least the modules compiled
donwload and unpack the source
run KERNEL_DIR= make to compile the userspace tool and the kernel modules
run KERNEL_DIR= make install to install the ipset userspace tool and the kernel modules
In order to use to [...]]]></description>
			<content:encoded><![CDATA[<p>The installation requires the following steps</p>
<p>it is assumed that you have got the kernel source tree, configured and at least the modules compiled<br />
donwload and unpack the source<br />
run KERNEL_DIR= make to compile the userspace tool and the kernel modules<br />
run KERNEL_DIR= make install to install the ipset userspace tool and the kernel modules<br />
In order to use to the set match and SET target<br />
you need iptables 1.4.4 (or above), or<br />
due to the ipset protocol change, you have to recompile iptables before 1.4.4 to get ipset 3.0 (or above) supported:<br />
Copy the file kernel/include/linux/netfilter_ipv4/ip_set.h from the source tree of ipset-3.9 to include/linux/netfilter_ipv4 in the source of iptables<br />
Recompile iptables<br />
and ready!</p>
<p>Refer : <a href="http://ipset.netfilter.org/install.html" rel="nofollow">http://ipset.netfilter.org/install.html</a></p>]]></content:encoded>
			<wfw:commentRss>http://bass.bns.in.th/2010/01/01/ipset-installation-with-compile-for-iptables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ArpON: ARP Poisoning Protection &#8212; Note ไว้ กันลืม</title>
		<link>http://bass.bns.in.th/2009/12/24/arpon-arp-poisoning-protection-note-%e0%b9%84%e0%b8%a7%e0%b9%89-%e0%b8%81%e0%b8%b1%e0%b8%99%e0%b8%a5%e0%b8%b7%e0%b8%a1/</link>
		<comments>http://bass.bns.in.th/2009/12/24/arpon-arp-poisoning-protection-note-%e0%b9%84%e0%b8%a7%e0%b9%89-%e0%b8%81%e0%b8%b1%e0%b8%99%e0%b8%a5%e0%b8%b7%e0%b8%a1/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 11:50:20 +0000</pubDate>
		<dc:creator>bass</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[arp]]></category>
		<category><![CDATA[netcut]]></category>

		<guid isPermaLink="false">http://bass.bns.in.th/?p=447</guid>
		<description><![CDATA[ArpON: ARP Poisoning Protection
Submitted by neutron on 13 August, 2009 &#8211; 02:18. ARP ArpON networking Poisoning Protection
ฝันร้ายของ admin ในระบบเครือข่าย อย่างหนึ่งที่เจอกันบ่อย ๆ คือ ARP poisoning หรือที่คนทั่วไปรู้จักกันในชื่อ NetCut ซึ่งปัญหานี้ เป็นช่องโหว่ของระบบเครือข่าย ซึ่งรู้โดยทั่วกันว่า หาทางแก้ได้แบบเด็ดขาดลำบากมาก เนื่องจากทางแก้ที่สมบูรณ์นั้น ต้องได้รับความร่วมมือจากผู้ใช้ด้วย
ARP poisoning หรือ ARP spoofing คือวิธีการโจมตีลักษณะหนึ่งในระบบเครือข่ายแบบ ethernet ไม่ว่าจะเป็นแบบ มีสายหรือไร้สาย โดยอาศัยช่องโหว่ของ ARP (Address Resolution Protocol) ซึ่งมีระบบความปลอดภัยต่ำมาก เนื่องจาก ARP เป็นโพรโทคอลที่คุยกัน และให้ความเชื่อถือข้อมูลที่ถูกส่งออกมาโดยไม่มีเงื่อนไขในการตรวจสอบที่มา และความน่าเชื่อถือของข้อมูลใด ๆ ทั้งสิ้น ซึ่งช่องโหว่นี้ เป็นที่มาของการปลอมข้อมูล [...]]]></description>
			<content:encoded><![CDATA[<p>ArpON: ARP Poisoning Protection<br />
Submitted by neutron on 13 August, 2009 &#8211; 02:18. ARP ArpON networking Poisoning Protection<br />
ฝันร้ายของ admin ในระบบเครือข่าย อย่างหนึ่งที่เจอกันบ่อย ๆ คือ ARP poisoning หรือที่คนทั่วไปรู้จักกันในชื่อ NetCut ซึ่งปัญหานี้ เป็นช่องโหว่ของระบบเครือข่าย ซึ่งรู้โดยทั่วกันว่า หาทางแก้ได้แบบเด็ดขาดลำบากมาก เนื่องจากทางแก้ที่สมบูรณ์นั้น ต้องได้รับความร่วมมือจากผู้ใช้ด้วย</p>
<p>ARP poisoning หรือ ARP spoofing คือวิธีการโจมตีลักษณะหนึ่งในระบบเครือข่ายแบบ ethernet ไม่ว่าจะเป็นแบบ มีสายหรือไร้สาย โดยอาศัยช่องโหว่ของ ARP (Address Resolution Protocol) ซึ่งมีระบบความปลอดภัยต่ำมาก เนื่องจาก ARP เป็นโพรโทคอลที่คุยกัน และให้ความเชื่อถือข้อมูลที่ถูกส่งออกมาโดยไม่มีเงื่อนไขในการตรวจสอบที่มา และความน่าเชื่อถือของข้อมูลใด ๆ ทั้งสิ้น ซึ่งช่องโหว่นี้ เป็นที่มาของการปลอมข้อมูล (spoofing) เพื่อหลอกให้ชาวบ้านหลงเชื่อตามที่โกหก</p>
<p>ในการโจมตี เป้าหมายหลัก ๆ ที่พบบ่อย มีอยู่ 2 สาเหตุ คือ</p>
<p>การทำ Man-In-The-Middle (MITM) คือ การที่ผู้ก่อการร้าย หลอกให้ชาวบ้านหลงเชื่อว่า ตัวเองนั้น เป็นเครื่องเกตเวย์ของเครือข่าย เพื่อให้ส่งข้อมูลต่าง ๆ มาที่เครื่องของผู้ก่อการร้าย และหลังจากนั้น ผู้ก่อการร้ายจะส่งข้อมูลต่อไปยังเกตเวย์ที่แท้จริงต่อไป ในกรณีนี้ ผู้ใช้จะยังใช้งานได้เหมือนไม่มีอะไรเกิดขึ้น ยกเว้นว่า ผู้ใช้อยู่ในระบบที่มีการตรวจสอบที่มา IP + MAC address ซึ่งกรณีนี้ ระบบอาจจะตรวจพบว่า ผู้ใช้มีการส่งข้อมูลมาจากแหล่งที่ไม่ได้รับอนุญาต แต่หากว่า เครื่องที่ผู้ก่อการร้ายใช้นั้น ได้รับอนุญาตเช่นกัน ก็จะไม่เห็นความผิดปกติใด ๆ เกิดขึ้น<br />
การทำ Denial-of-Service (DoS) หรือบางครั้งเรียกการทำ blackhole คือ การที่ผู้ก่อการร้าย หลอกให้ชาวบ้านหลงเชื่อว่า เครื่อง เกตเวย์อยู่ในที่ที่ไม่มีตัวตนจริงในระบบ หรือพูดง่าย ๆ คือ ส่ง MAC address ที่ไม่มีเครื่องใดเลยในระบบใช้อยู่ ผลที่ตามมาคือ ผู้ใช้ที่โดนหลอกด้วยการทำ blackhole จะไม่สามารถเชื่อมต่อกับเกตเวย์ของระบบได้ ทำให้ใช้งานเครือข่ายอินเทอร์เน็ตไม่ได้ หรือที่รู้จักกันในนาม NetCut<br />
โปรแกรมสำหรับทำ ARP spoofing หาได้โดยทั่วไปในอินเทอร์เน็ต และถูกใช้โดยผู้ที่รู้เท่าไม่ถึงการณ์ (และผู้ที่รู้เท่า และถึงการณ์) อย่างแพร่หลาย จึงมีความพยายามที่จะป้องกันการโจมตีในลักษณะดังกล่าวในหลาย ๆ รูปแบบ ทั้งทางฮาร์ดแวร์และซอฟต์แวร์ ซึ่งรู้โดยทั่วกันว่า ฮาร์ดแวร์ที่มีความสามารถในการจัดการเรื่องนี้ มีราคาที่ค่อนข้างสูง ถึงสูงมาก สำหรับระบบเครือข่ายที่มีทุนทรัพย์จำกัด (ทั่วไปในประเทศไทย) นั้น ทางออกที่น่าสนใจ คงตกอยู่ที่ซอฟต์แวร์</p>
<p>ArpON &#8220;Arp handler inspectiON&#8221; &#8211; <a href="http://arpon.sourceforge.net" rel="nofollow">http://arpon.sourceforge.net</a> เป็นซอฟต์แวร์ที่ถูกพัฒนาขึ้น เพื่อคอยตรวจสอบ และจัดการ ARP cache เพื่อให้เครื่องที่ใช้งาน ArpON ปลอดภัยขึ้นอีกระดับหนึ่ง ซึ่งเป็นการดี ที่จะติดตั้ง ArpON ไว้ที่เครื่องเกตเวย์ เพื่อที่จะป้องกันการถูกหลอกจากผู้ก่อการร้าย ซึ่งวิธีการติดตั้งเป็นดังนี้</p>
<p>สำหรับ Lenny (ArpON เป็นแพกเกจใหม่ ซึ่งเข้ามาใน repository หลังจากที่ Lenny release ออกไปแล้ว)</p>
<p># cd /var/cache/apt/archives<br />
# wget <a href="ftp://ftp.debianclub.org/debian/pool/main/a/arpon/arpon_1.90-1_amd64" rel="nofollow">ftp://ftp.debianclub.org/debian/pool/main/a/arpon/arpon_1.90-1_amd64</a>|i386].deb<br />
ติดตั้ง ArpON</p>
<p># dpkg -i arpon_1.90-1_[amd64|i386].deb ; apt-get -f install<br />
สำหรับ Squeeze และ Sid</p>
<p># apt-get install arpon<br />
หลังจากติดตั้งเสร็จ จะต้องมีการตั้งค่า ที่ /etc/default/arpon ซึ่งในแฟ้มดังกล่าวจะมีตัวอย่างการตั้งค่าไว้ทั้งแบบ SARPI (Static ARP Inspection) และ DARPI (Dynamic ARP Inspection) ซึ่ง SARPI จะใช้กับระบบมีการ fix ค่า IP ส่วน DARPI จะใช้กับระบบที่ใช้ DHCP ซึ่งรายละเอียดสามารถอ่านเพิ่มเติมได้ที่เว็บไซต์ของ ArpON</p>
<p>การกำหนดค่าใน /etc/default/arpon</p>
<p>SARPI</p>
<p>DAEMON_OPTS=&#8221;-d -f /var/log/arpon/arpon.log -g -i eth0 -s&#8221;<br />
DARPI</p>
<p>DAEMON_OPTS=&#8221;-d -f /var/log/arpon/arpon.log -g -i eth0 -y&#8221;<br />
กำหนดค่าให้ ArpON ทำงาน</p>
<p>RUN=&#8221;yes&#8221;<br />
สั่งให้ ArpON ทำงาน</p>
<p># /etc/init.d/arpon start<br />
  ArpON &#8220;Arp handler inspection&#8221; version 1.90 (<a href="http://arpon.sourceforge.net" rel="nofollow">http://arpon.sourceforge.net</a>)</p>
<p>  [07/13/2009 - 01:35:22 ICT] Task is forking to background, using /var/run/arpon.pid pid file&#8230;</p>
<p>.<br />
ซึ่งค่าตั้งที่กำหนดไว้ข้างบน เป็นการกำหนดว่า ให้ ArpON ตรวจสอบ ARP สำหรับอินเทอร์เฟซ eth0 หากต้องการตรวจสอบมากกว่า 1 อินเทอร์เฟซ สามารถกำหนดเพิ่มเติมได้ดังนี้</p>
<p>DAEMON_OPTS=&#8221;-d -f /var/log/arpon/eth0.log -g -i eth0 -s -f /var/log/arpon/eth1.log -g -i eth1 -y&#8221;<br />
ซึ่งจะกำหนดให้</p>
<p>(-i) eth0 : (-s) SARPI ทำการ log ไปที่แฟ้ม (-f) /var/log/arpon/eth0.log<br />
(-i) eth1 : (-y) DARPI ทำการ log ไปที่แฟ้ม (-f) /var/log/arpon/eth1.log<br />
หลังจากที่ ArpON ทำงาน ก็จะตรวจสอบ ARP request/reply ให้ และคอยตรวจสอบความถูกต้องให้อยู่เสมอ ทำให้เครื่องที่เป็นเกตเวย์ปลอดภัยจาก ARP poisoning ในระดับหนึ่ง อย่างน้อยก็ป้องกันได้ &#8220;ครึ่งทาง&#8221;</p>
<p>ตรวจ ARP cache table จะพบ</p>
<p># arp -n<br />
Address                  HWtype  HWaddress           Flags Mask            Iface<br />
192.168.1.1              ether   00:22:57:62:xx:xx   CM                    eth0<br />
Flags: CM แสดงให้เห็นว่า ArpON ทำการเพิ่ม 192.168.1.1:00:22:57:62:xx:xx เข้าไปใน ARP cache table แบบ manual ซึ่งหมายความว่า ระบบจะไม่เปลี่ยนแปลงค่านี้เองไม่ว่าจะมีการส่งค่าใด ๆ มาหลอกก็ตาม</p>
<p>แต่ทว่า การป้องกันเพียงข้างเดียว (ที่เกตเวย์) ไม่เพียงพอสำหรับการแก้ปัญหา ARP poisoning ต้องมีการแก้ที่ผู้ใช้ด้วย ซึ่งหากฝั่งผู้ใช้เป็น Linux, FreeBSD, NetBSD, OpenBSD and Mac OS X สามารถใช้ ArpON เพื่อป้องกันในลักษณะเดียวกับตัวอย่างนี้ได้ แต่หากผู้ใช้เป็น MS Windows แล้ว ต้องหาซอฟต์แวร์ที่ทำงานบน Windows เพื่อมาช่วยจัดการในลักษณะเดียวกัน ซึ่งโดยประสบการณ์ของผู้เขียน ยังให้ข้อสรุปไม่ได้ว่าซอฟต์แวร์ชุดไหนที่ทำงานบน Windows ได้ดี เนื่องจากไม่ค่อยได้ใช้ Windows ถ้า ArpON มีการพอร์ตให้ใช้กับ Windows ได้ก็คงจะดี <img src='http://bass.bns.in.th/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>ข้อแนะนำเพิ่มเติมสำหรับ admin ที่ดูแลระบบภายในโรงเรียน หรือสถานที่ ที่เครื่องคอมพิวเตอร์ไม่ได้มีการเคลื่อนย้าย สามารถทำ Static ARP ได้เองโดยอาจจะเขียน batch file ให้ระบบทำการเพิ่ม static ARP เข้าไปในระหว่างที่เครื่องเริ่มเปิดใช้งาน หรือใช้โปรแกรมชื่อ ARPFreeze (<a href="http://www.irongeek.com/i.php?page=security/arpfreeze-static-arp-poisoni&#8230;" rel="nofollow">http://www.irongeek.com/i.php?page=security/arpfreeze-static-arp-poisoni&#8230;</a>) ซึ่งช่วยอำนวยความสะดวกในการตั้งค่าเหล่านี้ให้เรา ก็จะช่วยปิดทางการทำ ARP poisoning ได้อย่างสมบูรณ์</p>
<p>โดย neutron<br />
Refer : <a href="http://debianclub.org/node/492" rel="nofollow">http://debianclub.org/node/492</a></p>]]></content:encoded>
			<wfw:commentRss>http://bass.bns.in.th/2009/12/24/arpon-arp-poisoning-protection-note-%e0%b9%84%e0%b8%a7%e0%b9%89-%e0%b8%81%e0%b8%b1%e0%b8%99%e0%b8%a5%e0%b8%b7%e0%b8%a1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Red5 Install</title>
		<link>http://bass.bns.in.th/2009/12/20/red5-install/</link>
		<comments>http://bass.bns.in.th/2009/12/20/red5-install/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 13:52:01 +0000</pubDate>
		<dc:creator>bass</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[red5]]></category>

		<guid isPermaLink="false">http://bass.bns.in.th/?p=438</guid>
		<description><![CDATA[Installing Red5 on Debian
This howto was provided by Nathan P. Johansen.
The following are steps used to get Red5 running on a Debian machine. This is the development version of Red5.
Before beginning this make sure you are running these commands as root.
Install Subversion:
apt-get install subversion
Install tools to build your own Debian packages:
apt-get install dpkg-dev debhelper dh-make [...]]]></description>
			<content:encoded><![CDATA[<p>Installing Red5 on Debian<br />
This howto was provided by Nathan P. Johansen.</p>
<p>The following are steps used to get Red5 running on a Debian machine. This is the development version of Red5.</p>
<p>Before beginning this make sure you are running these commands as root.</p>
<p>Install Subversion:<br />
apt-get install subversion<br />
Install tools to build your own Debian packages:<br />
apt-get install dpkg-dev debhelper dh-make devscripts fakeroot<br />
Install Java (see this tutorial for more info):<br />
apt-get install java-package<br />
Install Apache Ant 1.7:<br />
  wget <a href="http://apache.mirror.transip.nl/ant/binaries/apache-ant-1.7.1-bin.tar.gz" rel="nofollow">http://apache.mirror.transip.nl/ant/binaries/apache-ant-1.7.1-bin.tar.gz</a><br />
  tar zxvf apache-ant-1.7.1-bin.tar.gz<br />
  mv apache-ant-1.7.1 /usr/local/ant<br />
  export ANT_HOME=/usr/local/ant<br />
Once Java and Ant are all set up you simply download the latest development version of Red5 to your box.<br />
  svn co <a href="http://red5.googlecode.com/svn/java/server/trunk" rel="nofollow">http://red5.googlecode.com/svn/java/server/trunk</a> red5-trunk<br />
That will create a folder in your current directory called red5-trunk.</p>
<p>Navigate to the red5-trunk directory and run ant<br />
  cd red5-trunk<br />
  /usr/local/ant/bin/ant<br />
That will build the project on your machine.</p>
<p>At this point you will need to create a red5 directory in the /usr/local/red5 directory.<br />
mkdir /usr/local/red5<br />
Then you will want to copy the contents of the dist(distribution) folder to /usr/local/red5 like so<br />
cp -R red5-trunk/dist/* /usr/local/red5/<br />
We need need to fix the permissions on the red5.sh file:<br />
cd /usr/local/red5<br />
chmod 755 red5.sh<br />
To run the server you have a few options using the red5.sh file. Run the server by either running<br />
sh red5.sh &amp;<br />
or</p>
<p>./red5.sh &amp;<br />
This will start the Red5 service manually.</p>
<p>Verify the correct ports are being bound to:<br />
netstat -ant<br />
You may need to edit the red5.properties file in the /usr/local/red5/conf directory if you can’t connect to your server from an external location. Try to connect to the server before you modify the properties file because you may be able to connect to it with no problems.</p>
<p>Refer : <a href="http://osflash.org/red5/debian" rel="nofollow">http://osflash.org/red5/debian</a></p>]]></content:encoded>
			<wfw:commentRss>http://bass.bns.in.th/2009/12/20/red5-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>เฮ้อ ทำระบบ Search Log กับ Top Domain Sy&#8230;</title>
		<link>http://bass.bns.in.th/2009/11/22/%e0%b9%80%e0%b8%ae%e0%b9%89%e0%b8%ad-%e0%b8%97%e0%b8%b3%e0%b8%a3%e0%b8%b0%e0%b8%9a%e0%b8%9a-search-log-%e0%b8%81%e0%b8%b1%e0%b8%9a-top-domain-sy/</link>
		<comments>http://bass.bns.in.th/2009/11/22/%e0%b9%80%e0%b8%ae%e0%b9%89%e0%b8%ad-%e0%b8%97%e0%b8%b3%e0%b8%a3%e0%b8%b0%e0%b8%9a%e0%b8%9a-search-log-%e0%b8%81%e0%b8%b1%e0%b8%9a-top-domain-sy/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 03:48:41 +0000</pubDate>
		<dc:creator>bass</dc:creator>
				<category><![CDATA[ไร้สาระ]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[BHotspot]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[firwall]]></category>
		<category><![CDATA[Log]]></category>
		<category><![CDATA[พรบ คอม 2550]]></category>

		<guid isPermaLink="false">http://bass.bns.in.th/2009/11/22/%e0%b9%80%e0%b8%ae%e0%b9%89%e0%b8%ad-%e0%b8%97%e0%b8%b3%e0%b8%a3%e0%b8%b0%e0%b8%9a%e0%b8%9a-search-log-%e0%b8%81%e0%b8%b1%e0%b8%9a-top-domain-sy/</guid>
		<description><![CDATA[เฮ้อ ทำระบบ Search Log กับ Top Domain System เสร็จละครับพี่น้อง สบายตัวแล้ว วุ้ย 
สรุป ฟังก์ชั่น นะครับ
รองรับ การทำ Authentication สมบูรณ์ 100%
มีระบบจัดเก็บ Squid Log
มีระบบ จัดเก็บ IM Message
มีระบบ จัดเก็บ Radius
มีระบบ รายงานการใช้ในผู้ใช้แต่ละคน
มีระบบ แสดงข้อมูลการใช้งานในแต่ละ User แบบ Realtime (Bandwidth Monitor Realtime per User)
มีระบบ ค้นหา Log History Search
และที่สำคัญ ใช้ Chillispot ที่โม โดยตาเบส ครับ อิอิอิ(ตูเอง)
ครบเครื่องแล้วครับ]]></description>
			<content:encoded><![CDATA[<p>เฮ้อ ทำระบบ Search Log กับ Top Domain System เสร็จละครับพี่น้อง สบายตัวแล้ว วุ้ย </p>
<p>สรุป ฟังก์ชั่น นะครับ<br />
รองรับ การทำ Authentication สมบูรณ์ 100%<br />
มีระบบจัดเก็บ Squid Log<br />
มีระบบ จัดเก็บ IM Message<br />
มีระบบ จัดเก็บ Radius<br />
มีระบบ รายงานการใช้ในผู้ใช้แต่ละคน<br />
มีระบบ แสดงข้อมูลการใช้งานในแต่ละ User แบบ Realtime (Bandwidth Monitor Realtime per User)<br />
มีระบบ ค้นหา Log History Search<br />
และที่สำคัญ ใช้ Chillispot ที่โม โดยตาเบส ครับ อิอิอิ(ตูเอง)</p>
<p>ครบเครื่องแล้วครับ</p>]]></content:encoded>
			<wfw:commentRss>http://bass.bns.in.th/2009/11/22/%e0%b9%80%e0%b8%ae%e0%b9%89%e0%b8%ad-%e0%b8%97%e0%b8%b3%e0%b8%a3%e0%b8%b0%e0%b8%9a%e0%b8%9a-search-log-%e0%b8%81%e0%b8%b1%e0%b8%9a-top-domain-sy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>สรุปวันจัดการ Deb camp Thailand</title>
		<link>http://bass.bns.in.th/2009/11/16/debcamp01/</link>
		<comments>http://bass.bns.in.th/2009/11/16/debcamp01/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 05:49:12 +0000</pubDate>
		<dc:creator>bass</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[debcamp]]></category>

		<guid isPermaLink="false">http://bass.bns.in.th/?p=300</guid>
		<description><![CDATA[วันนี้ เข้า DebianClub.org
เลยไปเห็น เรื่องการจัดการ DebianCam
http://www.debianclub.org/node/509

วันงาน สรุป
ตกลงเป็นวันที่ 13-19 มี.ค. 2553]]></description>
			<content:encoded><![CDATA[<p>วันนี้ เข้า DebianClub.org<br />
เลยไปเห็น เรื่องการจัดการ DebianCam</p>
<p><a href="http://www.debianclub.org/node/509"><a href="http://www.debianclub.org/node/509" rel="nofollow">http://www.debianclub.org/node/509</a><br />
</a></p>
<p>วันงาน สรุป<br />
ตกลงเป็นวันที่ 13-19 มี.ค. 2553</p>]]></content:encoded>
			<wfw:commentRss>http://bass.bns.in.th/2009/11/16/debcamp01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo DNS Bind9 Master Slave Server</title>
		<link>http://bass.bns.in.th/2009/11/16/dns-bind9-master-slave-server-howto-htt/</link>
		<comments>http://bass.bns.in.th/2009/11/16/dns-bind9-master-slave-server-howto-htt/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 03:27:38 +0000</pubDate>
		<dc:creator>bass</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[bind9]]></category>
		<category><![CDATA[DNS]]></category>

		<guid isPermaLink="false">http://bass.bns.in.th/2009/11/16/dns-bind9-master-slave-server-howto-htt/</guid>
		<description><![CDATA[DNS Bind9 Master Slave Server HowTo
http://www.howtoforge.com/debian_bind9_master_slave_system
กำลังลองทำอยู่ ถ้าเสร็จแล้ว จะมาเรียบเรียงใหม่ ในรูปแบบของ นายเบส]]></description>
			<content:encoded><![CDATA[<p>DNS Bind9 Master Slave Server HowTo</p>
<p><a href="http://www.howtoforge.com/debian_bind9_master_slave_system" rel="nofollow">http://www.howtoforge.com/debian_bind9_master_slave_system</a></p>
<p>กำลังลองทำอยู่ ถ้าเสร็จแล้ว จะมาเรียบเรียงใหม่ ในรูปแบบของ นายเบส</p>]]></content:encoded>
			<wfw:commentRss>http://bass.bns.in.th/2009/11/16/dns-bind9-master-slave-server-howto-htt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitor Traffic  On Debian</title>
		<link>http://bass.bns.in.th/2009/11/10/monitor-traffic-on-debian/</link>
		<comments>http://bass.bns.in.th/2009/11/10/monitor-traffic-on-debian/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 03:25:25 +0000</pubDate>
		<dc:creator>bass</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[BHotspot]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[jnettop]]></category>
		<category><![CDATA[monitor]]></category>
		<category><![CDATA[tcptrack]]></category>
		<category><![CDATA[traffic]]></category>

		<guid isPermaLink="false">http://bass.bns.in.th/?p=280</guid>
		<description><![CDATA[jNettop &#8211; View hosts/ports taking up the most network traffic
jNettop captures traffic comming across the host it is running on and displays streams sorted by bandwidth they use. Result is a nice listing of communication on network by host and port, how many bytes went through this transport and the bandwidth it is consuming.
Install jnettop [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size: medium">jNettop &#8211; View hosts/ports taking up the most network traffic</span></strong></p>
<p>jNettop captures traffic comming across the host it is running on and displays streams sorted by bandwidth they use. Result is a nice listing of communication on network by host and port, how many bytes went through this transport and the bandwidth it is consuming.</p>
<p>Install jnettop in debian</p>
<p>#apt-get install jnettop</p>
<p>This will complete the installation now you need to run this program with the following command</p>
<p>#jnettop</p>
<p>This will display a GUI with all the network traffic comming across the host</p>
<p><strong>ตัวอย่าง</strong></p>
<p>jnettop -i eth0 &#8211;display text -t 5 &#8211;format &#8216;$src$,$srcport$,$srcbps$,$dst$,$dstport$,$dstbps<br />
สำหรับ Track Traffice</p>
<p>ตัวโปรแกรมนี้ สามารถกำหนดการ  Export Data ได้ ตอนนี้ทำเสร็จแล้ว สามารถแสดงผลในหน้่า WebGUI ได้ สามารถที่จะรู้ได้ว่า<br />
ใครใช้อะไรไปเท่าไหร่ เป็นต้น ตอนนี้เอาใส่เข้าไปใน BHotspot แล้วครับ</p>]]></content:encoded>
			<wfw:commentRss>http://bass.bns.in.th/2009/11/10/monitor-traffic-on-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ปรับแต่งภาพ Grub Loader</title>
		<link>http://bass.bns.in.th/2009/11/03/customizing-the-splash-image-in-grub/</link>
		<comments>http://bass.bns.in.th/2009/11/03/customizing-the-splash-image-in-grub/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 19:01:37 +0000</pubDate>
		<dc:creator>bass</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[gimp]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[splash]]></category>

		<guid isPermaLink="false">http://bass.bns.in.th/?p=267</guid>
		<description><![CDATA[Customizing the splash image in GRUB (ปรับแต่งภาพใน Grub Loader)
The splash image is the image shown in the background when GRUB (the GRand Unified Bootloader) is displaying the list of operating systems you can boot. Typically, this is the corporate logo of your Linux distribution. But its very simple to customize it to an image of [...]]]></description>
			<content:encoded><![CDATA[<p>Customizing the splash image in GRUB (ปรับแต่งภาพใน Grub Loader)</p>
<p>The splash image is the image shown in the background when GRUB (the GRand Unified Bootloader) is displaying the list of operating systems you can boot. Typically, this is the corporate logo of your Linux distribution. But its very simple to customize it to an image of your choice. All you need is the GIMP and gzip. My GIMP version is 1.2. Even older versions may do the job.</p>
<p>Here&#8217;s how:(You need to have root access)<br />
1)Start the GIMP.<br />
2)Click on File-&gt;New or type Ctrl+N<br />
3)In the new image dialog, change Width to 640 pixels and Height to 480 pixels. (The image should be of size 640&#215;480 pixels.) Now click OK.<br />
4)Create the image which you would like to be the splash image. It&#8217;s quite fun to experiment with the various tools of the GIMP!<br />
5)After you have finished creating the image, hit Alt+i or right click on the image and click on Image-&gt;Mode-&gt;Indexed&#8230;<br />
6)In the Indexed Color Conversion dialog that appears, click on the radio button &#8220;Generate optimal Palette&#8221; and in &#8220;# of colors&#8221; enter 14. Click OK.(The image should be of only 14 colors)<br />
7)Now right-click on the image and click on File-&gt;Save As&#8230;Save the file as splash.xpm in a directory of your choice.<br />
8)Now open a terminal window and navigate to the directory where you have saved splash.xpm<br />
9)Now key in gzip splash.xpm<br />
10)You will find that a file named splash.xpm.gz is created in the directory where splash.xpm used to exist.<br />
11)Copy this splash.xpm.gz to the /boot/grub directory. You may want to back up the pre-existing splash.xpm.gz file in the /boot/grub directory first.</p>
<p>That&#8217;s it! When you reboot, you will find your image in the background, with the menu of operating systems etc. in the foreground.</p>
<p>Of course, this is not the only way to change the image, but it is a very simple one.</p>]]></content:encoded>
			<wfw:commentRss>http://bass.bns.in.th/2009/11/03/customizing-the-splash-image-in-grub/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compile Debian + L7</title>
		<link>http://bass.bns.in.th/2009/11/03/compile-debian-l7/</link>
		<comments>http://bass.bns.in.th/2009/11/03/compile-debian-l7/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 18:40:37 +0000</pubDate>
		<dc:creator>bass</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[blockbit]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[imq]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[layer7]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://bass.bns.in.th/?p=260</guid>
		<description><![CDATA[Debian Lenny Compile Kernel

apt-get install gzip unzip bzip2 patch
apt-get install debhelper screen fakeroot zlib1g-dev build-essential libncurses5-dev kernel-package
apt-get install linux-source-2.6
cd /usr/src/
wget http://downloads.sourceforge.net/project/l7-filter/l7-filter%20kernel%20version/2.22/netfilter-layer7-v2.22.tar.gz
wget http://downloads.sourceforge.net/project/l7-filter/Protocol%20definitions/2009-05-28/l7-protocols-2009-05-28.tar.gz
wget http://www.ssi.bg/~ja/routes-2.6.26-15.diff
wget http://www.linuximq.net/patchs/linux-2.6.26.8-imq-test2.diff
wget http://www.linuximq.net/patchs/iptables-1.4.3.2-imq_xt.diff
wget http://www.netfilter.org/projects/iptables/files/iptables-1.4.3.2.tar.bz2
tar jxf linux-source-2.6.26.tar.bz2
tar zxf netfilter-layer7-v2.22.tar.gz
tar zxf l7-protocols-2009-05-28.tar.gz
tar jxf iptables-1.4.3.2.tar.bz2
ln -sd linux-source-2.6.26 ./linux
cd linux
patch -p1 &#60; /usr/src/netfilter-layer7-v2.22/kernel-2.6.25-2.6.28-layer7-2.22.patch
patch -p1 &#60; /usr/src/routes-2.6.26-15.diff
patch -p1  &#60; /usr/src/linux-2.6.26.8-imq-test2.diff
Networking options &#62; Network packet filtering framework (Netfilter) [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size: large">Debian Lenny Compile Kernel<br />
</span></strong></p>
<p>apt-get install gzip unzip bzip2 patch<br />
apt-get install debhelper screen fakeroot zlib1g-dev build-essential libncurses5-dev kernel-package</p>
<p>apt-get install linux-source-2.6</p>
<p>cd /usr/src/</p>
<p>wget <a href="http://downloads.sourceforge.net/project/l7-filter/l7-filter%20kernel%20version/2.22/netfilter-layer7-v2.22.tar.gz" rel="nofollow">http://downloads.sourceforge.net/project/l7-filter/l7-filter%20kernel%20version/2.22/netfilter-layer7-v2.22.tar.gz</a><br />
wget <a href="http://downloads.sourceforge.net/project/l7-filter/Protocol%20definitions/2009-05-28/l7-protocols-2009-05-28.tar.gz" rel="nofollow">http://downloads.sourceforge.net/project/l7-filter/Protocol%20definitions/2009-05-28/l7-protocols-2009-05-28.tar.gz</a></p>
<p>wget <a href="http://www.ssi.bg/~ja/routes-2.6.26-15.diff" rel="nofollow">http://www.ssi.bg/~ja/routes-2.6.26-15.diff</a></p>
<p>wget <a href="http://www.linuximq.net/patchs/linux-2.6.26.8-imq-test2.diff" rel="nofollow">http://www.linuximq.net/patchs/linux-2.6.26.8-imq-test2.diff</a><br />
wget <a href="http://www.linuximq.net/patchs/iptables-1.4.3.2-imq_xt.diff" rel="nofollow">http://www.linuximq.net/patchs/iptables-1.4.3.2-imq_xt.diff</a></p>
<p>wget <a href="http://www.netfilter.org/projects/iptables/files/iptables-1.4.3.2.tar.bz2" rel="nofollow">http://www.netfilter.org/projects/iptables/files/iptables-1.4.3.2.tar.bz2</a></p>
<p>tar jxf linux-source-2.6.26.tar.bz2<br />
tar zxf netfilter-layer7-v2.22.tar.gz<br />
tar zxf l7-protocols-2009-05-28.tar.gz<br />
tar jxf iptables-1.4.3.2.tar.bz2</p>
<p>ln -sd linux-source-2.6.26 ./linux</p>
<p>cd linux</p>
<p>patch -p1 &lt; /usr/src/netfilter-layer7-v2.22/kernel-2.6.25-2.6.28-layer7-2.22.patch<br />
patch -p1 &lt; /usr/src/routes-2.6.26-15.diff<br />
patch -p1  &lt; /usr/src/linux-2.6.26.8-imq-test2.diff</p>
<p>Networking options &gt; Network packet filtering framework (Netfilter) &gt; Core Netfilter Configuration.<br />
[ ] layer7 match support</p>
<p>[*] select all<br />
[M] select all</p>
<p>&quot;IMQ&quot; target support<br />
&quot;layer7&quot; match support<br />
[ ]   &quot;Layer7&quot; debugging output</p>
<p><strong>ติดตั้งแบบ ด่วน</strong><br />
make &amp;&amp; make modules &amp;&amp; make modules_install &amp;&amp; make install<br />
cd /boot<br />
mkinitramfs -o initrd.img-2.6.26.19 2.6.26.19<br />
update-grub<br />
reboot</p>
<p><strong>สำหรับสร้างเพื่อไป Install ที่อื่น (.deb)</strong></p>
<p>make clean &amp;&amp; make mrproper<br />
make menuconfig</p>
<p>make-kpkg clean<br />
fakeroot make-kpkg &#8211;initrd &#8211;append-to-version=-l7imq kernel_image kernel_headers<br />
cd /usr/src<br />
dpkg -i linux-image-*<br />
dpkg -i linux-headers-*</p>
<p>reboot</p>
<p><strong>iptables v1.4.3.2 เพื่อให้รองรับกับ layer7</strong><br />
cd /usr/src/iptables-1.4.3.2<br />
patch -p1 &lt; /usr/src/iptables-1.4.3.2-imq_xt.diff<br />
cp /usr/src/netfilter-layer7-v2.22/iptables-1.4.3forward-for-kernel-2.6.20forward/* /usr/src/iptables-1.4.3.2/extensions/<br />
./configure &#8211;with-kernel=/usr/src/linux<br />
make<br />
make install<br />
cd /usr/src/l7-protocols-2009-05-28<br />
make install</p>
<p>modprobe xt_layer7</p>
<p><strong>Files rc.local</strong></p>
<p>modprobe xt_rateest<br />
modprobe xt_helper<br />
modprobe xt_dccp<br />
modprobe xt_TPROXY<br />
modprobe xt_NFLOG<br />
modprobe xt_limit<br />
modprobe xt_tcpmss<br />
modprobe xt_connbytes<br />
modprobe xt_owner<br />
modprobe xt_sctp<br />
modprobe xt_DSCP<br />
modprobe xt_MARK<br />
modprobe xt_IMQ<br />
modprobe xt_statistic<br />
modprobe xt_quota<br />
modprobe xt_layer7<br />
modprobe xt_TCPOPTSTRIP<br />
modprobe xt_recent<br />
modprobe xt_NOTRACK<br />
modprobe xt_iprange<br />
modprobe xt_CONNSECMARK<br />
modprobe xt_multiport<br />
modprobe xt_CONNMARK<br />
modprobe xt_RATEEST<br />
modprobe xt_policy<br />
modprobe xt_dscp<br />
modprobe xt_pkttype<br />
modprobe xt_length<br />
modprobe xt_CLASSIFY<br />
modprobe xt_physdev<br />
modprobe xt_SECMARK<br />
modprobe xt_connlimit<br />
modprobe xt_tcpudp<br />
modprobe xt_TRACE<br />
modprobe xt_realm<br />
modprobe xt_conntrack<br />
modprobe xt_string<br />
modprobe xt_hashlimit<br />
modprobe xt_mac<br />
modprobe xt_time<br />
modprobe xt_mark<br />
modprobe xt_comment<br />
modprobe xt_u32<br />
modprobe xt_NFQUEUE<br />
modprobe xt_TCPMSS<br />
modprobe xt_socket<br />
modprobe xt_esp<br />
modprobe xt_state<br />
modprobe xt_connmark<br />
modprobe nf_conntrack_ftp<br />
modprobe nf_conntrack<br />
modprobe nf_nat_ftp<br />
modprobe nf_nat</p>
<p><strong>ทดสอบ Layer7</strong><br />
iptables -m layer7 -h</p>
<p><strong>Block Bit</strong><br />
iptables -A FORWARD -m layer7 &#8211;l7proto bittorrent -j DROP</p>
<p>iptables -nvL | grep LAYER</p>
<p><strong>ทดสอบ IMQ</strong><br />
<a href="http://www.linuximq.net/usage.html" rel="nofollow">http://www.linuximq.net/usage.html</a></p>
<div><strong>Refer :</strong> <a href="http://www.linuximq.net" rel="nofollow">http://www.linuximq.net</a><br />
<a href="http://www.ssi.bg/~ja/" rel="nofollow">http://www.ssi.bg/~ja/</a><br />
<a href="http://l7-filter.sourceforge.net/" rel="nofollow">http://l7-filter.sourceforge.net/</a><br />
<a href="http://mscompute.com/wiki/index.php/Layer7_IMQ_Route_Multipath_Loadbalance_Debian_Lenny_2.6.28" rel="nofollow">http://mscompute.com/wiki/index.php/Layer7_IMQ_Route_Multipath_Loadbalance_Debian_Lenny_2.6.28</a></div>]]></content:encoded>
			<wfw:commentRss>http://bass.bns.in.th/2009/11/03/compile-debian-l7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>เก็บ IP Traffic Log ด้วย ulogd  สำหรับ Debian</title>
		<link>http://bass.bns.in.th/2009/11/02/%e0%b9%80%e0%b8%81%e0%b9%87%e0%b8%9a-ip-traffic-log-%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-ulogd-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a-debian/</link>
		<comments>http://bass.bns.in.th/2009/11/02/%e0%b9%80%e0%b8%81%e0%b9%87%e0%b8%9a-ip-traffic-log-%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-ulogd-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a-debian/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 04:35:49 +0000</pubDate>
		<dc:creator>bass</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Log]]></category>
		<category><![CDATA[ulogd]]></category>

		<guid isPermaLink="false">http://bass.bns.in.th/?p=254</guid>
		<description><![CDATA[เก็บ IP Traffic Log ด้วย ulogd (Debian Admin Style)

อันนี้ ผมไป ค้นหาใน Google ไว้นานละครับ (ขอตัดข้อความจากต้นฉบับบ้างส่วนนะครับ) 
เริ่มเลยละกันครับ
1. ติดตั้ง packages ที่จำเป็น
# aptitude install ulogd ulogd-pcap tshark
2. เขียน script มาจัดการเกี่ยวกับ log
# vi /usr/local/bin/traffic-ulogd.sh
#!/bin/sh
ULOGD_CONF_TPL=/etc/ulogd.conf.tpl
ULOGD_CONF=/etc/ulogd.conf
LOG_DIR=/home/log/ip-traffic
PARENT_DIR=`date +%Y-%m`
PARENT_DIR=&#8221;$LOG_DIR/$PARENT_DIR&#8221;
DAILY_LOG=`date +%Y-%m-%d`
DAILY_LOG=&#8221;$PARENT_DIR/$DAILY_LOG.pcap&#8221;
# Copy original debian ulogd.conf file to be
# the future config template.
if [ ! -f $ULOGD_CONF_TPL ]; then
echo &#8220;Copying default $ULOGD_CONF to $ULOGD_CONF_TPL&#8221;
cp $ULOGD_CONF $ULOGD_CONF_TPL
fi
# [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color: #3366ff">เก็บ IP Traffic Log ด้วย ulogd (Debian Admin Style)<br />
</span></strong><br />
อันนี้ ผมไป ค้นหาใน Google ไว้นานละครับ (ขอตัดข้อความจากต้นฉบับบ้างส่วนนะครับ) </p>
<p>เริ่มเลยละกันครับ</p>
<p>1. ติดตั้ง packages ที่จำเป็น</p>
<p># aptitude install ulogd ulogd-pcap tshark</p>
<p>2. เขียน script มาจัดการเกี่ยวกับ log</p>
<p># vi /usr/local/bin/traffic-ulogd.sh</p>
<p>#!/bin/sh</p>
<p>ULOGD_CONF_TPL=/etc/ulogd.conf.tpl<br />
ULOGD_CONF=/etc/ulogd.conf<br />
LOG_DIR=/home/log/ip-traffic</p>
<p>PARENT_DIR=`date +%Y-%m`<br />
PARENT_DIR=&#8221;$LOG_DIR/$PARENT_DIR&#8221;</p>
<p>DAILY_LOG=`date +%Y-%m-%d`<br />
DAILY_LOG=&#8221;$PARENT_DIR/$DAILY_LOG.pcap&#8221;</p>
<p># Copy original debian ulogd.conf file to be<br />
# the future config template.<br />
if [ ! -f $ULOGD_CONF_TPL ]; then<br />
echo &#8220;Copying default $ULOGD_CONF to $ULOGD_CONF_TPL&#8221;<br />
cp $ULOGD_CONF $ULOGD_CONF_TPL<br />
fi</p>
<p># Create the directory structure for logging<br />
if [ ! -d $PARENT_DIR ]; then<br />
echo &#8220;Make directory $PARENT_DIR&#8221;<br />
mkdir -p $PARENT_DIR<br />
fi</p>
<p># Edit template config file<br />
cat $ULOGD_CONF_TPL | \<br />
sed -e &#8217;s:^#\(plugin=&#8221;/usr/lib/ulogd/ulogd_PCAP.so&#8221;\):\1:g&#8217; | \<br />
sed -e &#8220;s:/var/log/ulog/pcap.log:$DAILY_LOG:g&#8221; &gt; /tmp/ulogd.conf</p>
<p>mv /tmp/ulogd.conf $ULOGD_CONF</p>
<p># Restarting to reload config file<br />
/etc/init.d/ulogd restart</p>
<p>เป็น script ที่จะคอยจัดการเกี่ยวกับ directory สำหรับจัดเก็บ ในรูปแบบ 2008-08, 2008-09 และจัดเก็บ log file ในรูปแบบ 2008-08-26.pcap,&#8230;</p>
<p># chmod u+x /usr/local/bin/traffic-ulogd.sh<br />
# /usr/local/bin/traffic-ulogd.sh</p>
<p>สั่งให้ script จัด config ให้ และเริ่มรอการ log<br />
3. กำหนด iptables rule ให้ทำการ log</p>
<p># iptables -I FORWARD -j ULOG &#8211;ulog-cprange 100 &#8211;ulog-qthreshold 50</p>
<p>4. ลองดูคร่าว ๆ ว่ามี packet ผ่านเข้า log ไหม</p>
<p># iptables -nvL FORWARD<br />
Chain FORWARD (policy ACCEPT 211M packets, 106G bytes)<br />
pkts bytes target prot opt in out source destination<br />
14M 7502M ULOG all &#8212; * * 0.0.0.0/0 0.0.0.0/0 ULOG copy_range 100 nlgroup 1 queue_threshold 50</p>
<p>จะเห็นว่ามี Packet วิ่งเข้า rule นี้ด้วย<br />
5. ดูแฟ้มที่จัดเก็บ log (ผมเก็บไว้ที่ /home เพราะแบ่งพื้นที่ไว้เยอะที่นี่)</p>
<p># cd /home/log/ip-traffic/2008-08<br />
# ls<br />
2008-08-26.pcap<br />
# file 2008-08-26.pcap<br />
2008-08-26.pcap: tcpdump capture file (little-endian) &#8211; version 2.4 (raw IP, capture length 65535)</p>
<p>อ้า&#8230; ใช่แล้วครับ เป็น ลักษณะ tcpdump capture file  (binary ด้วย &#8230; เห็นเขาบอกให้เก็บในรูปแบบที่น่าเชื่อถือได้ ไม่รู้ตัวนี้น่าเชื่อถือพอหรือเปล่า<br />
6. ลองดู log ข้างในแฟ้มนี้ดู</p>
<p># tshark -r 2008-08-26.pcap -tad -c 5<br />
Running as user &#8220;root&#8221; and group &#8220;root&#8221;. This could be dangerous.<br />
1 2008-08-26 03:31:34.464265 172.30.10.18 -&gt; 80.252.110.146 TCP acter &gt; kar2ouche [SYN] Seq=0 Win=16384 Len=0 MSS=1452<br />
2 2008-08-26 03:31:34.537428 172.30.10.102 -&gt; 64.71.134.246 TCP ft-role &gt; https [SYN] Seq=0 Win=16384 Len=0 MSS=1452<br />
3 2008-08-26 03:31:34.565095 172.30.10.18 -&gt; 66.199.250.170 TCP appiq-mgmt &gt; manyone-xml [SYN] Seq=0 Win=16384 Len=0 MSS=1452<br />
4 2008-08-26 03:31:34.568396 172.30.10.18 -&gt; 219.239.90.172 TCP rfa &gt; 28221 [SYN] Seq=0 Win=16384 Len=0 MSS=1452<br />
5 2008-08-26 03:31:34.571477 172.30.10.18 -&gt; 72.51.37.237 TCP cxws &gt; ospf-lite [SYN] Seq=0 Win=16384 Len=0 MSS=145</p>
<p>ขอดูแค่ 5 packets ก่อนละกัน</p>
<p>-r 2008-08-26.pcap (read from file)<br />
-tad (Absolute date)<br />
-c 5 (5 packets count and exit)</p>
<p>7. เป็นอันว่า เก็บได้ ก็น่าจะเรียบร้อย ตอนนี้ก็เหลือให้ script เราทำงานเป็นช่วง ๆ เพื่อจัดการเรื่องชื่อไฟล์ให้ถูกต้อง</p>
<p># vi /etc/cron.d/traffic-log</p>
<p>0 */1 * * * root /usr/local/bin/traffic-ulogd.sh &gt;/dev/null 2&gt;&amp;1</p>
<p># /etc/init.d/cron restart</p>
<p>เป็นการกำหนดให้ระบบ run script นี้ ทุก ๆ ชั่วโมง (กันพลาด เดี๋ยว log ในแฟ้ม จะไม่ตรงกับวันเวลาจริง แต่ถ้าเครื่องเปิดตลอดเวลาไม่น่ามีปัญหา) เท่านี้ก็น่าจะเรียบร้อยแล้วครับผม ตอนนี้ก็เหลือดูผลว่าไฟล์ใหญ่แค่ไหน อาจจะต้องมีการมาทำ archive อีกที เดี๋ยวค่อยมาว่ากันต่อคราวหน้าละกันครับ</p>
<p>Refer : <a href="http://wittaya8.blogspot.com/2008/09/ip-traffic-log-ulogd-debian-admin-style.html">http://wittaya8.blogspot.com/2008/09/ip-traffic-log-ulogd-debian-admin-style.html</a></p>]]></content:encoded>
			<wfw:commentRss>http://bass.bns.in.th/2009/11/02/%e0%b9%80%e0%b8%81%e0%b9%87%e0%b8%9a-ip-traffic-log-%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-ulogd-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
