# dummynet + gateway basic configuration



## zammster (Jul 15, 2009)

All,

First and probably obviously I'm new to using dummynet.  What I'm looking for is probably extremely easy, I'm just missing something.

Here's what I have:

freebsd 7.2 (host name: dummy) running in a vmware VM with two network interfaces.  a "host only" and a standard network interface. 

I'd like this server to act as a gateway for a strictly "host-only" server to get to the common network, while having latency and packet loss simulated.

So on "dummy", I have le0 configured with dhcp on the common network.  looks ok to me - good IP address, can ping the box on that ip, etc.  I also have le1, which is also dhcp on the host-only network, which also looks correct.  Good IP and netmask, and can ping from other host-only clients.

I modified inetd.conf to allow the basic services: ssh, ftp, shell, login, etc.. as well uncommented the daytime/time/echo/discard/etc.  I didn't touch rcpbind, smtp, auth, or netbios.

So here's the parts I'm missing:
1) do I need to bridge le0 and le1?  If so, how?
2) I think I have an understanding of the pipes in dummynet at least with regard to how to introduce latency or limit bandwidth, but I don't see how these pipes correlate to an interface.  
3) If I don't bridge le0 and le1, how do I make "dummy" act as a gateway?

The end-goal is to have the other host-only server connect to the host-only interface on the freebsd server, which will in turn shape that traffic and send it on to the common network.  Additionally, I'd need the traffic from the common network to be shaped as it comes back to the host-only network servers.

Can anyone help?  It would be much appreciated.

Regards,
Nick


----------



## eljms (Jul 24, 2009)

Hi,

Are you intending to use dummynet as a gateway as in layer 3 (e.g. routing via your dummynet host)?

If not then you do need to bridge.
http://www.freebsd.org/doc/en/books/handbook/network-bridging.html Has good instructions.

ipfw hooks in to the bridge if net.link.bridge.ipfw is set to 1.
you can do this with

sysctl net.link.bridge.ipfw=1

and then edit /etc/sysctl.conf to make the change survive a reboot.


----------



## eljms (Jul 24, 2009)

I tried to post earlier but it got queued for moderation?

Basically you can either use your dummynet host as a layer 3 gateway or as a bridge.

If you search on google there's good instructions for setting up bridges on there.  The key thing to add is that you need to get ipfw working with the bridge.

Specifically:


```
sysctl net.link.bridge.ipfw=1
```

Also, add net.link.bridge.ipfw=1 to /etc/sysctl.conf so that this survives a reboot.


----------

