Below is my configuration
Ip addresses are all public. But changed due to security concerns
ISP -----------------> MIKROTIK ------------------------> Layer 2 SWITCH -----> COLO SERVERS
212.1.2.15------wan: 212.1.2.16/32 lan: 88.1.1.1/24 --------------------------88.1.1.2 - 88.1.1.253
all main routing is done from ISP side. 88.1.1.1/24 ip block routed serially over 212.1.2.16 by my ISP.
I have got 10 servers for colocation, each have 5-10 ip addresses but not matching cidr rules. for example
colo server1 ips: 88.1.1.2, 88.1.1.6, 88.1.1.200 ...
colo server2 ips: 88.1.1.56, 88.1.1.78, 88.1.1.112 ...
colo server3 ips: 88.1.1.3, 88.1.1.34, 88.1.1.98 ...
etc...
What I want to do is limit bandwidth for each of these colo servers:for example :
colo server1 gets 2 mbit upload / 10 mbit download
colo server2 gets 4 mbit upload / 4 Mbit download
colo server3 gets 6 mbit upload / 1 Mbit download etc.
I tried 2 different ways for this:
1- Limiting server by mac address:
first mangle rules:
0 chain=prerouting action=mark-packet new-packet-mark=colo-server1 passthrough=yes src-mac-address=00:33:A4:76:5B:80
then simple queue rules:
0 name="colo server 1" dst-address=0.0.0.0/0 interface=all parent=none packet-marks=colo-server1 direction=both priority=8 queue=default/default limit-at=1000000/0
max-limit=1000000/0 total-queue=default-small
NOT WORKING for download: Graphs are not useful bla bla...
2- Limiting server by ip addresses:
first create an ip address-list for servers:
0 colo-server1 88.1.1.2
1 colo-server1 88.1.1.6
2 colo-server1 88.1.1.200
then mangle:
5 chain=prerouting action=mark-packet new-packet-mark=colo-server1 passthrough=no src-address-list=colo-server1
6 chain=prerouting action=mark-packet new-packet-mark=colo-server1 passthrough=no dst-address-list=colo-server1
then simple queue
4 name="colo server 1" dst-address=0.0.0.0/0 interface=all parent=none packet-marks=colo-server1 direction=both priority=8 queue=default-small/default-small
limit-at=2000000/1000000 max-limit=2000000/1000000 total-queue=default-small
NOT WORKING as expected. Graphs are not as expected.
Maybe works if created 2 seperate simple queue rules for upload and download.
I know that my rules are not near from perfect. But I just wanted to demonstrate what I am trying to do.
Anyway back to my original question:
How can I limit bandwidth for ip address lists not matching cidr rules?