3
2
I'm using Ubuntu 12.10 and looking for a way to shape network traffic based on the IP address. I have a LAN, lets say from 192.168.1.2 - 192.168.1.254. The server is at 192.168.1.1. All IPs should have the maximum possible network speeds (all ports, but Samba is the actual culprit). The moment a specific IP or IP range (eg: 192.168.1.100) connects, the full speed should be given to that IP, all other IPs speed should be reduced to the minimum. Once the IPs traffic is finished, the rest of the connected IPs' speed should be restored.
I pretty much have a server and if my own PC connects to it, I want full speed. Only if I'm not using the server, the rest should have full access.
I've found some solutions online with tc, but they all limit specific IPs with a certain speed. I however want all people to have the max speed, except if a certain IP is connected. So basically my IP should have the highest priority and the rest the lowest priority.
Can anyone help me out with a script or maybe a program that already exists?
Has anyone tried this? I'm getting the following error when I run
add dev eth0 protocol ip parent 1:1 prio 1 u32 match ip dst 10.0.0.1/32 flowid 10:
:RTNETLINK answers: Invalid argument. We have an error talking to the kernel
– PicoutputCls – 2018-10-26T15:16:51.8871Check the name of the interface on which you want to add the rules; it used to be 'eth0' for the first network card but names have differentiated lately. – JvO – 2018-11-02T17:52:36.900
Thanks @JvO. In my case the interface is still
eth0
. – PicoutputCls – 2018-11-09T10:26:37.4901@PicoutputCls I've just edited accepted answer and fixed the commands you mentioned which cause an error. – StenaviN – 2019-06-11T13:02:45.803