limit bandwidth

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

limit bandwidth

Vacheslav

Peace,

been suffering for many hours so i'd rather ask for aid..

i'm trying to limit the flow mainly for the most maximize people


acl slower      src 10.46.0.74 10.46.0.107
acl localnet src 0.0.0.1-0.255.255.255    # RFC 1122 "this" network (LAN)
acl localnet src 10.46.0.0/24        #  local private network (LAN)


acl SSL_ports port 443
acl Safe_ports port 80        # http
acl Safe_ports port 8080    # http
acl Safe_ports port 21        # ftp
acl Safe_ports port 443        # https
acl Safe_ports port 70        # gopher
acl Safe_ports port 210        # wais
acl Safe_ports port 1025-65535    # unregistered ports
acl Safe_ports port 280        # http-mgmt
acl Safe_ports port 488        # gss-http
acl Safe_ports port 591        # filemaker
acl Safe_ports port 777        # multiling http
acl CONNECT method CONNECT
acl blockfiles urlpath_regex -i "/etc/squid/blocks.files.acl"

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost
visible_hostname proxy.k

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
error_directory /usr/share/squid/errors/en
# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed


delay_pools 1
delay_class 1 3
delay_access 1 allow slower !localnet
delay_access 1 deny all
delay_parameters 1 12800/12800 -1/-1 6400/12800


http_access allow localnet
http_access allow localhost

i tried doing the delay class 1 1

but bandwidth is full


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: limit bandwidth

Amos Jeffries
Administrator
On 31/08/20 8:24 pm, Vacheslav wrote:
> Peace,
>
> been suffering for many hours so i'd rather ask for aid..
>
> i'm trying to limit the flow mainly for the most maximize people
>

Okay.

What Squid version are you using?


>
> acl slower src 10.46.0.74 10.46.0.107

One of the reasons this posting git held up for moderation was that the
lines which are supposed to contain ASCII tab characters contained
Unicode characters "\c3\82".

If those Unicode characters are actually present in your squid.conf file
then you need to go through and remove them all.

...
> acl localnet src 10.46.0.0/24 #  local private network (LAN)

...
> acl blockfiles urlpath_regex -i "/etc/squid/blocks.files.acl"
>
...

> error_directory /usr/share/squid/errors/en

The above is a default value. Remove that line from your config.

>
> delay_pools 1
> delay_class 1 3
> delay_access 1 allow slower !localnet


All IPs which match "slower" ACL are also matched by "localnet" ACL.

It is impossible for an IP to be both part of slower and not part of
localnet. So this line never matches and all traffic is not-delayed.

To fix, remove the "!localnet" requirement from the above line.


Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: limit bandwidth

Vacheslav
On Tue, 2020-09-01 at 05:10 +1200, Amos Jeffries wrote:

> On 31/08/20 8:24 pm, Vacheslav wrote:
> > Peace,
> >
> > been suffering for many hours so i'd rather ask for aid..
> >
> > i'm trying to limit the flow mainly for the most maximize people
> >
>
> Okay.
>
> What Squid version are you using?
>
>
sudo squid -v
Squid Cache: Version 4.13
Service Name: squid

> > acl slower src 10.46.0.74 10.46.0.107
>
> One of the reasons this posting git held up for moderation was that
> the
> lines which are supposed to contain ASCII tab characters contained
> Unicode characters "\c3\82".
this is now another email client..so let's confirm that
>
> If those Unicode characters are actually present in your squid.conf
> file
> then you need to go through and remove them all.

i went ahead and typed those added lines in nano and deleted the
original ones..still not a trump!

>
> ...
> > acl localnet src 10.46.0.0/24 #  local private
> > network (LAN)
>
> ...
> > acl blockfiles urlpath_regex -i "/etc/squid/blocks.files.acl"
> >
> ...
>
> > error_directory /usr/share/squid/errors/en
>
> The above is a default value. Remove that line from your config.
this? error_directory /usr/share/squid/errors/en

>
> > delay_pools 1
> > delay_class 1 3
> > delay_access 1 allow slower !localnet
>
> All IPs which match "slower" ACL are also matched by "localnet" ACL.
>
> It is impossible for an IP to be both part of slower and not part of
> localnet. So this line never matches and all traffic is not-delayed.
>
> To fix, remove the "!localnet" requirement from the above line.
i already tried that, i was thinking that there would be an option like
acl slower src 10.46.0.74 10.46.0.107
acl localnet src !10.46.0.74 10.46.0.0/24
so as not type the whole subnet individual addresses


>
> Amos
> _______________________________________________
> squid-users mailing list
> [hidden email]
> http://lists.squid-cache.org/listinfo/squid-users


_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: limit bandwidth

Amos Jeffries
Administrator
On 1/09/20 7:50 pm, Majed Zouhairy wrote:

