I am in need to limit the bandwidth which my son’s computers consumes when he plays Apex Legends while talking to his friends/team by the way of Discord. On occasion 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 gateway runs FreeBSD 12.2-RELEASE-p2 and it got a working stateful NAT’ed ipfw firewall. However, dummynet and traffic shaping is new to me. I did the following:
1. In /boot/loader.conf I added dummynet_load="YES".
2. In the ipfw configuration file I configured 2 pipes:
3. For outgoing traffic, I added the rule for pipe 1 right before the incoming NAT rule:
4. For incoming traffic, I added the rule for pipe 2 right after the outgoing NAT rule:
Does this look reasonable? The two pipes got a heavy traffic count. The gaming computer is a Windows 10 machine. Is there a way to find out whether the bandwidth limitation does actually work?
The gateway runs FreeBSD 12.2-RELEASE-p2 and it got a working stateful NAT’ed ipfw firewall. However, dummynet and traffic shaping is new to me. I did the following:
1. In /boot/loader.conf I added dummynet_load="YES".
2. In the ipfw configuration file I configured 2 pipes:
Code:
# Configure 2 pipes for traffic shaping
/sbin/ipfw -q pipe 1 config delay 10ms bw 2Mbit/s
/sbin/ipfw -q pipe 2 config delay 10ms bw 2Mbit/s
Code:
...
# Pipe 1 before NAT for shaping outgoing traffic of the gaming machine
/sbin/ipfw -q add 99 pipe 1 ip4 from 192.168.0.7 to any
# NAT rule for incoming packets.
/sbin/ipfw -q add 100 nat 1 ip4 from any to any in recv $WAN
...
Code:
...
# NAT rule for outgoing packets.
/sbin/ipfw -q add 10000 nat 1 ip4 from any to any out xmit $WAN
# Pipe 2 after NAT for shaping incoming traffic
/sbin/ipfw -q add 10001 pipe 2 ip4 from any to 192.168.0.7
...