I’ve about 100 VMs which I want to shape their traffic via Mikrotik,
All VMs have static valid internet IPs like ( 190.190.190.100 - 190.190.190.200 ) and I’ve set 190.190.190.1 as Mikrotik IP also the VMs are using Mikrotik as their gateway.
The main gateway which is a Cisco router has IP of 190.190.190.254,
I didn’t find any guide on how to shape traffic per IP at a topology like what I’m using, so please would you help me out?
Hi there
to implement traffic shaping quickly you can use simple queue, specifically one queue for each VM.
Suppose that the mikrotik router has 190.190.190.1 ip on interface ether1 (where reside the other VMs) . You can define just 100 queue one for each Vm as in the following :
[admin@greenComputingTik] /queue simple> add name=Qos1 target-addresses=190.190.190.100/32 max-limit=256K/2M interface=ether1
[admin@greenComputingTik] /queue simple> add name=Qosq target-addresses=190.190.190.101/32 max-limit=300K/2M interface=ether1
and so on ...
The target address and interface are madnatory to have simple queue running correctly.
Of course, if you need to shape with the same amount of bandwidth all the VM, you can use a target-addresses=190.190.190.0/24.
As I understood in your topology the Internt Gateway, Mikrotik gateway and VMs resides on the same network. In general, to have guarantee that the queue will work correctly on both up/down direction, you must use the same shaper , the mikrotik router in both direction. but becasue you are under the same network in order to have packet going and come back the mikrotik router you have to masquerade them when they leave the router itself .
Hoping this will help you
have a nice day
[quote=“greencomputing”]Hi there
to implement traffic shaping quickly you can use simple queue, specifically one queue for each VM.
Suppose that the mikrotik router has 190.190.190.1 ip on interface ether1 (where reside the other VMs) . You can define just 100 queue one for each Vm as in the following :
[admin@greenComputingTik] /queue simple> add name=Qos1 target-addresses=190.190.190.100/32 max-limit=256K/2M interface=ether1
[admin@greenComputingTik] /queue simple> add name=Qosq target-addresses=190.190.190.101/32 max-limit=300K/2M interface=ether1
and so on ...
I’ve test that command to limit the send rate of IP of xx.xx.xx.10 via the command below but it’s not working and even in mikrotik UI the RX and TX rates are showing zero
queue simple> add name=Qos1 target-addresses=xx.xx.xx.10/32 max-limit=128k/128k interface=ether1
queue simple> print
0 name="Qos1" target-addresses=xx.xx.xx.10/32 interface=ether1
parent=none direction=both priority=8 queue=default-small/default-small
limit-at=0/0 max-limit=128k/128k burst-limit=0/0 burst-threshold=0/0
burst-time=0s/0s total-queue=default-small
Any suggestion on what is wrong?
I think, upload traffic gets ICMP redirect from MikroTik to Cisco (and then goes directly to Cisco), and download traffic goes directly from Cisco to VMs. you need to place the shaper in between the Cisco and VMs, not somewhere aside