Re: Wrong MAC in redirected packet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 2009-03-25 15:27, Kristian Evensen wrote:

>Hello,
>
>I have a setup where I have a sender and a multihomed receiver
>connected through a switch, and I am working on a module that
>currently does more or less the same as RAWDNAT [1] (at least it is
>supposed to). My goal is to redirect packets destined for one
>interface on the multihomed receiver to the other, and changing the IP
>address works. Unfortunately, the packet keeps the original
>destination MAC-address, so it arrives at the wrong interface on the
>multihomed receiver.

Ah that might also explain why I observed that packets get lost sometimes..

>My theory is that the original MAC-address is somehow added to the SKB
>before it reaches the output-part of the RAW-table (which is where I
>hook in),

Routing is done before rawpost, yes, but before the (traditional) raw table.
(it's in skb->dst)

>because of the sender's mapping between the original
>destination IP and MAC. However, I have not been able to figure this
>out. Also, I  looked at the NAT-code, but it seems to "only" change
>IP-address as well. Have I overlooked something or am I correct?

Most likely RAWS/DNAT should gain another option to also tweak the
MAC daddr, by calling ip_route_output_key to get a new skb->dst.

>Btw, RAWDNAT throws up a couple of errors on my machine, so I have not
>been able to see it it does what I want to do.

Which errors?
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux