All of lore.kernel.org
 help / color / mirror / Atom feed
* avoid  ip forward replaces the source MAC address
@ 2011-02-01 19:27 Elvis Yoan Tamayo Mollares
  2011-02-01 19:39 ` John Mahoney
  2011-02-02 12:16 ` Bernd Petrovitsch
  0 siblings, 2 replies; 5+ messages in thread
From: Elvis Yoan Tamayo Mollares @ 2011-02-01 19:27 UTC (permalink / raw)
  To: kernelnewbies

hi list, during ip forwarding process, the kernel replace the source MAC 
address of the package it received with my own MAC address.. My question 
is: Is there any way to avoid this behavior?
Regards.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* avoid ip forward replaces the source MAC address
  2011-02-01 19:27 avoid ip forward replaces the source MAC address Elvis Yoan Tamayo Mollares
@ 2011-02-01 19:39 ` John Mahoney
  2011-02-02  9:16   ` Christophe Aeschlimann
  2011-02-02 19:26   ` John Mahoney
  2011-02-02 12:16 ` Bernd Petrovitsch
  1 sibling, 2 replies; 5+ messages in thread
From: John Mahoney @ 2011-02-01 19:39 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Feb 1, 2011 at 2:27 PM, Elvis Yoan Tamayo Mollares
<etmoyares@grm.uci.cu> wrote:
> hi list, during ip forwarding process, the kernel replace the source MAC
> address of the package it received with my own MAC address.. My question
> is: Is there any way to avoid this behavior?

That is what routing does at the ip layer.  You may be able to
accomplish this by bridging the two ports together so that the traffic
is handled at layer 2.


--
John

^ permalink raw reply	[flat|nested] 5+ messages in thread

* avoid ip forward replaces the source MAC address
  2011-02-01 19:39 ` John Mahoney
@ 2011-02-02  9:16   ` Christophe Aeschlimann
  2011-02-02 19:26   ` John Mahoney
  1 sibling, 0 replies; 5+ messages in thread
From: Christophe Aeschlimann @ 2011-02-02  9:16 UTC (permalink / raw)
  To: kernelnewbies

On 01.02.2011 20:39, John Mahoney wrote:
> On Tue, Feb 1, 2011 at 2:27 PM, Elvis Yoan Tamayo Mollares
> <etmoyares@grm.uci.cu> wrote:
>> hi list, during ip forwarding process, the kernel replace the source MAC
>> address of the package it received with my own MAC address.. My question
>> is: Is there any way to avoid this behavior?
> 
> That is what routing does at the ip layer.  You may be able to
> accomplish this by bridging the two ports together so that the traffic
> is handled at layer 2.


Indeed, have a look at :

http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge

> --
> John

-- 
Christophe Aeschlimann

Embedded Software Engineer

ACN Advanced Communications Networks S.A.

Rue du Puits-Godet 8a
2000 Neuch?tel, Switzerland

T?l. +41 32 724 74 31

c.aeschlimann at acn-group.ch

^ permalink raw reply	[flat|nested] 5+ messages in thread

* avoid  ip forward replaces the source MAC address
  2011-02-01 19:27 avoid ip forward replaces the source MAC address Elvis Yoan Tamayo Mollares
  2011-02-01 19:39 ` John Mahoney
@ 2011-02-02 12:16 ` Bernd Petrovitsch
  1 sibling, 0 replies; 5+ messages in thread
From: Bernd Petrovitsch @ 2011-02-02 12:16 UTC (permalink / raw)
  To: kernelnewbies

On Die, 2011-02-01 at 14:27 -0500, Elvis Yoan Tamayo Mollares wrote: 
> hi list, during ip forwarding process, the kernel replace the source MAC 
> address of the package it received with my own MAC address.. My question 
> is: Is there any way to avoid this behavior?

Do not route (on IP-level/OSI layer 3) but switch only (on MAC level/OSI
layer 2).
Of course that has other implications and can't be done always ...

Bernd
-- 
Bernd Petrovitsch                  Email : bernd at petrovitsch.priv.at
                     LUGA : http://www.luga.at

^ permalink raw reply	[flat|nested] 5+ messages in thread

* avoid ip forward replaces the source MAC address
  2011-02-01 19:39 ` John Mahoney
  2011-02-02  9:16   ` Christophe Aeschlimann
@ 2011-02-02 19:26   ` John Mahoney
  1 sibling, 0 replies; 5+ messages in thread
From: John Mahoney @ 2011-02-02 19:26 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Feb 1, 2011 at 2:39 PM, John Mahoney <jmahoney@waav.com> wrote:
> On Tue, Feb 1, 2011 at 2:27 PM, Elvis Yoan Tamayo Mollares
> <etmoyares@grm.uci.cu> wrote:
>> hi list, during ip forwarding process, the kernel replace the source MAC
>> address of the package it received with my own MAC address.. My question
>> is: Is there any way to avoid this behavior?
>
> That is what routing does at the ip layer. ?You may be able to
> accomplish this by bridging the two ports together so that the traffic
> is handled at layer 2.

As a side note, looking at the iptables target:
 -m mac --mac-source XX:XX:XX:XX:XX:XX [1]

and the kernel code for that module (net/netfilter/xt_mac.c) it
appears that the src MAC address is saved in the sk_buff and is still
accessible in the PREROUTING, INPUT, and FORWARD chains via
eth_hdr(skb)->h_source.

I do not know if that helps.  I guess my point is my first answer was
the logical one, but it may be possible if you think outside the box.

--
John

[1]http://www.faqs.org/docs/iptables/matches.html#TABLE.MACMATCH

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-02-02 19:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-01 19:27 avoid ip forward replaces the source MAC address Elvis Yoan Tamayo Mollares
2011-02-01 19:39 ` John Mahoney
2011-02-02  9:16   ` Christophe Aeschlimann
2011-02-02 19:26   ` John Mahoney
2011-02-02 12:16 ` Bernd Petrovitsch

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.