• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

Transfer-Limit im Squid

Hallo Leute,

da ich nächstes Jahr eine Diplomarbeit machen will brauche ich jetzt schon Lösungsansätze. Die Dimplomarbeit besteht aus der Einrichtung eines WLANs in einer Stadt, bei dem danach User Internet surfen können. Um im WLAN surfen zu können ruft die Person im Rathaus an und bekommt ein "Surfticket" das aus einem Key für das WLAN, einem Benutzernamen und einem Passwort besteht. Das wäre das Konzept.

Ich habe mir überlegt den Server auf Linux Basis zu machen, da es gratis ist.

Nun stellt sich bei mir aber folgende Frage:
1) Wie kann ich ein Transfer Limit realisieren, denn die Benutzer sollen ja nicht 3GB runtersaugen können :wink:. Gibt es in Squid eine Möglichkeit dies mittels ACLs oder anderer Möglichkeiten zu regeln? Oder soll ich auf ein anderes Programm zurückgreifen.

2) Für die Benutzerverwaltung hätte ich mir überlegt, dass wenn eine Person ein Ticket haben will, ein Script auf dem Server ausgeführt wird, dass einen neuen Benutzer in den LDAP Baum einträgt. Squid liest danach diese Informationen aus.

Danke im Vorraus für euer Antworten
lg
 

oc2pus

Ultimate Guru
delay-pools können sowas, die werden in der /etc/squid/squid.conf definiert.

Beispiel:
# ==>delay-pool Definitionen
# limit max connects on special workstations
acl lowband src 192.168.42.5/32
acl lowband src 192.168.42.7/32
acl lowband src 192.168.42.10/32
acl lowband src 192.168.42.99/32

delay_pools 3

delay_class 1 2
delay_class 2 2
delay_class 3 2

# normal surfing
delay_access 1 allow magic_words1 !lowband
delay_access 1 deny all

# download via http depending on extension
delay_access 2 allow magic_words2 !lowband
delay_access 2 deny all

# bulk
delay_access 3 allow lowband
delay_access 3 deny all

# Byte/s kbps ~%
# 8000 64 4
# 16000 128 8
# 19250 154 10
# 32000 256 16
# 48000 384 25
# 64000 512 33
# 96000 768 50
# 128000 1024 66
# 192000 1536 100
#
# Der erste Pool erh�lt einen kontinuierlichen Datenzuflu�.
# Es gibt keine Begrenzung (-1 schaltet die Begrenzung aus).
# Bei Bedarf kann der Inhalt des Pools f�r einzelne Mitglieder mit einem
# Schwung von 128000 bytes/s ausgekippt werden - anschlie�end f�llt sich der
# Pool wieder langsam mit 64000 bytes/s.
# Dieses Verhalten ist f�r Surfer wohl am g�nstigsten: Eine neue Seite wird
# zun�chst mit voller Geschwindigkeit geladen. W�hrend der Surfer die Seite
# betrachtet, f�llt sich der Delay-Pool langsam wieder an.
#
# 48000/96000 are values for the whole network, 48000/64000 are values for the
# single IP after downloaded files exceed about 64000 bytes (or even twice or
# three times as much) they will continue to download at about 48000 bytes/s
#delay_parameters 1 -1/-1 64000/128000
#delay_parameters 2 48000/96000 48000/64000
#delay_parameters 3 32000/48000

# Let's consider another example:
# you have a 128kbit per second line. Since you want some bandwidth available
# for things like SMTP, you want to limit web access to 100kbit per second. At
# the same time, you don't want a single user to use more than their fair share
# of sustained bandwidth. Given that you have 20 staff members, and 100kbit per
# second remaining bandwidth, each person should not use more than 5kbit per
# second of bandwidth. Since it's unlikely that every user will be surfing at
# once, we can probably limit people to about four times their limit (that's
# 20kbit per second, or 2.5kbytes per second).
#
# We change the delay class for pool 1 to 2. Delay class 2 allows us to specify
# both an aggregate (overall) bandwidth usage and a per-user usage. In the
# previous example the delay_paramaters tag only took one set of options, the
# aggregate peak and burst rates. Given that we are now using a class-two pool,
# we have to supply two sets of options to delay_parameters: the overall speed
# and the per-IP speed. The 100kbits per second value is converted to bytes per
# second by dividing by 8 (giving us the 12500 values), and the per-IP value of
# 2.5kbits per second we discovered is converted to bytes per second (giving us
# the 2500 values.)
# delay_class 1 2
# delay_parameters 1 12500/12500 2500/2500

# umgerechnet auf zuhause.nil:
# DSL 1536kbit DSL davon 75% = 1152kbit ==> 144kByte f�r Netz
# 4 user: 1152kbit/4 = 288kbit * 3 = 864kbit ==> 108kByte pro user
#
# DSL 3096kbit DSL davon 75% = 2322kbit ==> 290kByte f�r Netz
# 4 user: 2322kbit/4 = 580kbit * 3 = 1740kbit ==> 218kByte pro user
#
# DSL 6144kbit DSL davon 75% = 4608kbit ==> 576kByte f�r Netz
# 4 user: 4608kbit/4 =1152kbit * 3 = 3456kbit ==> 432kByte pro user

# downloads per extension
# 4 user: 1152kbit/4 = 288kbit * 2 = 576kbit ==> 72kByte pro user
# 4 user: 2322kbit/4 = 580kbit * 2 = 1160kbit ==> 145kByte pro user
# 4 user: 4608kbit/4 =1152kbit * 2 = 2304kbit ==> 288kByte pro user
# flashget und sonstige permanenten downloads
# 4 user: 1152kbit/4 = 288kbit * 1 = 288kbit ==> 36kByte pro user
# 4 user: 2322kbit/4 = 580kbit * 1 = 580kbit ==> 72kByte pro user
# 4 user: 4608kbit/4 =1152kbit * 1 = 1152kbit ==> 144kByte pro user

# arcor dsl 1500
#delay_parameters 1 144000/144000 108000/108000
#delay_parameters 2 144000/144000 72000/72000
#delay_parameters 3 144000/144000 36000/36000

# arcor dsl 3000
#delay_parameters 1 290000/290000 218000/218000
#delay_parameters 2 290000/290000 145000/145000
#delay_parameters 3 290000/290000 72000/72000

# arcor dsl 6000
delay_parameters 1 575000/575000 432000/432000
delay_parameters 2 575000/575000 288000/288000
delay_parameters 3 575000/575000 144000/144000

# <==delay-pool Definitionen
 
Oben