Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
To: Jacky Lam <lamshuyin@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Ebtables usage
Date: Tue, 15 Feb 2011 11:47:53 +0100	[thread overview]
Message-ID: <4D5A59D9.9040407@plouf.fr.eu.org> (raw)
In-Reply-To: <AANLkTimR2FQfmmnoy6YoYYGCAqs=j26KpvtLTYHHgMQN@mail.gmail.com>

Hello,

Jacky Lam a écrit :
> Yes, my config is like this:
> 
>     Computer A (10.1.4.1) <-----> (eth0: 10.1.4.5) Linux Switch (eth1:
> 11.1.4.5) <-------> Computer B (11.1.4.3)
> 
> I each ip_forwarding and config the route table of Computer A,B. I get
> 500Mb/s from iperf while Linux Switch is 100% loaded.
> As I know this switching is done in IP level,

Your box is set up as a router, not a switch/bridge. Routing is done at
the IP level, and switching/bridging is done at the ethernet level.

> I want to do the job in
> data link layer to get higher throughput/lower CPU usage.

Not sure you'll get higher throughput though. Bridging adds its own
overhead.

> Then I tried the following configuration:
> 
>     Computer A (10.1.4.1) <-----> (eth0) Linux Switch (eth1) <------->
> Computer B (10.1.4.3)
> 
> I tried to setup a bridge like this as some document said:
> 
> iptables -t nat -A POSTROUTING -s 10.1.4.0/24 -d 10.1.4.0/24 -j ACCEPT
> iptables -t nat -A POSTROUTING -s 10.1.4.0/24 -j MASQUERADE

What do you need these rules for ? They are not needed for pure bridging.

> brctl addbr br0
> brctl stp br0 off
> brctl addif br0 eth0
> brctl addif br0 eth1
> 
> ifconfig eth0 0 0.0.0.0
> ifconfig eth1 0 0.0.0.0

Ok.

> ifconfig br0 10.1.4.5 netmask 255.255.255.0 up
> 
> echo '1' > /proc/sys/net/ipv4/ip_forward

This is IP-related and not required for pure bridging.

> But the throughput is only 200Mb/s and my Linux Switch is 100% loaded.
> What's wrong with that?

It may be the overhead caused by bridge-nf, netfilter, IPv4 conntrack
and iptables.
Try with /proc/sys/net/bridge/bridge-nf-call-iptables set to 0.

You did not explain what you want to do exactly with this box.

  reply	other threads:[~2011-02-15 10:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15  9:04 Ebtables usage Jacky Lam
2011-02-15  9:48 ` Pandu Poluan
2011-02-15 10:06   ` Jacky Lam
2011-02-15 10:47     ` Pascal Hambourg [this message]
2011-02-15 22:53       ` Jacky Lam
2011-02-16  8:50         ` Pascal Hambourg
2011-02-16  9:32           ` Jacky Lam
2011-02-17 11:28             ` Pascal Hambourg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D5A59D9.9040407@plouf.fr.eu.org \
    --to=pascal.mail@plouf.fr.eu.org \
    --cc=lamshuyin@gmail.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox