# Dummynet on FreeBSD 10



## druidmatrix (Feb 28, 2014)

I am trying to set up dummynet on a FreeBSD 10 host running on VMware. I have 2 NICs, one on each of two virtual switches, and a bridge configured. Following is what I am using to set up the bridge:

```
ifconfig bridge0 addm em0 addm em1 up
ifconfig em0 up
ifconfig em1 up
ifconfig bridge0 10.25.0.101/24
route add default 10.25.0.1
```

I also have the following sysctl entries:

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

This is how I am setting up ipfw:

```
ipfw -f flush
ipfw add 65000 allow ip from any to any
ipfw add 100 pipe 1 ip from any to 10.25.0.153 layer2
ipfw add 101 pipe 2 ip from 10.25.0.153 to any layer2
ipfw pipe 1 config bw 5Mbits/s queue 6250B delay 50
```

However, bridging is not working with the above. When I do a `tcpdump`, I see packets on either interface (depending on which side the traffic is coming from) and also on bridge0, but not on the other interface. If I turn off net.link.bridge.ipfw or net.link.ether.ipfw, bridging starts working, but then the ipfw rule 100 is not picked up; it passes to rule 65000.

I'd be most grateful for any help.


----------



## druidmatrix (Feb 28, 2014)

Also, here are my ipfw rules:

```
root@dummy-100:~ # ipfw show
00100  29  2436 pipe 1 ip from any to 10.25.0.153 layer2
00101  38  3192 pipe 2 ip from 10.25.0.153 to any layer2
65000 844 74316 allow ip from any to any
65535  61  5754 deny ip from any to any
```


```
root@dummy-100:~ # ipfw pipe 1 show
00001:   5.000 Mbit/s    0 ms burst 0 
q131073 6250 B 0 flows (1 buckets) sched 65537 weight 0 lmax 0 pri 0 droptail
 sched 65537 type FIFO flags 0x0 0 buckets 0 active
```


----------

