* Request: how do packet routing based on input gateway
@ 2009-10-24 13:22 Luca Dionisi
2009-10-24 14:19 ` Dunc
0 siblings, 1 reply; 3+ messages in thread
From: Luca Dionisi @ 2009-10-24 13:22 UTC (permalink / raw)
To: netdev, linux-net
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Request: how do packet routing based on input gateway
2009-10-24 13:22 Request: how do packet routing based on input gateway Luca Dionisi
@ 2009-10-24 14:19 ` Dunc
[not found] ` <73dbe2850910241013k7a83b07qed1f6f365e18c90e@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Dunc @ 2009-10-24 14:19 UTC (permalink / raw)
To: Luca Dionisi; +Cc: netdev, linux-net
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-10-24 17:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-24 13:22 Request: how do packet routing based on input gateway Luca Dionisi
2009-10-24 14:19 ` Dunc
[not found] ` <73dbe2850910241013k7a83b07qed1f6f365e18c90e@mail.gmail.com>
2009-10-24 17:14 ` Luca Dionisi
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).