Assign an IP address to a bridge fail

CyberLeo Kitsana cyberleo at cyberleo.net
Tue Jul 30 14:46:15 UTC 2019


On 7/21/19 1:17 PM, Pierre Dupond wrote:
> Hi all,
> 
>            I am facing a strange problem. Just after installing a fresh
> 
> Freebsd 12 on an Pc Engines APU machine, I build a bridge with the 4
> 
> network cards.
> 
> 
> If I try to setup the address of the bridge in the "/etc/rc.conf" file,
> I can not ping (outside the address
> 
> given to the bridge). But if I comment the line for setting the address
> in the file
> 
> "/etc/rc.conf" and I set the address manually with the command
> 
> "ifconfig bridge0 inet 172.16.0.11 netmask 255.255.254.0" the ping works.
> 
> Do I have made an obvious mistake in the "rc.conf" file? What could be
> the reason of this problem?
> 
> Any ideas would be greatly appreciated.

<snip>

> ifconfig_bridge0="addm igb0 addm igb1 addm igb2 addm igb3 up"

<snip>

> ifconfig_bridge0="inet 172.16.0.11 netmask 255.255.254.0"

/etc/rc.conf is parsed as a shellscript, so later definitions of 
variables (such as ifconfig_bridge0) overwrite earlier definitions.

Either combine the two ifconfig_bridge0 definitions into a single 
stanza, or change the first from ifconfig_bridge0= to 
create_args_bridge0= . The network setup rcscript provides create_args_* 
to set parameters that can only be set during interface creation (like 
name), but it also happens to work well for setting physical parameters 
of synthetic interfaces, such as the devices slaved to a bridge.

-- 
Fuzzy love,
-CyberLeo

<CyberLeo at CyberLeo.Net>
Technical Administrator

CyberLeo.Net Webhosting
http://www.CyberLeo.Net

Element9 Communications
http://www.Element9.net


Furry Peace! - http://www.fur.com/peace/


More information about the freebsd-questions mailing list