Chillispot secured Wi-Fi Access Gateway (dd-wrt)

Tuesday, December 27, 2011
Chillispot secured Wi-Fi Access Gateway (dd-wrt)
Contributed by วิบูลูลย์
Wednesday, 21 November 2007
เขียนโดย วิบูลย์ วราสิทธิชัย นักวิชาการคอมพิวเตอร์ ม.อ.
อ้างอิงเอกสารที่ผมอ่าน
HowTo: DD-WRT+chillispot & freeradius & mysql
https://www.zlabinger.at/blog/2006/05/26/playing-with-linksys-wrt54gs/
How to Flash the WRT54GL with DD-WRT Firmware
http://www.mandladventures.com/2007/04/12/how-to-flash-the-wrt54gl-with-dd-wrt-firmware/
Chillispot secured Wi-Fi Access Gateway คืออะไร
คืออุปกรณ์แอคเซสพอนต์เราเตอร์ (อุปกรณ์เครือข่ายไร้สาย) ที่ติดตั้ง firmware ใหม่ที่มีความสามารถในการป้
องกันการลักลอบเข้าใช้งาน โดยที่
firmware นั้นมีโปรแกรม Chillispot ใส่ไว้ให้แล้ว
Chillispot คืออะไร
คือ Open source software ที่นำมาใช้ในการควบคุมการใช้งานเครือข่ายไร้สาย เรียกว่า
wireless controller นิยมนำมาใช้เป็น gateway ติดตั้ง
ไว้บน linux box เพื่อคอยดักแพ็กเก็ต TCP port 80 และส่งหน้าจอ login ไปยังผู้ใช้งาน
หลักักการทำางาน
เมื่อท่า
น upgrade firmware ใหม่ ท่านสูญเสียการรับประกัน (warranty void) ครับ
เมื่อเครื่องโน้ตบุ๊คทำการคอนเนคเข้ามายังแอคเซสพอยต์ได้สำเร็จ ผู้ใช้เริ่มต้นการใช้งานบราวเซอร์เพื่อไปยังเว็บไซต์ใด ๆ ผู้ใช้จะได้รับหน้าจอ
แรกเป็นหน้าจอสำหรับ login เมื่อ login สำเร็จจึงจะสามารถใช้งานอินเทอร์เน็ตได้ หากว่าในโปรแกรบราวเซอร์ที่ใช้มีการเซ็ตค่าพร็อกซี่ไว้ก็จะไม่
แสดงหน้าจอ login ทำให้ใช้งานต่อไม่ได้
หลักการของระบบนี้คือ เมื่อเครื่องโน้ตบุ๊คคอนเนคกับแอคเซสพอยต์ได้แล้วจะได้รับไอพีแอดเดรสและพร้อมที่จะใช้งาน แต่ย ังใช้ไม่ได้ เพราะว่าเมื่อ
ผู้ใช้เปิดโปรแกรมบราวเซอร์เพื่อไปยังเว็บ ทำให้แอคเซสพอยต์จะได้รับข้อมูล TCP port 80 จากเครื่องโน้ตบุ๊ค มันจะส่งไปยังโปรแกรม chilli ที่อยู่
ในตัวมัน (แอคเซสพอยต์) (โปรแกรม chilli เป็น 1 โพรเซสของ linux OS ที่รันอยู่ในแอคเซสพอยต์) โปรแกรม chilli จะส่งหน้าจอ login ซึ่งถูก
กำหนดไว้ว
่าให้ไปเอาห
น้าจ

login จาก
เว็บ
ไซต์ไหน
เมื่อ
ผู้ใช้ใส่ login และ password โปร
แกร

chillispot ก็จะนำ login และ password ส่ง
ไป
สอบถามที่ RADIUS server ที่กำหนดไว้ จากนั้น RADIUS server ก็จะตอบกลับมายัง chilli แล้ว chilli ก็จะทำการเปิดเส้นทางให้กับผู้
ใช้งานก็ต่อ
เมื่อ login และ password ถูกต้อง
ฮาร์ดแวร์ที่ใช้
Linksys WRT54GL v1.1
RADIUS server
Web server
Notebook ที่ใช้ทำขั้นตอน upgrade firmware เป็น Windows XP SP2 มี IE6
ซอฟต์แวรที่ใช้
firmware DD-WRT v23 SP2
วิธีทำแบบคร่าว ๆ (ดูรายละเอียดด้านล่างเพิ่มเติม )
1. ทำขั้นตอนการ upgrade firmware DD-WRT v23 SP2 ลงใน Linksys WRT54GL v1.1
2. เตรียม RADIUS server
3. เตรียม Web server (ใช้เครื่องเดียวกับ RADIUS ได้)
4. ตรวจสอบแฟ้
ม Firewall ในเครื่อง RADIUS ว่า
อนุญาตให้มีการติดต่อเข้าไปที่ port UDP 1812 และ 1813 และ Web server อนุญาต TCP port
443
5. ทำขั้นตอนการคอนฟิก chillispot ที่ Linksys WRT54GL
6. ปิด DHCP server ที่แจกไอพีให้กับ LAN port 1 - 4
7. reboot Linksys router
8. ทดสอบเปิดบราวเซอร์ท ี่เครื่องโน้ตบุ๊คให้เชื่อมต่อกับ SSID ที่เป็น Linksys ที่เรากำลังทดสอบ (ในขั้นตอนนี้ต้องไม่เซ็ตค่าพร็อกซี่ในบราวเซอร์)
การ upgrade firmware
สิ่งที่ต้องทำก่อน
- ปิด antivirus และ firewall อื่น ๆ ที่อาจมีผลให้ upgrade ไม่ได้
- ใช้ port LAN 1 - 4 เท่า
นั้น โดยใช้สาย UTP ต่อระหว่าง Linksys กับ Notebook ตอนนี้ไม่ใช้ Wi-Fi โดยการปิดปุ่ม Wi-Fi ซะเลย
Wiboon at PSU :: Chillispot secured Wi-Fi Access Gateway (dd-wrt) Page 1 of 3
http://mamboeasy.psu.ac.th/~wiboon.w/index2.php?option=com_content&task=view&... 18/2/2553
- ใช้ port WAN ต่อเข้ากับ ADSL หรือ LAN ของตึกเพื่อให้รับ DHCP IP เพื่อให้ต่อเชื่อมอินเทอร์เน็ตได้
- ทำการ reset linksys ให้ใช้ค่า Factory default โดยการใช้ปลายไขควงขนาดเล็กจิ้มที่ปุ่ม reset ด้านท้ายเครื่อง ค้างไว้ในขณะเดียวกันก็ปลดสาย
ไฟออก แล้วเสียบสายไฟกลับไป ยังคงค้างการกดปุ่ม reset ไว้จนครบ 30 วินาที (ยังไม่ได้ลองใช้คำสั่ง Factory defaults ใน web interface ของ
linksys ว่าเหมือนกันไหม)
1. ดาวน์โหลด firmware DD-WRT v23 SP2 จากเว็บไซต์ http://dd-wrt.com/dd-wrtv2/downloads.php ซึ่งมีเวอร์ชั่น standard, voip และ vpn
ให้เลือก หรือตรงไปยังแฟ้
ม standard ได้ที่ http://www.dd-wrt.com/dd-wrtv2/downloads/stable/dd-wrt.v23%20SP2/ddwrt.
v23_sp2_standard.zip
2. ทำขั้นตอนการ upgrade firmware (ที่ผมทำใช้ทดสอบเป็นชุด standard)
2.1 เข้าหน้าเว็บของ Linksys คือ http://192.168.1.1 ใช้ login คือ root และ password คือ admin
2.2 เลือกแท็บ Administration เลือก Firmware Upgrade (ระวังไฟฟ้
าดับในระหว่างทำ)
2.3 เลือกชื่อแฟ้
ม dd-wrt.v23_generic.bin จากที่แตกแฟ้
ม .zip ออกมา
2.4 รอจนเสร็จ ภาวนาอย่าให้ไฟฟ้
าดับ
เตรียม RADIUS server
ตัวอย่างจะใช้ไอพีแอดเดรส 192.168.2.20 เป็น RADIUS server
วิธีการคอนฟิก RADIUS server แล้วแต่เลือกว่าจะใช้อะไรเป็น database โปรดอ่านบทความสำหรับทำ RADIUS server ได้จาก
http://mamboeasy.psu.ac.th/~wiboon.w เมนู chillispot wifi หัวข้อ การติดตั้ง mysql ใช้ร่วมกับ freeradius อย่างง่าย ลองดูอันนี้ก็ได้
ที่ RADIUS server ต้องกำหนดสิทธิอนุญาตไอพีแอดเดรสของ Linksys Router ถ้าเป็น freeradius ต้องแก้ไขแฟ้
ม /etc/raddb/clients.conf โดย
เพิ่มบรรทัด
client ไอพีแอดเดรสของ Linksys Router {
secret=testing123-1
}
เตรียม Web server เพอืื่่ เก็บ็บเว็บเพจหน้า login (Redirect URL)
ตัวอย่างจะใช้ไอพีแอดเดรส 192.168.2.33 เป็น Web server ที่เก็บแฟ้
ม hotspotlogin.cgi ซึ่งเป็น Redirect URL ที่เป็นหน้า login
ดาวน์โหลดแพ็กเกจ chillispot v1.1 มาแล้วก็อปปี้เฉพาะแฟ้
ม hotspotlogin.cgi ไปไว้ในเว็บเซิร์ฟเวอร์ ถ้าเป็น apache web server ให้เก็บไว้
ท ี่ /var/www/cgi-bin
แก้ไขแฟ้
ม hotspotlogin.cgi ให้มี uamsecret ตรงกันกับที่กำหนดในขั้นตอนการคอนฟิก chillispot
การคอนฟิก chillispot
1. เลือก Administrator แล้วเลือกแท็บ Hotspot
2. ในหน้าต่าง Hotspot ให้เลือก enable รายการ chillispot แล้วจะเห็นรายการช่องว่างให้เติม
3. เลือก enable รายการ Separate Wifi from LAN bridge เพื่อแยก port 1-4 ของอุปกรณ์ออกจาก LAN ของ Wi-Fi
4. ช่อง Primary Radius Server ให้ใส่ไอพีแอดเดรสของ Radius ตัวอย่างเช่น 192.168.2.20
5. ช่อง Backup Radius Server ให้ใส่ไอพีแอดเดรสของ Radius อีกตัว ถ้าไม่มีให้ใช้เหมือนกับข้อ 4
6. ช่อง DNS IP ให้ใส่ไอพีแอดเดรสของ domain name server ตัวอย่างเช่น 192.100.77.5
7. ช่อง Redirect URL ให้ใส่เว็บเพจหน้า login ตัวอย่างเช่น https://192.168.2.33/cgi-bin/hotspotlogin.cgi
8. ช่อง Shared key ให้ใส่ secret key ที่ตรงกับ RADIUS
9. ช่อง DHCP interface ให้กำหนดเป็น WLAN เท่านั้นเพื่อให้ chilli แจกไอพีให้กับ wireless clients เท่านั้น
10. ช่อง Radius NAS ID ให้ตั้งชื่ออะไรก็ได้ เช่น dd-wrt-chilli
11. ช่อง UAM secret ให้ใส่ uamsecret ที่ตรงกันกับ hotspotlogin.cgi
12. ช่อง Additinal Chillispot Option ให้ใส่หมายเลขเน็ตเวอร์คที่ต้องการ หากไม่ตั้งจะใช้เป็น 192.168.182.0/24 ตัวอย่า
งเช่น ตงั้ เป็น net
10.201.1.0/24
13. ทำการ save config
ภาพตัวอย่างการคอนฟิก chilli
Wiboon at PSU :: Chillispot secured Wi-Fi Access Gateway (dd-wrt) Page 2 of 3
http://mamboeasy.psu.ac.th/~wiboon.w/index2.php?option=com_content&task=view&... 18/2/2553
การปิด DHCP server ทแีี่่ จกไอพีให้กับ LAN port 1 - 4
1. ไปที่แท็บ setup เลือก Basic Setup
2. เลือก disable DHCP server
reboot Linksys router
เพื่อให้ chillispot ใช้ค่าคอนฟิกใหม่ที่กำหนด
จบ
Last Updated ( Thursday, 22 November 2007 )
Close Window
Wiboon at PSU :: Chillispot secured Wi-Fi Access Gateway (dd-wrt) Page 3 of 3
http://mamboeasy.psu.ac.th/~wiboon.w/index2.php?option=com_content&task=view&... 18/2/2553

