3

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:

what happens when it hangs

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
3
  • Setting the default router doesn't happen until all the network interface configurations are done, it's a completely separate start-up script. How do you know it's stuck on default route creation??
    – Chris S
    Mar 22, 2013 at 17:56
  • @chris-s What I see when enabled debug in rc.conf, is that routing script starts before igb0 shows that it has link. and igb0 gets link 4 seconds after bridge0 and and three seconds sfxge0/1 are up.
    – sashk
    Mar 22, 2013 at 18:13
  • 1
    The 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.
    – Chris S
    Mar 22, 2013 at 18:14

2 Answers 2

4

You can't have multiple lines of the same configuration. The later lines will override the former.

Without knowing what the rest of your rc.conf file looks like, it should have something like this:

hostname="zfstank"
defaultrouter="10.100.4.254"

cloned_interfaces="bridge0"
autobridge_interfaces="bridge0"
autobridge_bridge0="sfxge0 sfxge1"
ifconfig_bridge0="inet 172.18.0.1/24"

ifconfig_sfxge0="up"
ifconfig_sfxge1="up"

ifconfig_igb0="inet 10.100.4.1 netmask 255.255.255.0"

Notes:

  • Order doesn't matter, but this is so much easier to read.
  • It's unnecessary to explicitly "up" and interface unless it has no other configuration.
7
  • I've added rest of my rc.conf to the end of my question.
    – sashk
    Mar 22, 2013 at 18:06
  • Didn't solve, stuck at same spot. with igb0 showing it got link UP 4 seconds after bridge0.
    – sashk
    Mar 22, 2013 at 18:14
  • It should be fine that it comes up after the configuration, unless you're trying to mount the root directory from a network location.
    – Chris S
    Mar 22, 2013 at 18:18
  • I have root on zmirror, so no need for network. Any way to debug what exactly scripts are doing, even deeper than rc_debug="YES"?
    – sashk
    Mar 22, 2013 at 18:22
  • Let it boot with rc_debug="YES" once, when it gets to the point where it's hung push Ctrl+T, edit the last dozen lines it shows into the Question.
    – Chris S
    Mar 22, 2013 at 18:35
1

This:

ifconfig_bridge0="addm sfxge0 addm sfxge1 up"
...
ifconfig_bridge0="inet 172.18.0.1/24"

in fact is same as just second line. And this try to set IP on unconfigured bridge interface - this is probably cause of the problem. You should add inet 172.18.0.1/24 to first line and delete second.


Could you remove any interface configuration from rc.conf and comment it in rc.local and try this way?

defaultrouter="10.100.4.254"
hostname="zfstank"
ifconfig_igb0="inet 10.100.4.1/24 up"
ifconfig_sfxge0="up"
ifconfig_sfxge1="up"
cloned_interfaces="bridge0"
autobridge_interfaces="bridge0"
autobridge_bridge0="sfxge0 sfxge1"
ifconfig_bridge0="inet 172.18.0.1/24 up"

This change a bit order of things.

9
  • I've tried that - same issue. Even tried to use defaultroute_carrier_delay=15 to allow time for ibg0 interface to come up, but didn't solve that issue.
    – sashk
    Mar 22, 2013 at 13:29
  • @SashkaB Hmm... I don't see connection bridging and default router. If you set order of interfaces (network_interfaces="igb0 sfxge0 sfxge1" /default is "auto"/) then issue is stil there? If you bring up only one card i.e. sfxge0 with 172.18.0.1/24 address (without bridging) than machine brigs up OK?
    – dsznajder
    Mar 22, 2013 at 14:18
  • I set network_interfaces and issue still there. should I add bridge0 to the end of it? Setting sfxge1 with ip address - allowed system to boot properly.
    – sashk
    Mar 22, 2013 at 14:54
  • @SashkaB Yes. If it is not there then it should be not configured, only created so it is strange that you still have issue with this. If you not configure bridge in rc.conf at all but configure it in rc.local system booting without problem?
    – dsznajder
    Mar 22, 2013 at 15:17
  • system boots properly when bridge configured from rc.local and I've used commands mentioned in the bost above (three ifconfigs).
    – sashk
    Mar 22, 2013 at 15:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .