โดยปรกติแล้ว friewall ของ FreeBSD จะไม่ไม่ทำการเก็บ log file หากต้องการต้องคอมไพ kernel ให้มี option ต่อไปนี้
options IPFIREWALL_VERBOSE
options IPFIREWALL_VERBOSE_LIMIT=128
ซึ่งค่านี้
IPFIREWALL_VERBOSE # ค่านี้หมายถึงการติดตั้งให้ firewall เก็บ logfile
IPFIREWALL_VERBOSE_LIMIT=128 # หมายถึงจำนวนบรรทัดที่จะใช้เก็บค่าของ logfile
สำหรับ กฎ ของ firewall นั้นๆ ถึงตรงนี้แล้วบางคนอาจไม่ได้ติดตั้งก็ตรวจสอบได้จากคำสั่ง
sysctl -a | grep net.inet.ip.fw.verbose

ถ้าได้ผลรัน
net.inet.ip.fw.verbose: 0 # เป็นศูนย์หมายถึงไม่ทำการติดตั้ง
net.inet.ip.fw.verbose_limit: 0 # เป็นจำนวนบรรทัดที่ใช้เก็บข้อมูลใน logfile
ซึ่งในส่วนของเรานั้นได้มีการเพิ่ม options ทั้ง 2 บรรทัดเมื่อตอน Compile Kernel แล้ว จะได้
1. gw# sysctl -a | grep net.inet.ip.fw.verbose
net.inet.ip.fw.verbose: 1
net.inet.ip.fw.verbose_limit: 120
2. gw# ipfw show
00050 11593 2659871 divert 8668 ip from any to any via vr0
00100 60 7154 allow ip from any to any via lo0
00200 0 0 deny ip from any to 127.0.0.0/8
00300 0 0 deny ip from 127.0.0.0/8 to any
65000 11593 2659871 allow ip from any to any
65535 0 0 allow ip from any to any

0 comments



Recommended Money Makers