From: Bart De Schuymer <bdschuym@pandora.be>
To: Joakim Tjernlund <joakim.tjernlund@transmode.se>
Cc: bridge@lists.linux-foundation.org
Subject: Re: [Bridge] IP address on physcial interface instead of bridge interface?
Date: Fri, 26 Mar 2010 09:55:31 +0100 [thread overview]
Message-ID: <4BAC7683.8020901@pandora.be> (raw)
In-Reply-To: <OF073A246F.60E9C255-ONC12576F2.0028EAD8-C12576F2.002A871C@transmode.se>
Joakim Tjernlund wrote:
> Nicolas de Pesloüan <nicolas.2p.debian@free.fr> wrote on 2010/03/25 22:03:06:
>
>> Joakim Tjernlund wrote:
>> [...]
>>
>>> Sorry but I could not find that discussion but it doesn't sound as
>>> what I was after. Basically I want the eth0 I/F keeping its IP address
>>> and take over the roll of the br0 I/F when it has an IP address.
>>>
>> Can you please try to explain the reason why you would like the bridge members
>> to have an IP,
>> instead of the br0 interface ?
>>
>
> Sure, our app sometimes just uses eth0 as an normal eth I/F and in some
> configs eth0 needs to be bridged with other I/Fs. Moving the IP address from eth0 to
> the br0 I/F is painful once the system has booted. There are services already running
> on eth0 then once a user decides he needs bridged system all services needs to be restarted.
>
>
Hi,
Unfortunately this is impossible in the current bridge implementation
without temporarily losing connectivity because the ebtables BROUTING
chain isn't traversed while the bridge port is in learning state. But
with the patch below, the following scenario works without loss of
connectivity:
# (Suppose the bridge isn't configured yet)
ifconfig eth0 $IP
# (the routing table should be correct now, if not you need to do it
yourself)
# (the ebtables rules below will be effective once br0 is up)
# direct local IP traffic to eth0
ebtables -t broute -A BROUTING -p ipv4 -i eth0 --ip-dst $IP -j DROP
# direct arp replies for $MAC_OF_ETH0 to eth0
ebtables -t broute -A BROUTING -p arp -i eth0 -d $MAC_OF_ETH0 -j DROP
# direct arp requests for $IP to eth0
ebtables -t broute -A BROUTING -p arp -i eth0 --arp-ip-dst $IP -j DROP
brctl addbr br0
# make sure to bring br0 up before adding the interface
ifconfig br0 up
brctl addif br0 eth0
If you don't mind loss of connectivity while the bridge port is in
learning state, you don't need the patch.
Stephen, please consider applying the patch below.
cheers,
Bart
Process the brouting decision while the bridge port is in learning state.
Signed-off-by: Bart De Schuymer <bdschuym@pandora.be>
--- linux-2.6.33/net/bridge/br_input.c 2010-02-24 19:52:17.000000000
+0100
+++ linux-2.6.33-uml/net/bridge/br_input.c 2010-03-26
09:21:50.000000000 +0100
@@ -148,14 +148,13 @@ struct sk_buff *br_handle_frame(struct n
forward:
switch (p->state) {
case BR_STATE_FORWARDING:
+ case BR_STATE_LEARNING:
rhook = rcu_dereference(br_should_route_hook);
if (rhook != NULL) {
if (rhook(skb))
return skb;
dest = eth_hdr(skb)->h_dest;
}
- /* fall through */
- case BR_STATE_LEARNING:
if (!compare_ether_addr(p->br->dev->dev_addr, dest))
skb->pkt_type = PACKET_HOST;
--
Bart De Schuymer
www.artinalgorithms.be
next prev parent reply other threads:[~2010-03-26 8:55 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-25 16:42 [Bridge] IP address on physcial interface instead of bridge interface? Joakim Tjernlund
2010-03-25 17:03 ` richardvoigt
2010-03-25 20:24 ` Joakim Tjernlund
2010-03-25 21:03 ` Nicolas de Pesloüan
2010-03-26 7:44 ` Joakim Tjernlund
2010-03-26 8:55 ` Bart De Schuymer [this message]
2010-03-26 7:55 ` Joakim Tjernlund
2010-03-26 20:39 ` Nicolas de Pesloüan
2010-03-26 20:48 ` Joakim Tjernlund
2010-03-26 21:35 ` Nicolas de Pesloüan
2010-03-27 10:42 ` Joakim Tjernlund
2010-03-28 15:19 ` Joakim Tjernlund
2010-03-28 16:03 ` Stephen Hemminger
2010-03-28 16:19 ` Joakim Tjernlund
2010-03-26 21:42 ` richardvoigt
2010-03-27 10:50 ` Joakim Tjernlund
2010-03-28 3:17 ` Stephen Hemminger
2010-03-28 9:53 ` Joakim Tjernlund
2010-03-28 12:48 ` Bart De Schuymer
2010-03-28 18:27 ` Joakim Tjernlund
[not found] ` <OFDC6DBFAF.3C46B16B-ONC12576F4.00654457-C12576F4.00655D53@LocalDomain>
2010-03-28 19:04 ` Joakim Tjernlund
[not found] ` <OF59D1A758.6E7DFF8C-ONC12576F4.0068613D-C12576F4.0068C11D@LocalDomain>
[not found] ` <OF66063C34.9F68251B-ONC12576F5.0025FFA1-C12576F <4BB05AE7.10905@pandora.be>
[not found] ` <OF35408968.E095E27C-ONC12576F5. <4BB06A0E.9000705@pandora.be>
2010-03-29 6:57 ` Joakim Tjernlund
2010-03-29 7:46 ` Bart De Schuymer
2010-03-29 8:34 ` Joakim Tjernlund
2010-03-29 8:51 ` Bart De Schuymer
2010-03-29 8:59 ` Joakim Tjernlund
2010-03-29 9:31 ` Bart De Schuymer
2010-03-29 9:48 ` Joakim Tjernlund
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=4BAC7683.8020901@pandora.be \
--to=bdschuym@pandora.be \
--cc=bridge@lists.linux-foundation.org \
--cc=joakim.tjernlund@transmode.se \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.