You are not logged in.

#1 2012-12-08 16:16:53

Thump
Member
Registered: 2012-12-08
Posts: 12

[SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

Hi. Please advise how to make a bridged network interfaces. Here is what I've tried already:

[root@planitia ~]# ip link show eth1
4: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
    link/ether 00:02:a5:4e:e7:bb brd ff:ff:ff:ff:ff:ff
[root@planitia ~]# ip link show eth2
5: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT qlen 1000
    link/ether 00:02:a5:4e:e0:3e brd ff:ff:ff:ff:ff:ff
[root@planitia ~]# bridge fdb add 00:02:a5:4e:e0:3e dev eth1
RTNETLINK answers: Operation not supported
[root@planitia ~]# brctl addbr br0
add bridge failed: Package not installed
[root@planitia ~]# zcat /proc/config.gz | grep CONFIG_BRIDGE=
CONFIG_BRIDGE=m
[root@planitia ~]# zcat /proc/config.gz | grep CONFIG_BRIDGE_NETFILTER=
CONFIG_BRIDGE_NETFILTER=y

Thanks.

Last edited by Thump (2012-12-09 18:20:20)

Offline

#2 2012-12-08 21:08:11

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

The brctl command is found is the bridge-utils package

What is your goal and network topology?

Like...

1# Are you trying to load balance on Layer 2 between two Ethernet interfaces on your Arch Box connected to a Managed Switch that supports Layer 2 bridging?

2# Are you trying to load balance on Layer 3 between two Ethernet interfaces conneced to two diffrent Routers?

3# Are you trying to turn 2 Ethernet interfaces on your Arch Box into a Switch for LAN clients?

You know, arno-iptables-firewall found in the AUR can do setup #2 for you.

/etc/arno-iptables-firewall/plugins/multiroute.conf

# To actually enable this plugin make ENABLED=1:
# ------------------------------------------------------------------------------
ENABLED=0

# RP_FILTER settings (Only set this to 0, if you know what you're doing)
# ------------------------------------------------------------------------------
RP_FILTER_DISABLE=1

# Settings for the first interface:
# ------------------------------------------------------------------------------
MULTIROUTE_EXT_IF1=eth0
MULTIROUTE_EXT_ROUTER1=1.2.3.5
MULTIROUTE_EXT_IP1=5.6.7.9
MULTIROUTE_EXT_WEIGHT1=1

# Settings for the second interface:
# ------------------------------------------------------------------------------
MULTIROUTE_EXT_IF2=eth1
MULTIROUTE_EXT_ROUTER2=1.2.3.4
MULTIROUTE_EXT_IP2=5.6.7.8
MULTIROUTE_EXT_WEIGHT2=1

# Optional settings if you also use an internal interface (for your LAN/gateway)
# ------------------------------------------------------------------------------
MULTIROUTE_INT_IP=192.168.0.1
MULTIROUTE_INT_NET=192.168.0.0/24

Last edited by hunterthomson (2012-12-08 21:15:03)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#3 2012-12-08 22:38:25

Thump
Member
Registered: 2012-12-08
Posts: 12

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

hunterthomson, thank you for your answer.
I'm trying to make a bridge between eth1 and eth2: 3# to turn 2 Ethernet interfaces into a Switch for LAN clients.
This task should be done preferably by iproute2 tool bridge, but if it doesn't work with current RTNETLINK from reps it's still suitable to use bridge-utils tool brctl.
But both fails for me, and I don't get the reason.

Offline

#4 2012-12-08 23:31:40

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

Awe okay, I do the same thing.

I have never used the `bridge` command. I get the impression that it is more like Port Bonding then createing a bridge device. Though I am probaly wrong. In any case, I use the bridge-utils with much success.

(note: don't have a need for iproute2 capabilities most of the time. That is irrelevant though, just convert my `ifconfig` commands to the iproute2 commands)

Doing this should work for you.

pacman -S bridge-utils

brctl addbr br0

ifconfig br0 192.168.5.1 netmask 255.255.255.0 up

brctl addif br0 eth0
brctl addif br0 eth1

ifconfig eth0 0.0.0.0 up
ifconfig eth1 0.0.0.0 up

Report back.

The bridge-utils should have no problem connecting any Ethernet, tap, tun, or ppp device to the bridge. However, you can not attach a Wireless device to a bridge. To do that you need to use some iptables magic; let me know if you need to do this.

Now you configure iptables to NAT between whatever is your WAN gateway and the Bridge device i.e. br0  Then configure your Clients with the Default GW as the Bridge device with IPv4 address 192.168.5.1


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#5 2012-12-09 00:07:15

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

Awe okay, I have done some more digging on the `bridge` command. So ya, it seems that this IS a bridge divice. However, Arch dose not compile in the needed modules. Also, it seems this command dose not yet have all the features the bridge-utils commands have.

If Arch shipped with them they would be here, but they are not.
"They" modules like, br_fdb.c
This is probaly why you get the error, "RTNETLINK answers: Operation not supported"

[user@archbox]% ls /usr/src/linux-3.6.9-1-ARCH/net/bridge
total 8.0K
-rw-r--r-- 1 root root 1.7K Dec  3 21:09 Kconfig
drwxr-xr-x 2 root root 4.0K Dec  3 21:09 netfilter

[user@archbox]% locate br_fdb

[user@archbox]% locate br-fdb

Last edited by hunterthomson (2012-12-09 00:13:19)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#6 2012-12-09 01:38:41

Thump
Member
Registered: 2012-12-08
Posts: 12

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

hunterthomson wrote:
brctl addbr br0

I've already tried that and posted the results in my first message.

Thump wrote:
[root@planitia ~]# brctl addbr br0
add bridge failed: Package not installed

That's an issue for me because manual tells that module is required which should be autoloaded and it can be verified by `brctl` without options, and that gives me normal output.

Also, Arch shipped with iproute2 which include `bridge`, but it doesn't work for me. I've tried different options with `bridge` but it always fail with the same error. Maybe I didn't get the right way to use but it seems like a bug for me.

[root@planitia ~]# zcat /proc/config.gz | grep CONFIG_BRIDGE=
CONFIG_BRIDGE=m
[root@planitia ~]# ls /usr/lib/modules/3.6.9-1-ARCH/kernel/net/bridge
bridge.ko.gz  netfilter

Offline

#7 2012-12-09 05:45:41

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

Ya iproute2 has the `bridge` command but the kernel modules for that command to make a fdb device are not compiled in the Arch kernel.

That bridge module

/usr/lib/modules/3.6.9-1-ARCH/kernel/net/bridge/bridge.ko.gz

Gets used by the `brctl` command provided by the bridge-utils package you have to install.

[root@archbox:~]# pacman -Ss bridge-utils
core/bridge-utils 1.5-1 [installed]
    Utilities for configuring the Linux ethernet bridge

[root@archbox:~]# brctl show br0
bridge name     bridge id               STP enabled     interfaces
br0             8000.00223ff1fab4       no              lan
                                                        tap0
                                                        tap1
                                                        tap2

NOTE: That lan interface is a physical RJ-45 ethernet interface

See
bridge module
stp (Spanning Tree Protocol) module
llc (Logical Link Control) module
are loaded on my box

[user@archbox:~]% sudo lsmod |grep bridge
bridge                 85140  0 
stp                     2530  1 bridge
llc                     4826  2 stp,bridge

However, the br_ modules are not installed at all. At the very least you would need this one to make a fdb device
http://tomoyo.sourceforge.jp/cgi-bin/lx … e/br_fdb.c


Are you 110% sure you have run this command?

pacman -S bridge-utils

Last edited by hunterthomson (2012-12-09 06:12:41)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#8 2012-12-09 06:09:22

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

You maybe should post a Bug report on the Arch linux Kernel.

If Arch is going to push people to use iproute2 they need to ship a kernel with at least these modules.

https://lwn.net/Articles/492108/

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |  121 ++++++++---
drivers/net/macvlan.c                         |   61 +++++-
include/linux/if_link.h                       |    3
include/linux/if_macvlan.h                    |    1
include/linux/neighbour.h                     |    3
include/linux/netdevice.h                     |   25 ++
include/linux/rtnetlink.h                     |    4
net/bridge/br_device.c                        |    3
net/bridge/br_fdb.c                           |  128 +++---------
net/bridge/br_netlink.c                       |   12 -
net/bridge/br_private.h                       |   15 +
net/core/dev_addr_lists.c                     |   97 ++++++++-
net/core/rtnetlink.c                          |  267 +++++++++++++++++++++++++
13 files changed, 567 insertions(+), 173 deletions(-)

Last edited by hunterthomson (2012-12-09 06:09:36)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#9 2012-12-09 11:06:42

Thump
Member
Registered: 2012-12-08
Posts: 12

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

hunterthomson wrote:
[root@archbox:~]# pacman -Ss bridge-utils
core/bridge-utils 1.5-1 [installed]
    Utilities for configuring the Linux ethernet bridge

I'm getting the exactly same output.

hunterthomson wrote:
[user@archbox:~]% sudo lsmod |grep bridge
bridge                 85140  0 
stp                     2530  1 bridge
llc                     4826  2 stp,bridge

Seems module doesn't load automatically for me.
Also it doesn't load manually:

[root@planitia ~]# modprobe -vv bridge
modprobe: INFO: custom logging function 0x40aba0 registered
modprobe: INFO: context 0x12d01e0 released
[root@planitia ~]# lsmod | grep bridge
[root@planitia ~]#

hunterthomson, can you advise anything with module? I'm stuck.

Offline

#10 2012-12-09 11:22:45

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

Your golden.
Now just run this command, and configure the bridge how I showed you above.

pacman -S bridge-utils

EDIT: Okay, so you do have that package installed...

Then run these commands and post the output

sudo pacman -S mlocate
sudo updatedb
locate brctl

The command should be in /usr/sbin ... try running this command

/usr/sbin/brctl

....I am lost, I have used bridge-utils for years, and never had a problem.

Maybe... but I am almost sure not... install this package that provides you with the tunctl command

pacman -S uml_utilities

Last edited by hunterthomson (2012-12-09 11:35:47)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#11 2012-12-09 11:26:28

Thump
Member
Registered: 2012-12-08
Posts: 12

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

I have installed bridge-utils before. Are you sure there is need to reinstall it?
The whole package is: man pages for brctl, /usr/sbin/brctl , /etc/conf.d/bridges. I have that all.
As you see when I'm launching `brctl addbr br0` it doesn't tell that command is not found.

Last edited by Thump (2012-12-09 11:33:41)

Offline

#12 2012-12-09 11:37:01

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

Try runing the command with the full path, maybe? Maybe your profile is not setup correctly?

sudo /usr/sbin/brctl

Then just go full bore and install eveyrthing I have...

sudo pacman -S net-tools uml_utilities

Last edited by hunterthomson (2012-12-09 11:41:49)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#13 2012-12-09 11:44:38

Thump
Member
Registered: 2012-12-08
Posts: 12

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

[root@planitia ~]# locate brctl
/usr/sbin/brctl
/usr/share/man/man8/brctl.8.gz
[root@planitia ~]# /usr/sbin/brctl addbr br0
add bridge failed: Package not installed

Also, I'm sure that there is no need in uml_utilities.
Even installation of net-tools which I had not before doesn't help, there is no dependencies.

Last edited by Thump (2012-12-09 11:47:23)

Offline

#14 2012-12-09 14:06:40

roentgen
Member
Registered: 2011-03-15
Posts: 91

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

Nothing in dmesg? Also it may be valuable to see what 'modinfo bridge' says.

Offline

#15 2012-12-09 14:14:14

Thump
Member
Registered: 2012-12-08
Posts: 12

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

Damn.. I've rebooted arch server and that solved the issue.
hunterthomson, roentgen, thank you.

Also, it doesn't seems that there is no modules like br_fdb for using iproute2 bridge, I think it's already inside the bridge.ko.
I've found libnl (RTNETLINK) package too old, so I've flagged it in repository as out-of-date, maybe this is an issue for iproute2 bridge.

Last edited by Thump (2012-12-09 18:16:54)

Offline

#16 2012-12-09 23:39:47

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: [SOLVED] Unable to bridge network interfaces by bridge-utils/iproute2

Few, I am glad it is working now.

I was going to suggest you reboot next. After I want to bed I did finaly realize that the errors did infact mean that the bridge.ko module was not being loaded.


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

Board footer

Powered by FluxBB