Here’s a quick note/tutorial about how to setup FreeBSD 7.0 as a network bridge and use dummynet to shape the traffic, There is a pretty good tutorial on the net but I found it’s rather outdated. So here is mine.
First of all we’ll need to setup FreeBSD as a network bridge.
This should return “bridge0″ if this is the first bridge you created.
And we’ll add the two interface used on the bridge. It’s “rl0″ and “vr0″ in my case:
Now bring the bridge up. Note the two interface need to be up too.
If you want an IP address of the box, assign it to the bridge
Now the bridge should work. To make dummynet work, we’ll need to recompile the kernel:
to the kernel config file and rebuild it. Then add
Make sure you have filewall_type=”open” in /etc/rc.conf and/or options IPFIREWALL_DEFAULT_TO_ACCEPT in your kernel config file before you do the reboot if you are doing this remotely. Or you’ll block yourself out.
Now enable ifpw on the bridge
OK, we can now add a pipe:
Note the “1000″ in the command line. Do a
first and choose a good place for the pipe.
Now it’s time to shape the traffic. To add some delay:
or add some package lost: