Community discussions

 
chhamza
just joined
Topic Author
Posts: 16
Joined: Wed Mar 04, 2015 8:25 pm

Youtube allow 2 mb per user

Fri May 06, 2016 9:04 pm

help ...

I know it is possible to limit download and upload using a simple queue but what i was trying is that if i mark a limit say 512k download and 512k for upload then everything even youtube will also get 512k download and upload bandwidth. I want to make every connection to have 512k download and upload except youtube. can we make youtube to have 2mb bandwidth per user and other to have 256k speed.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4051
Joined: Wed May 11, 2011 6:08 pm

Re: Youtube allow 2 mb per user

Fri May 06, 2016 9:08 pm

Not very easily, no.

I have to say I don't think I've ever seen anyone wanting to give YouTube MORE bandwidth than the standard per-user amount. ;)

If you really want to try - the best thing to do is to get a list of all of Google's IP ranges (they have several, obviously) from some source - such as a BGP looking-glass site (like BGP.he.net) and make an IP address-list of these prefixes, and then do your youtube matching based on the address-lists.

That wouldn't be totally clean though, because google drive, google hangout, any other google-hosted service would be subject to the 2M queue and not the 512K queue.
When given a spoon,
you should not cling to your fork.
The soup will get cold.
 
chhamza
just joined
Topic Author
Posts: 16
Joined: Wed Mar 04, 2015 8:25 pm

Re: Youtube allow 2 mb per user

Fri May 06, 2016 9:19 pm

can i get your email address ? please
 
irghost
Member Candidate
Member Candidate
Posts: 282
Joined: Sun Feb 21, 2016 1:49 pm

Re: Youtube allow 2 mb per user

Sat May 07, 2016 9:36 am

use layer7 protocol
^.+(youtube|googlevideo.com).*$
add action=add-dst-to-address-list address-list=youtube \
    address-list-timeout=12h chain=forward layer7-protocol=youtube
then add packet mark mangle for address-list
then add queue for this packet mark

its my idea
MTCNA MTCRE MTCTCE MTCUME MTCWE MTCIPv6E MTCINE
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4051
Joined: Wed May 11, 2011 6:08 pm

Re: Youtube allow 2 mb per user

Mon May 09, 2016 5:36 pm

layer7 protocol won't match SSL-protected connections, which Youtube forces. It may catch some connections if the user is typing a specific URL for youtube and they're not typing httpS:// at the beginning of their urls, but if they follow links, or click a "suggested video" - sooner or later they're going to hit a CDN node immediately with SSL and it's not going to be marked "youtube"
When given a spoon,
you should not cling to your fork.
The soup will get cold.
 
irghost
Member Candidate
Member Candidate
Posts: 282
Joined: Sun Feb 21, 2016 1:49 pm

Re: Youtube allow 2 mb per user

Sun May 29, 2016 1:03 pm

/ip firewall layer7-protocol
add name=youtubeBW regexp=^.+(youtube|googlevideo.com).*$

/ip firewall mangle
add action=mark-packet chain=forward comment=youtube layer7-protocol=\
    youtubeBW new-packet-mark="youtube packet"

/queue type
add kind=pcq name=PCQ pcq-classifier=dst-address pcq-dst-address6-mask=64 \
    pcq-rate=256k pcq-src-address6-mask=64

/queue simple
add limit-at=0/0 max-limit=256k/256k name=Youtube packet-marks=\
    "youtube packet" queue=PCQ/PCQ target=""
MTCNA MTCRE MTCTCE MTCUME MTCWE MTCIPv6E MTCINE
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4051
Joined: Wed May 11, 2011 6:08 pm

Re: Youtube allow 2 mb per user

Sun May 29, 2016 7:39 pm

This mangle rule won't work. Modify it to mark CONNECTION (not packet) and add another rule to mark packet if CONNECTION mark = YouTube.
When given a spoon,
you should not cling to your fork.
The soup will get cold.

Who is online

Users browsing this forum: Google [Bot] and 112 guests