Bridge, dpcpd, sshd

Ian Smith smithi at nimnet.asn.au
Thu Mar 24 04:25:55 UTC 2011


In freebsd-questions Digest, Vol 355, Issue 4, Message: 33
On Wed 23 Mar 2011 22:20:06 +0000 (GMT) Chris <devnullaccount at yahoo.se> wrote:

 > I have a server machine that I use as DHCP server, sshd login etc, 
 > and since I have multiple Ethernet interfaces on it, I would like to 
 > use two of those for the internal network to avoid adding one more 
 > ethernet switch for just one extra machine. DHCP should configure 
 > hosts on both those interfaces and all the hosts should be on the 
 > same subnet.
 > 
 > So, I set up a bridge interface as per the FreeBSD handbook (ch. 
 > 31.5), but now dhcpd is refusing to start during boot as it claim 
 > that the "bridge0" interface doesn't exist. If I manually start dhcpd 
 > with the same parameters after the machine has come up, it will start 
 > and it will also work as expected and assign addresses to users 
 > connecting from teh bridge interface.
 > 
 > sshd seems to do something similar, it refuses to start, but can 
 > manually be re-started later on.
 > 
 > Is this some kinf of expected behavior, or does it sound like I'm 
 > doing something badly wrong? Can I force bride0 to be configured 
 > earlier in the boot so it is always there when the daemons start 
 > waking up?
 > 
 > Configuration info below.
 > 
 > TIA,
 >   Chris
 > 
 > ===== rc.conf extract ====
 > dhcpd_enable="YES"
 > dhcpd_ifaces="bridge0"
 > cloned_interfaces="bridge0"
 > ifconfig_bridge0="addm dc0 addm dc1 up"
 > ifconfig_bridge0="inet 172.16.0.100/24"

There's your problem, and the response by Nerius Landys (read in the 
archives, as it hasn't arrived here in a digest yet :) would seem to 
indicate correct config - except that it has nothing to do with the 
order of assignments in rc.conf, but that your first ifconfig_bridge0
assignment is replaced, not added to, by the second.

It's important to know that /etc/rc.conf is a sh script that is sourced 
(that is, executed inline) at the end of /etc/defaults/rc.conf and so 
its statements are executed sequentially.  These statements just assign 
values to variables, and have no bearing at all on the order in which 
the rc.d system will actually use them; that depends on rcorder(8).

Nerius has indicated use of e.g:

 > ipv4_addrs_bridge0="192.168.0.254/24"

to assign address(es) to the bridge, avoiding your problem above.

 > ifconfig_dc0="up"
 > ifconfig_dc1="up"
 > 
 > ===== sshd.conf extract =====
 > ListenAddress 172.16.0.100
 > 
 > === the dhcpd.conf is quite standard and does not say anything about 
 > the interfaces, that info is in rc.conf above ====
 > 
 > === /var/log/messages extract ====
 >  dhcpd: bridge0: not found

Yes; at that time your bridge hadn't been created, ie it had no members.

cheers, Ian


More information about the freebsd-questions mailing list