# How to configure to create a bridge with dummynet  while booting up?



## nikeadasa (Sep 18, 2013)

My code is given below, but _the_ bridge is not getting created while boot_ing_ up:

/etc/rc.conf

```
if_bridge_load="YES"
cloned_interface="bridge0"
ifconfig_bridge0="addm em0 addm em1 up"
sshd_enable="YES"
firewall_enable="YES"
firewall_type="open
firewall_quiet="YES"
hostname="Bridge"
static route "-net 192.168.20.0 192.168.30.11 255.255.255.0"
```
 
/boot/loader.conf

```
dummynet_load="YES"
if_bridge_load="YES"
ipfw_load="YES"
kern.hz=10000
```
 
/etc/sysctl.conf

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

But still in the boot-up phase the bridge is not getting created. When I enter the command to create the  bridge it's working. Commands I used to create the bridge manually are given below.

```
Bridge# ifconfig bridge create
Bridge# ifconfig em0 up
Bridge# ifconfig em1 up
 
Bridge# ipfw add 2000 pipe 1 ip from any to any
Bridge# ipfw pipe 1 config delay 20ms plr .2
```
When I use the above commands manually the bridge is working. But I want to get it created as default while booting up.


----------



## SirDice (Sep 18, 2013)

nikeadasa said:
			
		

> ```
> if_bridge_load="YES"
> ```


Doesn't belong in rc.conf, should be in /boot/loader.conf.



> ```
> cloned_interface="bridge0"
> ```


It's cloned_interface*s*.



> ```
> static route "-net 192.168.20.0 192.168.30.11 255.255.255.0"
> ```


Never put commands in rc.conf. They will get executed multiple times during boot. Instead use this:

```
static_routes="myroute"
route_myroute="-net 192.168.20.0/24 192.168.30.11"
```
 
You'll also want to add:

```
ifconfig_em0="up"
ifconfig_em1="up"
```

And there's a quote missing:

```
firewall_type="open
```


----------



## nikeadasa (Sep 19, 2013)

Thank you sir. It's working.....


----------