Setup a pfSense 2.0 firewall when default gateway is on a different subnet

This article has been updated for pfSense 2.0. The original article about pfSense 1.2.X has moved here.
If you buy a VMware server and an IP block from OVH you will be surprised because the default gateway don't match the IP block. Even if this setup is unusual, it is valid and give full satisfaction if you know how to configure your firewall and hosts.
There are some advantages to use this technique for the provider/WEB hoster: this make the router configuration a lot simpler (no need to setup an IP address for each underlying IP block, they can merge routes for adjacent IP blocks together) and the most important, this save one IP address in the block.
Windows host accepts this unusual configuration and just work, thanks Bill for this great job .
pf-shellcmd
Linux host requires a little trick.
[root@fc6-pmx ~]# route add default gw 192.168.23.254
SIOCADDRT: Network is unreachable
Linux refuses to add the route because it don't know how to reach the gateway itself. Add the appropriate route for the gateway, before the default route, solves the problem.
[root@fc6-pmx ~]# route add -host 192.168.23.254 dev eth0
[root@fc6-pmx ~]# route add default gw 192.168.23.254
This works !
[root@fc6-pmx ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.23.254  0.0.0.0         255.255.255.255 UH    0      0        0 eth0
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
0.0.0.0         192.168.23.254  0.0.0.0         UG    0      0        0 eth0
To configure a firewall, depending of the firewall, you will have to be imaginative !

Differences with the 1.2.X config

The main ideas are the same as in the previous article , but the trick used to connect the gateway is different and finally a lot simpler. I recommend this setup !

Schema

Here is the schema I used to test this configuration.
Network schema
All IPs are from the Address Allocation for Private Internets but it is for testing ! Use the addresses you get from your provider or WEB hoster. For real, only the 172.22.22.1 and 19.168.1.0/24 can be in a private network.
  • 192.168.23.254 is the default gateway given by my provider.
  • 10.0.0.0/24 is the IP block given by my provider. I assign it to my DMZ.
  • 192.168.1.0/24 is a for a virtual LAN, to put machines that help to configure and manage the FW and servers in the DMZ.

The gateway trick

Instead of creating an ARP entry using a command line at startup, I force a route to the gateway by using the route command twice. The trick is the identical to the one used for the Linux in the previous article. It is not possible to create such routes using the Web interface then once more the shellcmd module come to rescue to setup the route at startup.
To create a route up to 192.168.23.254, on an interface having no IP in this range, I use the commands:
route add -net 192.168.23.254/32 -iface em0
route add default 192.168.23.254  
The first line tell the firewall that IP address 192.168.23.254 is on the side of the em0 interface (em0 is my WAN interface), the second one use this address as the default gateway.
This time, their is no need to found the MAC address of the gateway like in the first article. But some operations like: disable the em0 interface or setup a default gateway; can break the trick and would require to reload the route manually or reboot the firewall.
To remove the route you can use:
route del default 192.168.23.254  
route del -net 192.168.23.254/32 -iface em0
You can create the default route as soon has you have access to the firewall, using ssh, the console or by using the Command prompt in the Diagnostics menu of the Web interface. To be sure the routes are there, click the Routes option in the Diagnostic menu. An look for the two routes.
Routes
Be careful You have to remove any default route before to run these two commands !
This will not give you access to the Internet forthwith, you need some more settings.

The WAN interface

I don't want to waste an IP address, I choose a completely unrelated address 172.22.22.1, and don't setup any gateway because the job is already done by the 2 commands above.
WAN config

The DMZ interface (OPT1)

This is where the servers having a public address live. I give the 10.0.0.1 address to the firewall, this will be the default gateway for servers in the DMZ but also the public IP of the firewall on the WAN side.
DMZ config

The LAN interface

The LAN can be used if you need additional hosts that don't need to be reachable from the Internet but are required to manage the DMZ or for any other purpose. These hosts can access the DMZ (and vice versa when required). This is where I put a virtual machine to configure this firewall. Machines in this zone can be accessed from the Internet too, see later.
LAN config
I keep the default settings of the firewall for this interface.

Setup the Proxy ARP

The 10.0.0.0/24 subnet is on the DMZ side. To allow the firewall to reply to ARP requests for these addresses on the WAN interfaces, we have to add a proxy ARP entry.
Proxy ARP
I do it for the full subnet at once, in previous article I did it address by address. This is faster but also bypass a bug or a feature in 2.0 that forbid the use of an address already used by an interface. I'm thinking here about DMZ address 10.0.0.1. It is possible to go around this by creating the Proxy ARP before to assign the address to the DMZ interface. But using a subnet here bypass the problem !

Masquerade the source address

For now, packets leaving the firewall have address 172.22.22.1, replies will never come back ! We need to rewrite the source address for packet leaving the firewall. I use hide NAT to give them the 10.0.0.1 address. I assign this address for packet coming from the firewall, but also to masquerade the LAN zone.
Outbound NAT 1
Here are the detail for the LAN, the config for the firewall is similar.
Outbound NAT 2
Now any packets from the firewall or hosts from the LAN will leave the firewall with address 10.0.0.1
Double check the rules for the LAN, and be sure the "Default allow LAN to any rule" permit outgoing connections :
Rules LAN
Don't hesitate to be more strict, for example my second rule block port 25 to the Internet, but not to the DMZ. Here I allow all protocols except some, but the good way when configuring a firewall is to block all traffic by default and permit only some protocols.

The gateway: trick part 2

Now the firewall and the LAN have Internet access, at least after you have setup your DNS. You can now hardcode the gateway trick. You need to install the shellcmd package. The version 0.5 is for pfSense 1.0 but works well with 2.0 too. Install it from the package manager in the System menu!
Package Manager
And in the Service menu, select the Shellcmd option and setup the two commands :
Shellcmd

The DMZ zone (OPT1)

To use your DMZ you have to add filter rules to allow packets to leave the DMZ to the WAN side. Here for outgoing packets...
DMZ outgoing rule
Here I block packets to the LAN, because the DMZ is no more than a part of the Internet itself, any access to the LAN from the DMZ or the Internet must be carefully thought through.
.. and here incoming packets to my public WEB server 10.0.0.2 (the first rule)!
WAN Incoming rule
Create other rules for your other servers and services inside your DMZ !
Because we are using routing we don't need any NAT rules between WAN and DMZ !
LAN has already a full access to the DMZ because of the rule "Default allow LAN to any rule" seen previously. !

The LAN zone

If you need to access some resources inside your LAN from Internet, you can NAT some ports from address 10.0.0.1. Here I forward RDP to my 192.168.1.100 Windows host :
LAN NAT
Double check, pfSense has created the appropriate filter rules.
WAN incoming rules
That'it !

The final touch

Their is lot of other thing to say and to do, but this is not a tutorial about firewall. Anyway I was very impatient to try the new Floating tab in the Rules screen ! I have added a rule to let DMZ hosts reply to ping request. Here it is:
Allows ICMP echo request
Before the Floating tab, you add to duplicate some rules in each interface tab. This was making pfSense 1.2.X a bit unsuitable for configuration with lot of interfaces and rules !

Add IP fail-over

If you need to manage IP fail-over inside this configuration, take a look at this post

Advantages of this configuration

The biggest advantage of this configuration is the use of routing instead of NAT to forward packets. The other are:
  • this config provide a zone for your hosts in your DMZ and your LAN with usual network settings (a gateway in the same LAN subnet).
  • this config is based on routing instead of NAT, this avoid problems with NAT sensible protocol like: ftp, pptp, ...
  • NAT drops connection if no packets are going through for too long. Routing don't and don't require any keep alive plaster!
  • the hosts in your DMZ use the public IP addresses, this make things simple and avoid confusion.
  • LAN access your DMZ using public IP addresses.
  • no need to define NAT rules, only the filter rules are required.
  • reduce the MEMORY and CPU usage of the firewall.
Hope this help !

ปิดPortให้หมด แล้วเปิดเฉพาะ Port ที่จำเป็น (บล็อกบิต ขั้นต้น)

http://forum.internetsup.com/index.php/topic,64.0.html

 ผมขอแนะนำหลักการณ์เชตอัพ Firewall ในแบบที่สามัญที่สุดและก็ได้ผลชัดเจน นั้นคือ การเปิดพอร์ท(Port Number)เฉพาะเท่าที่จำเป็น ส่วนพอร์ทอื่นที่ไม่ได้ใช่งานหรือไม่จำเป็นก็ให้ปิด(Block)ลงให้หมดครับ

ข้อดีของวิธีการนี้
- เป็นวิธีการ ที่เข้าใจง่าย หรือพูดแบบบ้านๆก็คือ เราเลือกเปิดเฉพาะประตูที่จำเป็น แล้วปิดประตูที่ไม่อยากให้ใช้งาน... Port ก็เหมือนประตูทางเข้า-ออกของเน็ตเวิร์ค โดยโปรแกรมแอพพลิเคชันต่างๆ ก็มักจะใช้งานในประจำPortเติมๆ(ตาม Port Number มาตรฐาน) ซึ่งจริงๆแล้วมีจำนวนพอร์ทที่ใช้งานแค่หยิบมือเดียวเองครับ... แต่อาจจะมีบางโปรแกรมที่ใช้Portที่นอกเหนือจากมาตรฐาน เช่น Bittorrent, P2P, เกม เป็นต้น ซึ่งเมื่อเราปิดPortส่วนใหญ่ที่ไม่จำเป็นลงซะ โปรแกรมพวกนี้ก็จะเจอทางตัน เราก็จะบล็อกโปรแกรมพวกนี้ได้นั้นเอง (ถึงอาจจะไม่100% แต่ก็ได้ผล 90-95%อัพล่ะครับ)

- เป็นการเพิ่มความปลอดภัยโดยตรง ให้กับทั้งระบบ... เพราะเมื่อมีจำนวนPortช่องทางน้อยลง การโจมตีผ่านPortก็จะลดลง เป็นอันว่าเราสามารถหลีกเลียงHackerสมัครเล่นที่ใช้โปรแกรมหรือBotพื้นๆ.. ได้มากโขเชียวครับ


ข้อด้อยของวิธีการนี้
- มันไม่ไช้วิธีการที่มีประสิทธิภาพสูงสุด(ในเชิงสมถรรนะ)... เพราะวิธีการนี้ไม่มีการสมองใดๆเลย(ก็แค่ปิดหรือเปิดมันลูกเดียว) ซึ่งหากเรามีผู้ใช้ลูกข่ายหลายๆคน ซึ่งแต่ล่ะคนอาจมีความต้องการใช้โปรแกรมต่างๆกัน เช่น คนนึ่งจะใช้VoIPโทรหาแฟนที่อังกฤษ, คนนึงเล่นหุ้นต้องใช้โปรแกรมดูกระดานหุ้น, คนนึงเป็นโปรแกรมเมอร์ต้องการใช้VPN ฯลฯ... พวกเขาหล่าวนี้จะพบความไม่สะดวก แล้วต้องเดินมาบอกAdminว่า "เขาใช้งานไม่ได้..เปิดพอร์ทโน้น/พอร์ทนี้..เพิ่มได้ไหม" กรณีแบบนี้ล่ะครับ จะเป็นเรื่องจุกจิกให้คนดูแลระบบต้องมีงานช่วยเหลือผูใช้เพิ่มขึ้น

- มันไม่ไช่วิธีที่กินกำลังประมวล(CPU)ต่ำที่สุด... โดยเฉพาะกรณีหอพักนักศึกษา(พูดง่ายๆว่าเกรียงเยอะ) ผู้ใช้(เกรียงๆ)แต่ ล่ะคนจะพยายามหาทางใช้โปรแกรมของตนให้ได้ บ่างก็ดันทุรังใช้(เช่น เปิดบิตค้างไว้เฉยๆ) หรือไม่งั่นก็อาจพาลยิ่งNetcutหรืออื่นๆจิปะถะ... ทำให้ตัวFirewallระบบต้องมาทำงานจุกจิกพวกนี้เกินเหตุ(ทั้งที่มันไม่ไช่ เรื่องเลย) เราก็อาจจะเจออารมณ์เบื่อๆทำนองนี้ล่ะครับ

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


Port Number คืออะไร.?
ขอพูดโดยสังเขปนะครับ...
ระบบ Port Number นั้นเป็นวิธีการกำหนดช่องทางให้ โปรแกรมแอพพลิเคชันต่างๆได้รับส่งข้อมูลผ่านทางพอร์ทที่มีเลขหมายประจำต่างๆ หรือในบางกรณีเลขพอร์ทก็เป็นตัวกำหนดลักษณะรูปแบบข้อมูลไปในตัว(เพราะPort นี้..จะใช้กับโปรแกรมประเภทนี้ๆ) เช่น Portเลข 80 สำหรับ HTTP, 23 สำหรับ Telnet, 20กับ21สำหรับFTP เป็นต้น...

แล้วถ้าถามว่าใครเป็นผู้ออกมากำหนดมาตรฐานเลข Port ล่ะ.. ผู้นั้นก็คือ องค์กร Internet Assigned Numbers Authority - IANA (ซึ่งเป็นเจ้าเดียวกับที่คุ่มมาตรฐานระบบเลข IPv4/v6 นั้นล่ะ) และด้วยเลขพอร์ทนั้นมีเยอะตั้งแต่เลข 0-65536 ซึ่งการใช้งานเลขPortนั้น ก็จะมีทั้งเลขPortแบบทางการ(ซึ่งเป็นจำนวนPortส่วนน้อย) และบางโปรแกรมอาจกำหนดเลขพอร์ทของตัวเองเพื่อใช้งาน(อย่างไม่เป็นทางการ)... ถ้าคุณอยากศึกษาว่าเลข Port Number มีเลขอะไรบ่าง ผมแนะนำให้ดูที่นี่ครับ http://en.wikipedia.org/wiki/Port_number


เลข Port หลักๆที่ควรรู้
เพื่อความสะดวกของผู้อ่าน ผมได้รวบรวมเลข Port ที่ควรรู้มาให้ส่วนหนึ่งครับ

พอร์ทหลักๆที่เกี่ยวกับการใช้งานอินเตอร์เน็ต (พอร์ทพวกนี้ เป็นพอร์ทหลักเลยที่เราจะพิจารณาเปิด/ปิด)
20   FTP (Data)
21   FTP (Command)
22   SSH
23   Telnet
25   SMTP
53   DNS
67   DHCP Server
68   DHCP Client
80   HTTP
115   SFTP
123   NTP
143   IMAP
194   IRC
220   IMAP(V3)
443   HTTPS
465   SMTP SSL
520   RIP
989   FTPS (Data)
990   FTPS (Command)
993   IMAPS
995   POP3S
1194   OpenVPN
1812   RADIUS-Auth
1813   RADIUS-Account
3128   Web caches
8080   Proxy


พอร์ทอื่นๆที่ควรรู้จัก(ในฐานะคนดูแลระบบ)
843   Adobe Flash
5228   Android Market (ถ้ามีคนใช้ Android)
2210   MikroTik Remote


พอร์ทที่เกียวกับ Webhosting - Control panel (คนทำเว็บอาจต้องใช้)
2082   cPanel
2083   cPanel-SSL
2095   cPanel-webmail
2096   cpanel-Webmail-SSL
2222   DirectAdmin
7777   Kloxo SSL
7778   Kloxo


พอร์ทพวกสังคมออนไลน์ (อาจไม่แน่ไม่นอน)
1863   aMSN / MSNเก่า / Windows Live IM และ .NET Messenger Service
4000   QQ
5050   Yahoo IM
5190   ICQ / AOL IM
6891-6901   Windows Live (Files & Voice)
8631   aMSN กล้อง
19294-19295   Google Talk Voice
19302   Google Talk Voice
23399   Skype ปกติ


ส่วนพอร์ทของ Bittorrent ล่ะ..หุหุหุ
โดยหลักการของมันแล้ว...
พอร์ทของมันคือ 6881-6999
แต่ ด้วยโปรแกรม Bittorrent-Client ส่วนใหญ่จะใช้วิธีการ Random-Port (การกระจายPortเพื่อประสิทธิภาพของพวกมัน) ก็เลยกลายเป็น Bittorrent ไม่มีพอร์ทประจำของตัวเอง มันใช้งานได้แทบทุกพอร์ทครับ(จะมีเพียงพอร์ทเดียวที่ Bit ไม่ใช้กันคือ 80 ครับ เพราะต้องสงวนไว้ให้HTTP สำหรับให่Clientติดต่อTrackerได้)


ใน บทความนี้ผมได้กล่าวเพียงส่วนย่อยมากๆของ Port Number นะครับ ซึ่งก็ครอบคลุมภาพร่วมที่เราควรรู้สำหรับงาน หอพัก/สำนักงานครับ... (หากท่านผู้อ่านสนใจเพิ่มเติม โปรดหาทางศึกษากันเองนะครับ อิๆ)
 

Pfsense Thailand Copyright © 2011-2012 | Powered by Blogger