troubleshouting error in PF firewall

 

moga aja pada ga bosen kalo artikelnya tentang PF lagi. ini sebenernya cuman mo nambahin aja. Tenang aja, gw disini ga akan bahas gimana cara bikin rule firewall, seting parameter PF, ato NAT+RDR de-el-el.
tadi pagi, sekitar jam 3 pagi-an, gw setting PF lagi…….. hmmmmmmmmm tapi lagi lagi error lagi lagi error, padahal sintaks nya udah bener……. duh, gimana ini???? gw liat di settingan pf.conf default bawaan dari *BSD, ga banyak membantu. ternyata dalam PF, ada aturan-aturan yang harus kita patuhi ketika kita bikin firewall. waaaaaaaaaaaa, apa aja itu????

gini aturannya

#1. set variable
#2. options rule
#3. scrub rules
#4. nat,rdr,binat
#5. rules, block pass, antispoof

kalo ga match ma urutan itu, ga bakalan jalan.

ini contohnya (di /etc/pf.conf)
###################aturan 1, set variable#############
if=”rl0″
dns=”{10.14.203.7,202.154.1.2,202.134.0.155,202.134.2.5}”
ga_penting= “{137,138,139,81}”
#voip=”{5060, 4569, 5036, 9999 >< 20001, 2727}”
irc=”{6666,6667,6668}”
ob_state = “flags S/SA keep state”
ib_state = “flags S/SA keep state”

################end set variable####################

##############aturan 2, options rule###################
set block-policy drop
set state-policy if-bound

set loginterface $if
set fingerprints “/etc/pf.os”

##############end options rule######################

#######aturan 3, scrub rules##########################
scrub in on $if all random-id
scrub reassemble tcp

############ end scrub rules #######################

################ aturan 4 nat rules#################
nat on fxp0 proto {tcp,udp,icmp} from 10.14.x.x to any -> 21.1.3.5
##############end aturan 4 nat rules#################
########silakan baca tutorial sebelumnya tentang NAT#########

###############aturan 5, antispoof, block, pass rules########
antispoof for $if
pass quick on lo0 all
pass out quick on $if proto tcp from any to $dns port 53 $ob_state
pass out quick on $if proto udp from any to $dns port 53 keep state

#####dan seterusmnya, silakan baca di artikel sebelumnya#########
############end aturan 5, antispoof, block,pass, rules#########

heheee, tinggal di save, trus jalanin aja pake pfctl -f /etc/pf.conf, and gotcha!!!!!!!!!!!!!!!!!!!!!!!!! jalan πŸ˜€ πŸ˜€ πŸ˜€ πŸ˜€

semoga pengalaman gw bermain main dengan PF bisa berguna bagi temen temen semua. oh iya, rule nya enggak lengkap, udah ada di artikel sebelumnya (males nulisnya lagi). tinggal baca aja di artikel sebelumnya.

hehehe……………. sekian dan tingkyuuu dah baca artikel gw

Advertisements

2 responses to “troubleshouting error in PF firewall

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s