# bridge0 on 7.2-release has no members



## kenbukan (Sep 23, 2009)

Hello,

the bridge0 is create but after `/etc/rc.d/netif restart` i havn't member on the bridge0.

If I comment out the line


```
ifconfig_bridge0="inet 172.16.106.50 netmask 255.255.255.0 up"
```

then I have member but no IP address on bridge0.

#######rc.conf

```
hostname="sheep3.xxxxx.net"
firewall_enable="YES"
cloned_interfaces="bridge0"
ifconfig_bridge0="addm em2 addm em3 up"
ifconfig_em2="up"
ifconfig_em3="up"
ifconfig_bridge0="inet 172.16.106.50 netmask 255.255.255.0 up"
defaultrouteer="172.16.106.1"
#ifconfig_em0="DHCP"
keymap="german.iso"
sshd_enable="YES"
usbd_enable="YES"
```
I have 4 Networkcards

em0 and em1 are RJ45 Gbit intel
em2 and em3 are FDDI Gbit Intel PCI Cards

I have compiled the kernel with if_bridge

How I configure bridge0 with member and ip address?


----------



## SirDice (Sep 23, 2009)

kenbukan said:
			
		

> ```
> ifconfig_bridge0="addm em2 addm em3 up"
> 
> ifconfig_bridge0="inet 172.16.106.50 netmask 255.255.255.0 up"
> ```


These two overrule each other. You have to note that most things in /etc/rc.conf are actually variables not commands.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-bridging.html

Not sure how you would assign the ip address to the bridge in /etc/rc.conf. You could try merging the two lines into one:


```
ifconfig_bridge0="addm em2 addm em3 inet 172.16.106.50 netmask 255.255.255.0 up"
```


----------



## DutchDaemon (Sep 23, 2009)

Try

```
ifconfig_bridge0="addm em2 addm em3 inet 172.16.106.50 netmask 255.255.255.0"
```

It seems like your second ifconfig commands cancels the first one. Combine them.


----------



## kenbukan (Sep 23, 2009)

I tryed


```
ifconfig_bridge0="addm em2 addm em3 inet 172.16.106.50 netmask 255.255.255.0"
```
and 


```
ifconfig_bridge0="addm em2 addm em3 inet 172.16.106.50 netmask 255.255.255.0 up"
```
and now I have member but no ip address.

I try it also manually with

```
ifconfig bridge0 addm em2 addm em3 up
ifconfig bridge0 inet 172.16.106.50 netmask 255.255.255.0 up
```
and it works fine.


----------



## DutchDaemon (Sep 23, 2009)

Ah, damn! I remember. This one always gets me!

If you start the bridge in /etc/rc.conf you must state additions to that bridge using an *alias*, or the first ifconfig statement will be overwritten by the second one.

Try:


```
ifconfig_bridge0="addm em2 addm em3 up"
ifconfig_bridge0_alias0="inet 172.16.106.50 netmask 255.255.255.0 up"
```


----------



## kenbukan (Sep 23, 2009)

So it works fine.

Very big thanks for help.


----------



## edekkers (Oct 18, 2010)

I've searched for this answer for hours. Wouldn't it be smart to include this solution in the handbook?


----------



## venom (Aug 15, 2014)

@DutchDaemon, your method is working, thanks.

Need to add changes to the Handbook.


----------



## SirDice (Aug 15, 2014)

As this is a rather old thread, keep in mind that FreeBSD 7 (all versions) is now end-of-life and isn't supported anymore.

http://www.freebsd.org/security/unsupported.html


----------



## venom (Aug 15, 2014)

This method works on FreeBSD 10.


----------

