raphaelb
Member
Hallo geehrte User
Ich verwende OpenBSD 3.7 (Release) und versuche, eine Bandbreitenbegrenzung ins Netzwerk zu integrieren mit pf und ALTQ. Wenn ich per FTP die Bandbegrenzung teste, dann habe ich beim download die angegebene Bandbreite, beim Upload jedoch die 100Mb des Netzwerks und nicht der angegebene Wert. Ich hatte zuerst gedacht, dass ev. die Regel nicht wirksam ist (rot markiert), jedoch wenn ich sie auskommentiere, funktioniert FTP nicht mehr, somit muss sie ja eigentlich aktiv sein und die Queue somit auch wirksam. Wenn ich mit "pfctl -s queue -vv" während einem FTP-Transfer schaue, so ist bei queue ftp_lan_in keinen Datendurchsatz feststellbar. Ich habe das Buch "Absolute OpenBSD" komplett ausgereizt und alle mir nur denkbaren Ideen und Möglichkeiten ausprobiert - am rasch einige zu erwähnen: alle Reglen mit "keep state", andere Dienste versucht, mit Google verschiedenste Beispiele versucht. Alles jedoch erfolglos.
Meine Hardware: P2-350MHz mit 3 Netzwerkkarten
Das Netzwerk läuft einwandfrei, auch PF tut einwandfrei, nur ALTQ tut nicht wie ich es mir vorstelle.
Hier habe ich euch meine pf.conf. Sie wurde zum debuggen recht abgespeckt. Ich versuche nun nur noch lediglich von einen Rechner (10.0.0.20) per FTP einen up-, bzw. download bei 10.0.0.1
beim laden der Regeln meldet es keine Fehler ("pfctl -F all -f /etc/pf.conf")
Ich weiss nicht, wo das Problem noch liegen könnte. Ich bin für jede Hilfe dankbar.
Gruss Raphael und einen schönen Tag.
# $OpenBSD: pf.conf,v 1.27 2004/03/02 20:13:55 cedric Exp $
#
# See pf.conf(5) and /usr/share/pf for syntax and examples.
# Aliases werden erzeugt
# Netzwerkkarten
ext_if="rl1"
int_if="rl0"
dmz_if="vr0"
# Sub-Netzwerke
ext_net="192.168.1.0/8"
int_net="10.0.0.0/8"
dmz_net="172.16.0.0/8"
# Rechner-IP's
int_ip_modem="192.168.1.1"
ext_ip_mickey="192.168.1.2"
int_ip_mickey="10.0.0.1"
dmz_ip_mickey="172.16.0.1"
dmz_ip_www="172.16.0.2"
dmz_port_www="80"
#table <spamd> persist
#table <spamd-white> persist
# einige Definitionen
set limit { states 10000, frags 5000 }
set block-policy drop
# Pakete zusammenbauen
scrub in on {$ext_if,$dmz_if} all fragment reassemble
# Bandwidth Control
# LAN-Interface
altq on $int_if cbq bandwidth 100Mb queue {lan_in, lan_out}
queue lan_in bandwidth 50% cbq {lan_misc_in, ftp_lan_in, ssh_lan_in}
queue lan_misc_in bandwidth 50Kb cbq
queue ftp_lan_in bandwidth 1Mb cbq
queue ssh_lan_in bandwidth 50Kb priority 7 cbq
queue lan_out bandwidth 50% cbq {lan_misc_out, ftp_lan_out, ssh_lan_out}
queue lan_misc_out bandwidth 50Kb cbq(default)
queue ftp_lan_out bandwidth 2Mb cbq
queue ssh_lan_out bandwidth 8Mb priority 7 cbq
# NAT Regeln
nat on $ext_if from !($ext_if) -> ($ext_if:0)
# Redirect-Rules...
#rdr pass on $int_if proto tcp to port ftp -> 127.0.0.1 port 8021
#rdr pass on $ext_if proto tcp from <spamd> to port smtp \
# -> 127.0.0.1 port spamd
#rdr pass on $ext_if proto tcp from !<spamd-white> to port smtp \
# -> 127.0.0.1 port spamd
# fuer WWW-Server
#rdr on $ext_if proto {tcp,udp} from any to port $dmz_port_www -> #$dmz_ip_www port $dmz_port_www
# Firewall-Rules
# Base-Rules
block drop in log all
block drop out log all
pass quick on { lo lo0 }
antispoof quick for { lo lo0 $ext_if $int_if $dmz_if }
# ***********************************
# the LAN
# inbound
pass in on $int_if proto tcp from $int_net to $int_ip_mickey port {20, 21} queue ftp_lan_in # FTP
pass in on $int_if proto tcp from $int_net to $int_ip_mickey port 22 queue ssh_lan_in # SSH
# outbound
pass out on $int_if proto tcp from $int_ip_mickey port {20,21} to $int_net queue ftp_lan_out # FTP
pass out on $int_if proto tcp from $int_ip_mickey port 22 to $int_net queue ssh_lan_out # SSH
Ich verwende OpenBSD 3.7 (Release) und versuche, eine Bandbreitenbegrenzung ins Netzwerk zu integrieren mit pf und ALTQ. Wenn ich per FTP die Bandbegrenzung teste, dann habe ich beim download die angegebene Bandbreite, beim Upload jedoch die 100Mb des Netzwerks und nicht der angegebene Wert. Ich hatte zuerst gedacht, dass ev. die Regel nicht wirksam ist (rot markiert), jedoch wenn ich sie auskommentiere, funktioniert FTP nicht mehr, somit muss sie ja eigentlich aktiv sein und die Queue somit auch wirksam. Wenn ich mit "pfctl -s queue -vv" während einem FTP-Transfer schaue, so ist bei queue ftp_lan_in keinen Datendurchsatz feststellbar. Ich habe das Buch "Absolute OpenBSD" komplett ausgereizt und alle mir nur denkbaren Ideen und Möglichkeiten ausprobiert - am rasch einige zu erwähnen: alle Reglen mit "keep state", andere Dienste versucht, mit Google verschiedenste Beispiele versucht. Alles jedoch erfolglos.
Meine Hardware: P2-350MHz mit 3 Netzwerkkarten
Das Netzwerk läuft einwandfrei, auch PF tut einwandfrei, nur ALTQ tut nicht wie ich es mir vorstelle.
Hier habe ich euch meine pf.conf. Sie wurde zum debuggen recht abgespeckt. Ich versuche nun nur noch lediglich von einen Rechner (10.0.0.20) per FTP einen up-, bzw. download bei 10.0.0.1
beim laden der Regeln meldet es keine Fehler ("pfctl -F all -f /etc/pf.conf")
Ich weiss nicht, wo das Problem noch liegen könnte. Ich bin für jede Hilfe dankbar.
Gruss Raphael und einen schönen Tag.
# $OpenBSD: pf.conf,v 1.27 2004/03/02 20:13:55 cedric Exp $
#
# See pf.conf(5) and /usr/share/pf for syntax and examples.
# Aliases werden erzeugt
# Netzwerkkarten
ext_if="rl1"
int_if="rl0"
dmz_if="vr0"
# Sub-Netzwerke
ext_net="192.168.1.0/8"
int_net="10.0.0.0/8"
dmz_net="172.16.0.0/8"
# Rechner-IP's
int_ip_modem="192.168.1.1"
ext_ip_mickey="192.168.1.2"
int_ip_mickey="10.0.0.1"
dmz_ip_mickey="172.16.0.1"
dmz_ip_www="172.16.0.2"
dmz_port_www="80"
#table <spamd> persist
#table <spamd-white> persist
# einige Definitionen
set limit { states 10000, frags 5000 }
set block-policy drop
# Pakete zusammenbauen
scrub in on {$ext_if,$dmz_if} all fragment reassemble
# Bandwidth Control
# LAN-Interface
altq on $int_if cbq bandwidth 100Mb queue {lan_in, lan_out}
queue lan_in bandwidth 50% cbq {lan_misc_in, ftp_lan_in, ssh_lan_in}
queue lan_misc_in bandwidth 50Kb cbq
queue ftp_lan_in bandwidth 1Mb cbq
queue ssh_lan_in bandwidth 50Kb priority 7 cbq
queue lan_out bandwidth 50% cbq {lan_misc_out, ftp_lan_out, ssh_lan_out}
queue lan_misc_out bandwidth 50Kb cbq(default)
queue ftp_lan_out bandwidth 2Mb cbq
queue ssh_lan_out bandwidth 8Mb priority 7 cbq
# NAT Regeln
nat on $ext_if from !($ext_if) -> ($ext_if:0)
# Redirect-Rules...
#rdr pass on $int_if proto tcp to port ftp -> 127.0.0.1 port 8021
#rdr pass on $ext_if proto tcp from <spamd> to port smtp \
# -> 127.0.0.1 port spamd
#rdr pass on $ext_if proto tcp from !<spamd-white> to port smtp \
# -> 127.0.0.1 port spamd
# fuer WWW-Server
#rdr on $ext_if proto {tcp,udp} from any to port $dmz_port_www -> #$dmz_ip_www port $dmz_port_www
# Firewall-Rules
# Base-Rules
block drop in log all
block drop out log all
pass quick on { lo lo0 }
antispoof quick for { lo lo0 $ext_if $int_if $dmz_if }
# ***********************************
# the LAN
# inbound
pass in on $int_if proto tcp from $int_net to $int_ip_mickey port {20, 21} queue ftp_lan_in # FTP
pass in on $int_if proto tcp from $int_net to $int_ip_mickey port 22 queue ssh_lan_in # SSH
# outbound
pass out on $int_if proto tcp from $int_ip_mickey port {20,21} to $int_net queue ftp_lan_out # FTP
pass out on $int_if proto tcp from $int_ip_mickey port 22 to $int_net queue ssh_lan_out # SSH
