Article View: pl.comp.os.bsd
Article #21254Freebsd 7.2 problem z pf
From: G
Date: Thu, 04 Mar 2010 20:47
Date: Thu, 04 Mar 2010 20:47
99 lines
4882 bytes
4882 bytes
Witam,
Po padzie dysku postawilem serwer na FBSD7.2 (wczesniej byl na FBSD5.x).
Z backupu odtworzylem konfiguracje, ale po wrzuceniu konfiga dla pf
zaczely sie problemy. Konfig ktory wczesniej dzialal znakomicie teraz
kolejkuje tylko w jedna strone. Upload dziala dobrze, natomiast download
wrzuca wszystko do kolejki default. Walcze z tym od tygodnia,
przeszukalem juz mase stron w necie i ciagle nie moge wpasc na
rozwiazanie. Nawet znalazlem opis podobnego problemu, ale rozwiazania
nie bylo. Jakby ktos mogl zerknac na ponizszy konfig i pomoc to bede
wdzieczny.
Pozdrawiam,
Bobi
# Macros: define common values, so they can be referenced and changed
easily.
ext_if="xl1" # replace with actual external interface name i.e., dc0
int_if="xl0" # replace with actual internal interface name i.e., dc1
internal_net="192.168.1.0/28"
external_addr="xxx.xxx.xxx.xxx"
ip_klient1="192.168.1.2"
ip_klient2="192.168.1.3"
ip_klient3="192.168.1.4"
porty="{ 199, 22 }"
priv_nets = "{ 127.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }"
# Normalization: reassemble fragments and resolve or reduce traffic
ambiguities.
scrub in all
# Kolejkowanie int>lan
altq on $int_if hfsc bandwidth 1000Kb queue { def_int, klient1_int,
klient2_int, klient3_int }
queue def_int hfsc (default realtime 256Kb linkshare 25%)
queue klient1_int hfsc (realtime 256Kb linkshare 25% upperlimit 512Kb)
queue klient2_int hfsc (realtime 256Kb linkshare 25% upperlimit 512Kb)
queue klient3_int hfsc (realtime 256Kb linkshare 25% upperlimit 512Kb)
# lan>int
altq on $ext_if hfsc bandwidth 256Kb queue { def_ext, klient1_ext,
klient2_ext, klient3_ext }
queue def_ext hfsc (default realtime 256Kb linkshare 25%)
queue klient1_ext hfsc (realtime 256Kb linkshare 25% upperlimit 128Kb)
queue klient2_ext hfsc (realtime 256Kb linkshare 25% upperlimit 128Kb)
queue klient3_ext hfsc (realtime 256Kb linkshare 25% upperlimit 128Kb)
# NAT i Tagowanie
nat-anchor "ftp-proxy/*"
rdr-anchor "ftp-proxy/*"
nat on $ext_if from $ip_klient1 to any tag KLIENT1 -> ($ext_if)
nat on $ext_if from $ip_klient2 to any tag KLIENT2 -> ($ext_if)
nat on $ext_if from $ip_klient3 to any tag KLIENT3 -> ($ext_if)
# RDR
rdr on $int_if proto tcp from any to any port ftp -> 127.0.0.1 port 8021
anchor "ftp-proxy/*"
# Firewall
# Loopback
pass quick on lo0 all
pass out quick on $ext_if proto icmp from any to any keep state
pass in on $ext_if proto tcp from any to any port 21 keep state
pass in on $ext_if proto tcp from any to any port > 49151 keep state
# INT_IF
block out on $int_if all
pass in on $int_if all
# EXT_IF
block out on $ext_if all
block in on $ext_if all
# Tagowanie i Filtrowanie
antispoof quick for $int_if inet
block drop in quick on $ext_if from $priv_nets to any
block drop out quick on $ext_if from any to $priv_nets
# Blokujemy uslugi z zewnatrz na serwer
pass in quick on $ext_if inet proto { tcp, udp } from $internal_net to
$ext_if
block in quick on $ext_if inet proto { tcp, udp } from any to $ext_if
port $porty
# Zezwalamy pakietom na wchodzenie do naszej sieci
pass in on $ext_if proto { tcp udp } from any to any
pass out on $int_if from any to $ip_klient1 queue klient1_int
pass out on $int_if from any to $ip_klient2 queue klient2_int
pass out on $int_if from any to $ip_klient3 queue klient3_int
#################################################################
pass out quick on $ext_if tagged KLIENT1 keep state (max 250) queue
klient1_ext
pass out quick on $ext_if tagged KLIENT2 keep state (max 250) queue
klient2_ext
pass out quick on $ext_if tagged KLIENT3 keep state (max 250) queue
klient3_ext
pass out on $ext_if from any to any queue def_ext
##################################################################
Technical Details
Message-ID:
<hmp6eg$spp$1@atlantis.news.neostrada.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.news-service.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!feeder.news-service.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!209.197.12.242.MISMATCH!nx01.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-02.news.neostrada.pl!atlantis.news.neostrada.pl!news.neostrada.pl!not-for-mail From: G <babilon59@wp.pl> Newsgroups: pl.comp.os.bsd Subject: Freebsd 7.2 problem z pf Date: Thu, 04 Mar 2010 21:47:45 +0100 Organization: TP - http://www.tp.pl/ Lines: 99 Message-ID: <hmp6eg$spp$1@atlantis.news.neostrada.pl> NNTP-Posting-Host: apw118.internetdsl.tpnet.pl Mime-Version: 1.0 X-Trace: atlantis.news.neostrada.pl 1267735826 29497 83.17.156.118 (4 Mar 2010 20:50:26 GMT) X-Complaints-To: usenet@news.neostrada.pl NNTP-Posting-Date: Thu, 4 Mar 2010 20:50:26 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit