netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: Mikael Abrahamsson <swmike@swm.pp.se>
Cc: netdev@vger.kernel.org
Subject: Re: question regarding Linux kernel handling of packets received that has src address of interface address
Date: Fri, 5 Oct 2018 13:27:01 +0300	[thread overview]
Message-ID: <20181005102701.GA20105@splinter> (raw)
In-Reply-To: <alpine.DEB.2.20.1810051035270.4550@uplift.swm.pp.se>

On Fri, Oct 05, 2018 at 10:50:24AM +0200, Mikael Abrahamsson wrote:
> So my question is where in the Linux kernel is this check performed that
> disallows incoming packets that have src IP address the same as an interface
> address? Can it be turned off? Is there a way to "hack around it", for
> instance with iptables and re-write the source address of the packet before
> it hits this check (I don't care about the source address when the packet is
> delivered to the application, it can be re-written to anything).

Did you set 'accept_local' [1] ?

"
accept_local - BOOLEAN
	Accept packets with local source addresses. In combination with
	suitable routing, this can be used to direct packets between two
	local interfaces over the wire and have them accepted properly.
	default FALSE
"

I tried to create a setup similar to yours and it seems to be working
for me.

1. https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt

  reply	other threads:[~2018-10-05 17:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05  8:50 question regarding Linux kernel handling of packets received that has src address of interface address Mikael Abrahamsson
2018-10-05 10:27 ` Ido Schimmel [this message]
2018-10-05 11:41   ` Mikael Abrahamsson

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=20181005102701.GA20105@splinter \
    --to=idosch@idosch.org \
    --cc=netdev@vger.kernel.org \
    --cc=swmike@swm.pp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).