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. After 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.
Update1: Here is what else I have in my /etc/rc.conf
:
sshd_enable="YES"
ntpd_enable="YES"
zfs_enable="YES"
sfxge_load="YES"
Update2:
When I press Ctrl+T:
load 0.03 cmd: route 1136 [keglimit] 281.48r 0.00u 0.00s 0% 1080k
Update3:
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
sfxge_load="YES"
doesn't go in your rc.conf, it goes in/boot/loader.conf
. In any case, it unnecessary if you compiled a new kernel with the driver built in. That line only loads the kernel module if it's not already in the kernel.