Saturday, November 7, 2015

Rate limiting traffic between specific hosts (based on their MAC) using iptables

I have setup a simple isolated network consist of following Linux based machines (simplified example): Node1<---->Router<---->Node2
Router's eth0 is connected with Node1's eth0. Router's eth1 is connected with Node2's eth0.



I would like to limit the traffic rate between Node1 and Node2 based on their MAC addresses, say for example, to 150 KBps. I read the man page for iptables and I do see the "--limit" option but cant' find a way to specify the source and destination MAC address in conjunction with the the traffic limit rule.




In plain English, the rule would be "Limit all the traffic between MAC_Address_1 (for Node1) and MAC_Address_2 (for Node2) to a max. rate of 150 KBps".



Can this be done using iptables?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...