netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dunc <dunc@lemonia.org>
To: Luca Dionisi <luca.dionisi@gmail.com>
Cc: netdev@vger.kernel.org, linux-net@vger.kernel.org
Subject: Re: Request: how do packet routing based on input gateway
Date: Sat, 24 Oct 2009 15:19:45 +0100	[thread overview]
Message-ID: <4AE30D01.7030700@lemonia.org> (raw)
In-Reply-To: <73dbe2850910240622s2453c252p17d928f8a94ffe33@mail.gmail.com>

If both of your last hops are on the same subnet you can't use incoming
interface, so the only thing I can think of is to match the MAC address
of the ethernet frame. If the last hop wasn't the source of the packet I
don't think there's anything else to uniquely identify it.

Cheers,

Dunc


Luca Dionisi wrote:
> Hi all
> 
> I must instruct my server to route packets based on destination prefix
> and on the gateway from which the packet arrived.
> E.g.
>  I am 192.168.0.1
>  a packet for 192.168.1.0/24 which arrived from gateway 192.168.0.2
> must go through 192.168.1.1 dev eth0
>  a packet for 192.168.1.0/24 which arrived from gateway 192.168.0.3
> must go through 192.168.1.2 dev eth1
>  a packet for 192.168.1.0/24 which arrived from any other gateway must
> go through 192.168.1.3 dev eth2
> 
> The gateway I mean is just the last hop traversed, before me. It's not
> necessarily the source of the packet.
> 
> How am I supposed to do that?
> 
> Regards.
> Luca Dionisi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  reply	other threads:[~2009-10-24 14:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-24 13:22 Request: how do packet routing based on input gateway Luca Dionisi
2009-10-24 14:19 ` Dunc [this message]
     [not found]   ` <73dbe2850910241013k7a83b07qed1f6f365e18c90e@mail.gmail.com>
2009-10-24 17:14     ` Luca Dionisi

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=4AE30D01.7030700@lemonia.org \
    --to=dunc@lemonia.org \
    --cc=linux-net@vger.kernel.org \
    --cc=luca.dionisi@gmail.com \
    --cc=netdev@vger.kernel.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).