Bridge setup in rc.conf

Hi,


My server have two physical ethernet ports. On igb0 comes tagged vlan traffic. I want igb1 to be used as a normal switch port with untagged traffix from vlan 1 so that I can connect my old network printer without using an additional physical network switch.

This is relevant parts of my rc.conf:
Code:
#LAN SETUP
if_vlan_load=YES
gateway_enable="YES"
synchronous_dhclient="YES"


#cloned_interfaces="igb0_1 igb0_4"
vlans_igb0="1 2 4"

static_routes="lan"
route_lan="-net 192.168.20.0/24 192.168.20.1"
defaultrouter="192.168.20.1"

#ifconfig_igb0_1="up"

cloned_interfaces="bridge0"
ifconfig_bridge0="addm igb1 addm igb0.1 up"
#ifconfig_bridge0="inet 192.168.20.40/24"

ifconfig_igb0="up"
ifconfig_igb0_2="DHCP"
ifconfig_igb0_4="up"
ifconfig_igb1="up"
autobridge_interfaces="bridge0"
autobridge_bridge0="igb1 igb0.1"
ifconfig_igb0_1="inet 192.168.20.40/24"
ifconfig_igb0_4="inet 192.168.21.40/24"

ifconfig_igb0_4_aliases="inet 192.168.21.41-45 netmask 255.255.255.255"

It almost works, my only problem is that I manually have to issue: ifconfig bridge0 addm igb0.1 after every time I have run service netif restart


What am I missing in rc.conf so that I don't have to runt the ifconfig cmd everytime I restart the network?


Thanks in advance!
 
If you what to create a bridged interface with 2 network interfaces namely igb0 and igb1 you must

# Clone the bridge interface
cloned_interfaces="bridge0"

# Up all the interfaces
ifconfig_igb0="DHCP"
ifconfig_igb1="up"
ifconfig_bridge0="up"

#declare the autobridge
autobridge_interfaces="bridge0"
autobridge_bridge0="igb0 igb1"
 
Use this.
Code:
cloned_interfaces="bridge0" 
ifconfig_bridge0="addm igb1 addm igb0.1 up"
Or this
Code:
autobridge_interfaces="bridge0" 
autobridge_bridge0="igb1 igb0.1"

Use one or the other, not both.

Not related, but this doesn't belong in rc.conf:
Code:
if_vlan_load=YES
Not needed in loader.conf either, it'll get automatically loaded.

Code:
static_routes="lan" 
route_lan="-net 192.168.20.0/24 192.168.20.1" 
defaultrouter="192.168.20.1"
Static route is useless. 192.168.20.0/24 is a directly connected network, there's an implied route.
 
Use this.

Or this


Use one or the other, not both.

Not related, but this doesn't belong in rc.conf:
Code:
if_vlan_load=YES
Not needed in loader.conf either, it'll get automatically loaded.


Static route is useless. 192.168.20.0/24 is a directly connected network, there's an implied route.
I'm sorry but if I remove the clone line, the bridge0 interface is never create at startup,
The clone seems to be required here

For the record I'm using a 14.0-RELEASE-p5 amd64
 
Back
Top