LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
LinkBack Search this Thread
Old 09-17-2011, 04:36 PM   #1
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 52

Rep: Reputation: 21
PF and packet Queuing...


Ok, this is the situation.
i want to limit download speed on PORT lvl..
and limit DNS bandwide
dunno what is wrong.
but NEWS/FTP is still running on full speed.
someone a idea how i can fix this?
pf tutorial isnt making sense

Config added.

Code:
######## START CONFIG ##########
#
ext_if = "dc0"
int_if = "sk0"
#
set block-policy drop
set loginterface $ext_if
set limit { frags 5000, states 10000 }
set state-policy floating
set optimization normal
set ruleset-optimization basic
set timeout interval 10
set timeout frag 30
set skip on lo
#
# intern -> extern
altq on $ext_if cbq bandwidth 1024Kb queue { std_ext, FTP_ext, NEWS_ext, DNS_ext }
queue std_ext       bandwidth 640Kb cbq(default borrow)
queue FTP_ext       bandwidth 128Kb cbq
queue NEWS_ext      bandwidth 128Kb cbq
queue DNS_ext       bandwidth 128Kb cbq
#
# extern -> intern
altq on $int_if cbq bandwidth 20480Kb queue { std_int, FTP_int, NEWS_int, DNS_int }
queue std_int        bandwidth 10240Kb cbq(default borrow)
queue FTP_int        bandwidth 256Kb cbq
queue NEWS_int       bandwidth 256Kb cbq
queue DNS_int        bandwidth 128Kb cbq
#
#
match out on egress inet from !(egress) to any nat-to (egress:0)
block all
#
### Q DNS
pass  out quick on $ext_if  proto { tcp,udp } from any to any port domain queue DNS_ext
pass   in quick on $int_if proto { tcp,udp } from any to any port domain queue DNS_int
#
### Q NEWS
pass  out quick on $ext_if  proto tcp from any to any port { 119 } queue NEWS_ext
pass   in quick on $int_if proto tcp from any to any port { 119 } queue NEWS_int 
#
### Q FTP
pass  out quick on $ext_if  proto tcp from any to any port { 20,21 } queue FTP_ext
pass   in quick on $int_if proto tcp from any to any port { 20,21 } queue FTP_int 
#
antispoof for $ext_if inet
pass  out on $ext_if inet from any to any queue std_ext
pass  in on $int_if from any to any queue std_int
#
########## END CONFIG ############

Last edited by spatieman; 12-04-2011 at 06:03 AM.
 
Old 10-09-2011, 08:31 AM   #2
Kropotkin
Member
 
Registered: Oct 2004
Location: /usr/home
Distribution: Fedora, Mint, FreeBSD, Android
Posts: 317

Rep: Reputation: 31
Traffic shaping can only be used for outgoing packets, not incoming ones.
 
Old 12-04-2011, 06:04 AM   #3
spatieman
Member
 
Registered: Jan 2004
Location: netherlands, europe, in a crapy house. xD
Distribution: openBSD
Posts: 52

Original Poster
Rep: Reputation: 21
Well.
Yes and no..
i manage in the time being to limit full download speed.
but i got stuck on limiting outgoing trafic.
more like, the pass out keep state rule is bugging me..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Queuing same processes RVF16 Programming 2 06-15-2009 04:07 PM
Userspace packet queuing with libipq: ip_conntrack does not defragment? DaneelGiskard Programming 2 05-11-2007 01:20 AM
Queuing a BDR SCB jspsandhu *BSD 0 02-28-2006 02:48 PM
Sound queuing mewt Mandriva 8 05-09-2005 08:46 AM
How to implement a queuing system? aleet2600 Programming 10 05-12-2004 11:03 PM


All times are GMT -5. The time now is 08:23 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration