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.
ifconfig vr0 up
ifconfig bridge0 up
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:
add
options IPFIREWALL_DEFAULT_TO_ACCEPT
options DUMMYNET
options HZ=1000
to the kernel config file and rebuild it. Then add
firewall_type="open"
to /etc/rc.conf.
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:
Reference:
The FreeBSD hand book about bridging
The FreeBSD hand book about IPFW
Comments 10
Great little post Dryice.
Posted 06 Mar 2009 at 9:08 pm ¶Thanks a lot!
Wow.. if only i found this earlier.. took me the whole day to figure this out and then i saw your page..
Posted 24 Apr 2009 at 9:25 am ¶It was a great help, it took me almost a week to find the solution, always thank’s to you.
Posted 02 Jul 2009 at 7:50 am ¶thanks ! do you have QQ or Msn I sew your page but I have some problom . Can I ask you ? I am a chinese
Posted 06 Nov 2009 at 12:33 pm ¶my QQ: 475332295
Posted 06 Nov 2009 at 12:47 pm ¶Msn: sooetechnic@hotmail.com
Nice tutorial. But I am having trouble with getting the bridge to work correctly. It passes arp requests across the bridge but not the arp responses. Tried it with both frenzy 1.1 and 1.3. Anyone seen anything like this before? Thx.
Posted 27 Nov 2010 at 12:32 am ¶Thanks for the nice blog. It was very useful for me. Keep sharing such ideas in the future as well.
Posted 21 Dec 2010 at 9:39 am ¶I recommend is to have several good watch …..
Posted 03 May 2011 at 2:10 pm ¶They not only work fine and affordable …..
Breguet Watches
Replica Breitling Watches
your guide on how to setup FreeBSD 7.0 as a network bridge is very details…
Posted 23 Jun 2011 at 10:03 pm ¶Appreciate for the tutorial
Posted 24 Jun 2011 at 11:42 pm ¶Post a Comment
You could use <code type="name"> to get your code colorized