Developers Documentation

×

Warning

301 error for file:https://clearos.com/dokuwiki2/lib/exe/css.php?t=dokuwiki&tseed=82873f9c9a1f5784b951644363f20ef8

User Tools

Site Tools


Adding Bridged Interfaces

ClearOS is capable of using multiple NICs and bridging the network traffic across them. Great care needs to be exercised when doing this to prevent the creation of network loops.

Bridges can be useful for performing transparent operations or to join multiple network topologies and technologies into the same logical network subnet. This is especially useful for adding wireless networks onto Ethernet networks.

Configuration

The controls for managing bridges under ClearOS are evolving but the backend technology is the same. We document that here in case you are using an older version of ClearOS or need to understand what is going on in the backend.

The directory which contains the configuration files for each individual NIC is /etc/sysconfig/network-scripts/.

A bridge device will need to be created and existing network cards will be added to that bridge. The virtual bridge interface will handle the elements of the IP stack and devices will be subordinate to that device.

Create the file /etc/sysconfig/network-scripts/ifcfg-br0 using your favorite editor. The file will contain the following:

DEVICE=br0
TYPE="Bridge"
ONBOOT="yes"
USERCTL="no"
BOOTPROTO="static"
IPADDR="192.168.11.1"
NETMASK="255.255.255.0"
BRIDGE_STP="yes"

Now modify all interfaces that you want to exist on this bridge. For this example we add eth2 and eth3, effectively turning them into a switch.

/etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2
TYPE="Ethernet"
IPV6INIT="yes"
ONBOOT="yes"
USERCTL="no"
BRIDGE=br0
PROMISC="yes"

/etc/sysconfig/network-scripts/ifcfg-eth3

DEVICE=eth3
TYPE="Ethernet"
IPV6INIT="yes"
ONBOOT="yes"
USERCTL="no"
BRIDGE=br0
PROMISC="yes"

Now modify your network configuration in /etc/clearos/network.conf. Change LANIF to remove all the interfaces that you have bridged and add br0. In this example change:

LANIF="eth2 eth3"

to

LANIF="br0"

Leave in any other LAN interfaces you have not bridged.

If your of your interfaces is wireless you may want to edit /etc/hostapd/hostapd.conf and uncomment the line:

# bridge=br0

Then restart hostapd.

To put this configuration into effect, restart the network service:

service network restart

Then your DHCP server will need to be sorted (Network|Infrastructure|DHCP Server). You will want to delete the settings from the interfaces you have deleted and configure the DHCP server for br0.

At this point, if the DHCP server is not running on br0, you may have to temporarily configure your workstation with a static IP in the same subnet as br0 as your workstation may not be picking up an IP address

Webconfig

In Webconfig, you will see the bridge enumerated. On older versions of ClearOS (5.x) it will show the bridge device and will have the control to modify it. You should NOT modify the bridge using Webconfig in ClearOS 5.x.

To undo the bridge on a running system, not only will you have to undo the edits, but before you remove ifcfg-br0 you will also have to take the bridge down:

ifdown br0
brctl delbr br0

content/en_us/kb_o_adding_bridged_interfaces.txt · Last modified: 2018/03/07 03:40 by nickh

https://clearos.com/dokuwiki2/lib/exe/indexer.php?id=content%3Aen_us%3Akb_o_adding_bridged_interfaces&1710821491