Limit in/out bandwidth of a single machine in a NAT’ed LAN
I am in need to limit the bandwidth which my son’s computer consumes when he plays Apex Legends while talking to his friends/team by the way of Discord. Occasionally every network speed goes down to a crawl. For the time being, I do not want to simply prohibit him gaming. Because of the pandemic there are not so much other choices for him to meeting with and talking to friends. The solution is to limit the bandwidth and increase the delay of responses (the ping:-) on the gateway which is operated by FreeBSD 12.2-RELEASE-p2 by employing dummynet(4) together with ipfw(8).
The gateway got already a working stateful NAT’ed ipfw firewall. Although, dummynet and traffic shaping was new to me, it turned out that setting this up was not too complicated. I did the following:
The gaming computer got the fixed IP address
In the beginning I set the delay to 30 ms and the bandwidth to 1 Mbit/s, but then the son was complaining that his ping had gone down badly, so I adjusted the pipe settings to 10 ms and 2 Mbit/s and now it seems that this matches his comfort zone, while most importantly, the other computers in the LAN can access the internet again as usual.
Copyright © Dr. Rolf Jansen - 2020-12-16 12:04:49
Discussion on Twitter: 1339235580106903556