> On Tue, 2020-09-01 at 05:10 +1200, Amos Jeffries wrote:
>> On 31/08/20 8:24 pm, Vacheslav wrote:
>>> Peace,
>>>
>>> been suffering for many hours so i'd rather ask for aid..
>>>
>>> i'm trying to limit the flow mainly for the most maximize people
>>>
>>
>> Okay.
>>
>> What Squid version are you using?
>>
>>
> sudo squid -v
> Squid Cache: Version 4.13
> Service Name: squid
>
>>> acl slower src 10.46.0.74 10.46.0.107
>>
>> One of the reasons this posting git held up for moderation was that
>> the
>> lines which are supposed to contain ASCII tab characters contained
>> Unicode characters "\c3\82".
> this is now another email client..so let's confirm that
>>
>> If those Unicode characters are actually present in your squid.conf
>> file
>> then you need to go through and remove them all.
>
> i went ahead and typed those added lines in nano and deleted the
> original ones..still not a trump!
>>
>> ...
>>> acl localnet src 10.46.0.0/24 #  local private
>>> network (LAN)
>>
>> ...
>>> acl blockfiles urlpath_regex -i "/etc/squid/blocks.files.acl"
>>>
>> ...
>>
>>> error_directory /usr/share/squid/errors/en
>>
>> The above is a default value. Remove that line from your config.
> this? error_directory /usr/share/squid/errors/en

Yes, that one.

>>
>>> delay_pools 1
>>> delay_class 1 3
>>> delay_access 1 allow slower !localnet
>>
>> All IPs which match "slower" ACL are also matched by "localnet" ACL.
>>
>> It is impossible for an IP to be both part of slower and not part of
>> localnet. So this line never matches and all traffic is not-delayed.
>>
>> To fix, remove the "!localnet" requirement from the above line.
> i already tried that, i was thinking that there would be an option like
> acl slower src 10.46.0.74 10.46.0.107
> acl localnet src !10.46.0.74 10.46.0.0/24
> so as not type the whole subnet individual addresses
>

It is possible to define an ACL like localnet with holes. But that would
not do what you are wanting.


"delay_access 1 allow slower"  does what you are asking for in terms of
only the IPs listed in "slower" having their traffic slowed down.

If that is not working, then you may be hitting a bug or something is
different from what you have told us about the traffic. eg CONNECT
tunnels do not always have delay pools applied in Squid-4.


Amos
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users
Reply | Threaded
Open this post in threaded view
|

Re: limit bandwidth

Majed Zouhairy
In reply to this post by Vacheslav
 >>> ...
 >>>
 >>>> error_directory /usr/share/squid/errors/en
 >>> The above is a default value. Remove that line from your config.
 >> this? error_directory /usr/share/squid/errors/en
 > Yes, that one.
so it's not the email client even
 >
 >>>> delay_pools 1
 >>>> delay_class 1 3
 >>>> delay_access 1 allow slower !localnet
 >>> All IPs which match "slower" ACL are also matched by "localnet" ACL.
 >>>
 >>> It is impossible for an IP to be both part of slower and not part of
 >>> localnet. So this line never matches and all traffic is not-delayed.
 >>>
 >>> To fix, remove the "!localnet" requirement from the above line.
 >> i already tried that, i was thinking that there would be an option like
 >> acl slower src 10.46.0.74 10.46.0.107
 >> acl localnet src !10.46.0.74 10.46.0.0/24
 >> so as not type the whole subnet individual addresses
 >>
 > It is possible to define an ACL like localnet with holes. But that would
 > not do what you are wanting.
still that would be very nice to know
 >
 >
 > "delay_access 1 allow slower"  does what you are asking for in terms of
 > only the IPs listed in "slower" having their traffic slowed down.
 >
 > If that is not working, then you may be hitting a bug or something is
 > different from what you have told us about the traffic. eg CONNECT
 > tunnels do not always have delay pools applied in Squid-4.
 >
 >
 > Amos

it's only working on http downloads,

might it have any relationship with ufdbguard is being used?

the rest of the config

delay_pools 1
delay_class 1 3
delay_access 1 allow slower
delay_access 1 deny all
delay_parameters 1 51200/51200 -1/-1 51200/25600

http_access allow localnet
http_access allow localhost



# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 8080

# Uncomment and adjust the following to add a disk cache directory.
#cache_dir ufs /var/cache/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/cache/squid

cache_mem 512 MB

netdb_filename none

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:        1440    20%    10080
refresh_pattern ^gopher:    1440    0%    1440
refresh_pattern -i (/cgi-bin/|\?) 0    0%    0
refresh_pattern .        0    20%    4320

url_rewrite_program /usr/local/ufdbguard/bin/ufdbgclient -m 4 -l
/var/log/squid/
url_rewrite_children 16 startup=8 idle=2 concurrency=4
#debug_options ALL,1 33,2 28,9
_______________________________________________
squid-users mailing list
[hidden email]
http://lists.squid-cache.org/listinfo/squid-users