From: Valdis.Kletnieks@vt.edu (Valdis.Kletnieks at vt.edu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How do we determine IP Address of interface the packet arrived on
Date: Wed, 24 Sep 2014 12:22:19 -0400 [thread overview]
Message-ID: <10767.1411575739@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Wed, 24 Sep 2014 10:08:29 -0400." <20140924140828.GA21747@John-de-la-Garzas-Macbook-Pro.local>
On Wed, 24 Sep 2014 10:08:29 -0400, John de la Garza said:
> why not look at the destination ip of the ip header?
It's possible to receive a packet on the "wrong" interface.
For instance, we have a software package installed here that
insists on talking on one IP address, so we end up with this
setup:
world - 198.82.X.Y- |BOX| - 172.28.40.z - private 10G net - clientbox
and the client box does a 'route add host 198.82.x.y gw 172.28.40.z', so
when it sends packets to 198.82.x.y, it shows up on the box's 10G interface.
Said packet is then cheerfully accepted, because the destination address
matches *one* of the boxes's addresses (just on a different interface).
Another similar situation is for HA, where you'll have a pair (or more) of
boxes that each have their own IP address on a subnet, and a floating IP that's
used by client machines to actually access the service, and which moves back
and forth if a box fails or is down for maintenance. So the active one of the
HA pair has 2 addresses on the interface.
And that's not even starting on the case of "Linux-based router", where
*most* packets you handle don't have your IP address in the destination
field, because you are going to forward it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140924/b702dc34/attachment.bin
next prev parent reply other threads:[~2014-09-24 16:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-24 4:49 How do we determine IP Address of interface the packet arrived on Maninder Singh
2014-09-24 7:41 ` Vlad Dogaru
2014-09-24 12:03 ` 정현
2014-09-24 12:24 ` Valdis.Kletnieks at vt.edu
2014-09-24 14:08 ` John de la Garza
2014-09-24 16:22 ` Valdis.Kletnieks at vt.edu [this message]
2014-09-24 16:34 ` Jeff Haran
2014-09-25 3:14 ` maninder.tiet at gmail.com
2014-09-24 12:25 ` Valdis.Kletnieks at vt.edu
2014-09-25 3:20 ` Maninder Singh
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=10767.1411575739@turing-police.cc.vt.edu \
--to=valdis.kletnieks@vt.edu \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).