Community discussions

MikroTik App
 
KirillTs
just joined
Topic Author
Posts: 9
Joined: Thu May 08, 2008 6:17 pm

Different limits for Local/Overseas traffic

Thu May 08, 2008 7:06 pm

Hello, a have a question about http://wiki.mikrotik.com/wiki/How_to_ap ... as_traffic

/ queue simple
add name="Oversea" target-addresses=192.168.100.254/32 dst-address=0.0.0.0/0 \
interface=all parent=none packet-marks="Oversea traffic" direction=both \
priority=8 queue=default-small/default-small limit-at=0/0 \
max-limit=256000/256000 total-queue=default-small disabled=no
add name="Local Country" target-addresses=192.168.100.254/32 dst-address=0.0.0.0/0 \
interface=all parent=none packet-marks="Local Country Traffic" direction=both \
priority=8 queue=default-small/default-small limit-at=0/0 \
max-limit=1024000/1024000 total-queue=default-small disabled=no

I need to apply this, for evry host in my network(192.168.100.254/32...253/32 etc..) or i can just use 192.168.100.0/24? and if i use 192.168.100.0/24 as target address, it will give 256 kbits for all hosts in my network or 256 kbits for each?

I'm sorry for my bad english... i hope you uderstand some thing =)
 
JJCinAZ
Member
Member
Posts: 475
Joined: Fri Oct 22, 2004 8:03 am
Location: Tucson, AZ

Re: Different limits for Local/Overseas traffic

Thu May 08, 2008 7:29 pm

If you change to 192.168.100.0/24 and leave the queue type at default-small, then yes the 256K limit will apply to all the hosts. Change the queue type to something you defined with PCQ using a source-address as the classifier & 256K limit each along with the 192.168.100.0/24, followed by removing the max-limit on the queues (or raise it to a total) and that should apply a 256K limit to each host.
 
KirillTs
just joined
Topic Author
Posts: 9
Joined: Thu May 08, 2008 6:17 pm

Re: Different limits for Local/Overseas traffic

Thu May 08, 2008 9:50 pm

So if i udnerstand you correctly, i mark pakets with this
/ ip firewall address-list 
add list=Latvia address=159.148.0.0/16 comment="" disabled=no 
add list=Latvia address=193.41.195.0/24 comment="" disabled=no 
add list=Latvia address=193.41.33.0/24 comment="" disabled=no 
add list=Latvia address=193.41.45.0/24 comment="" disabled=no 
add list=Latvia address=193.68.64.0/19 comment="" disabled=no 
add list=Latvia address=193.108.29.0/24 comment="" disabled=no 
add list=Latvia address=193.108.144.0/22 comment="" disabled=no 
add list=Latvia address=193.108.185.0/24 comment="" disabled=no 
add list=Latvia address=193.109.211.0/24 comment="" disabled=no 
add list=Latvia address=193.109.85.0/24 comment="" disabled=no 
add list=Latvia address=193.110.8.0/23 comment="" disabled=no 
add list=Latvia address=193.110.164.0/23 comment="" disabled=no 
...
add list=Latvia address=193.111.244.0/22 comment="" disabled=no 

/ ip firewall mangle 
add chain=prerouting src-address=192.168.100.0/24 action=mark-connection \
    new-connection-mark="Con Entire Traffic" passthrough=yes \
    comment="Mark-connection All Traffic" disabled=no 
add chain=prerouting src-address=192.168.100.0/24 connection-mark="Con Entire \
    Traffic" dst-address-list=!Latvia action=mark-connection \
    new-connection-mark="Con Oversea" passthrough=yes comment="Mark-connection \
    Oversea Traffic" disabled=no 
add chain=prerouting connection-mark="Con Oversea" action=mark-packet \
    new-packet-mark="Oversea traffic" passthrough=no comment="Mark-packet \
    Oversea Traffic" disabled=no 
add chain=prerouting action=mark-packet new-packet-mark="Local Country Traffic" \
    passthrough=no comment="Mark-packet Local Country Traffic" disabled=no 
then i create this in queue types
 5 name="pcq-download" kind=pcq pcq-rate=0 pcq-limit=50
   pcq-classifier=dst-address pcq-total-limit=2000

 6 name="pcq-upload" kind=pcq pcq-rate=0 pcq-limit=50
   pcq-classifier=src-address pcq-total-limit=2000
and i shape with this
[admin@MikroTik] queue tree> print
Flags: X - disabled, I - invalid
 0   name="Download" parent=ether2 packet-mark="" limit-at=0 queue=default
     priority=8 max-limit=256000 burst-limit=0 burst-threshold=0 burst-time=0s

 1   name="queue2" parent=Download packet-mark=Oversea traffic limit-at=0
     queue=pcq-download priority=8 max-limit=0 burst-limit=0
     burst-threshold=0 burst-time=0s

 2   name="Upload" parent=ether1 packet-mark="" limit-at=0 queue=default
     priority=8 max-limit=256000 burst-limit=0 burst-threshold=0 burst-time=0s

 3   name="queue4" parent=Upload packet-mark=Oversea traffic limit-at=0
     queue=pcq-upload priority=8 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s

 4   name="DownloadMD" parent=ether2 packet-mark="" limit-at=0 queue=default
     priority=8 max-limit=10240000 burst-limit=0 burst-threshold=0
     burst-time=0s

 5   name="queue6" parent=DownloadMD packet-mark=Local Country Traffic
     limit-at=0 queue=pcq-download priority=8 max-limit=0 burst-limit=0
     burst-threshold=0 burst-time=0s

 6   name="UploadMD" parent=ether1 packet-mark="" limit-at=0 queue=default
     priority=8 max-limit=2048000 burst-limit=0 burst-threshold=0
     burst-time=0s

 7   name="queue8" parent=UploadMD packet-mark=Local Country Traffic limit-at=0
     queue=pcq-upload priority=8 max-limit=0 burst-limit=0 burst-threshold=0
     burst-time=0s
I tested this config, speed limits are working correctly but for one host, do you think it will be working with multiply hosts?
 
KirillTs
just joined
Topic Author
Posts: 9
Joined: Thu May 08, 2008 6:17 pm

Re: Different limits for Local/Overseas traffic

Fri May 09, 2008 1:22 pm

Previus config is not working, 256K is divide for all hosts in /24

Do you think i should stick to wiki, and create 4 rules in queue simple for each user?
i have 150 users, 100 mbits internet
server config P IV 3.2 dual-core, ram 1 gb , it will be enough?