# FreeBSD 9.1; bridge0 and default gateway issue



## vasechka (Mar 22, 2013)

I've got a FreeBSD 9.1-RELEASE-p1 system with three nics, I'm using: igb0, sfxge1 and sfxge2. igb0 used for internet access and is default gateway. Other two nics, I need to use to create bridge0. When system is booted, I execute following commands and get bridge up and running without any issues.


```
ifconfig bridge0 create
ifconfig bridge0 addm sfxge0 addm sfxge1 up
ifconfig bridge0 inet 172.18.0.1/24
```
Problem starts when I want to setup bridge to be up during boot. Afte reading documentation and following it, I came up with following in my /etc/rc.conf:


```
cloned_interfaces="bridge0"
ifconfig_bridge0="addm sfxge0 addm sfxge1 up"
ifconfig_sfxge0="up"
ifconfig_sfxge1="up"
ifconfig_bridge0="inet 172.18.0.1/24"
```
On reboot, system getting stuck while enabling default gateway on igb0. Only way to proceed, was to ctrl+alt+delete, reboot into single mode and modify /etc/rc.conf. Portion of config, which defines igb0 and default gateway:


```
defaultrouter="10.100.4.254"
hostname="zfstank"
ifconfig_igb0="up"
ifconfig_igb0="inet 10.100.4.1 netmask 255.255.255.0"
```

I've tried to modify last line of bridge0 setup to 
	
	



```
ifconfig_bridge0_alias0="inet 172.18.0.1/24"
```
 and modify bridge setup line 
	
	



```
ifconfig_bridge0="addm sfxge0 addm sfxge1 inet 172.18.0.1/24 up"
```
 - resulted in same issue - getting stuck on default gateway creation.

During boot, I see that igb0 comes up online after bridge0 is setup.

if_bridge and sfxge were compiled into kernel.


----------



## SirDice (Mar 22, 2013)

You keep stating there's an em0 but your rc.conf shows an igb0. Which is it?


----------



## vasechka (Mar 22, 2013)

sorry. igb0 correct name, em0 - typo.


----------



## vasechka (Mar 22, 2013)

*[SOLVED] FreeBSD 9.1; bridge0 and default gateway issue*

Looks like issue was due to quick exhaust of mbufs. As FreeNAS's wiki points out, this is common on multiport em and igb cards and mostly had nothing to do with bridge (correct me if I'm wrong).

So after I added following lines into 
	
	



```
/boot/loader.conf
```
 and booted, system finished boot properly.


```
kern.ipc.nmbclusters="131072"
hw.igb.num_queues=1
```


----------

