* how to forward packets to another gateway, if i'm one
@ 2002-12-06 17:28 Saulius Menkevicius
2002-12-17 14:00 ` Marcello Scacchetti
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Saulius Menkevicius @ 2002-12-06 17:28 UTC (permalink / raw)
To: netfilter@lists.netfilter.org
Hi,
I've spend some time searching Google on the topic, however
eventually gave up. So..
Is there any way of forwarding packets to another gateway, which,
besides, is on the same network. Say, I'm on IP 10.0.0.2, and I act
as a gateway (ADSL, really) for a number of machines on the same LAN.
And there's another such gateway, hooked to another ADSL, which
handles connections for another bunch of machines. Essentially the
hosts 10.0.0.1 and 10.0.0.2 are identic and perform the same
function.
Now, I want to make some traffic that comes from some client and
that should go through gateway 10.0.0.1 to be forwarded to 10.0.0.2
(without any changes). The need is to make the forwarding transparent
to both 10.0.0.2 and the client.
So it's the way I suppose it should be done:
a) No changes to be made 10.0.0.2's firewalling rules (in fact, it
runs FreeBSD);
b) Make 10.0.0.1 to forward them to 10.0.0.2 transparently.
_This_is_the_culprit_. I don't know how to make them (packets) go
that way. DNAT/SNAT doesn't suit, neither does REDIRECT, as they
modify packets they filter.
In FreeBSD, there's ipfw rule fwd, e.g. if 10.0.0.1 ran bsd, i'd
type "ipfw add fwd 10.0.0.2 ip from some_client to any". I'm looking
for the a way on how to make the same effect on Linux/iptables.
Wrote to much of blurb. Guess I didn't mess it up too much :)
Thanks.
--
Saulius Menkevicius, razzmatazz@mail.lt on 12.06.2002
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: how to forward packets to another gateway, if i'm one
2002-12-06 17:28 how to forward packets to another gateway, if i'm one Saulius Menkevicius
@ 2002-12-17 14:00 ` Marcello Scacchetti
2002-12-17 15:16 ` Ben Russo
2002-12-17 16:07 ` Andrea Rossato
2 siblings, 0 replies; 4+ messages in thread
From: Marcello Scacchetti @ 2002-12-17 14:00 UTC (permalink / raw)
To: Saulius Menkevicius; +Cc: netfilter@lists.netfilter.org
Hi Saulius,
i think your solution is to use advanced kernel routing options using
the ip tool. This will allow you to use source based routing. route
command allows only setup destination based routes.
I think that http://lartc.org/ will come really in help to you, look for
Linux Advanced Routing & Traffic Control HOWTO.
Hope this helps,
Marcello
Il ven, 2002-12-06 alle 18:28, Saulius Menkevicius ha scritto:
> Hi,
> I've spend some time searching Google on the topic, however
> eventually gave up. So..
>
> Is there any way of forwarding packets to another gateway, which,
> besides, is on the same network. Say, I'm on IP 10.0.0.2, and I act
> as a gateway (ADSL, really) for a number of machines on the same LAN.
> And there's another such gateway, hooked to another ADSL, which
> handles connections for another bunch of machines. Essentially the
> hosts 10.0.0.1 and 10.0.0.2 are identic and perform the same
> function.
>
> Now, I want to make some traffic that comes from some client and
> that should go through gateway 10.0.0.1 to be forwarded to 10.0.0.2
> (without any changes). The need is to make the forwarding transparent
> to both 10.0.0.2 and the client.
>
> So it's the way I suppose it should be done:
> a) No changes to be made 10.0.0.2's firewalling rules (in fact, it
> runs FreeBSD);
> b) Make 10.0.0.1 to forward them to 10.0.0.2 transparently.
>
> _This_is_the_culprit_. I don't know how to make them (packets) go
> that way. DNAT/SNAT doesn't suit, neither does REDIRECT, as they
> modify packets they filter.
>
> In FreeBSD, there's ipfw rule fwd, e.g. if 10.0.0.1 ran bsd, i'd
> type "ipfw add fwd 10.0.0.2 ip from some_client to any". I'm looking
> for the a way on how to make the same effect on Linux/iptables.
> Wrote to much of blurb. Guess I didn't mess it up too much :)
>
> Thanks.
--
Marcello Scacchetti <marcello.scacchetti@nextrem.it>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to forward packets to another gateway, if i'm one
2002-12-06 17:28 how to forward packets to another gateway, if i'm one Saulius Menkevicius
2002-12-17 14:00 ` Marcello Scacchetti
@ 2002-12-17 15:16 ` Ben Russo
2002-12-17 16:07 ` Andrea Rossato
2 siblings, 0 replies; 4+ messages in thread
From: Ben Russo @ 2002-12-17 15:16 UTC (permalink / raw)
To: Saulius Menkevicius; +Cc: netfilter@lists.netfilter.org
On Fri, 2002-12-06 at 12:28, Saulius Menkevicius wrote:
> Is there any way of forwarding packets to another gateway, which,
> besides, is on the same network. Say, I'm on IP 10.0.0.2, and I act
> as a gateway (ADSL, really) for a number of machines on the same LAN.
> And there's another such gateway, hooked to another ADSL, which
> handles connections for another bunch of machines. Essentially the
> hosts 10.0.0.1 and 10.0.0.2 are identic and perform the same
> function.
>
If both 10.0.0.1 and 10.0.0.2 are on the same subnet then just find
the client machines that you want to use 10.0.0.1 as their gateway
and change their default route. No changes at all would be required
on either gateway.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: how to forward packets to another gateway, if i'm one
2002-12-06 17:28 how to forward packets to another gateway, if i'm one Saulius Menkevicius
2002-12-17 14:00 ` Marcello Scacchetti
2002-12-17 15:16 ` Ben Russo
@ 2002-12-17 16:07 ` Andrea Rossato
2 siblings, 0 replies; 4+ messages in thread
From: Andrea Rossato @ 2002-12-17 16:07 UTC (permalink / raw)
To: netfilter
Saulius Menkevicius wrote:
> Now, I want to make some traffic that comes from some client and
> that should go through gateway 10.0.0.1 to be forwarded to 10.0.0.2
> (without any changes). The need is to make the forwarding transparent
> to both 10.0.0.2 and the client.
in 10.0.0.1
ip rule add from YOUR_CLIENT [to DESTINATION] table fbsd.out
ip route add default via 10.0.0.2 dev $DEV table fbsd.out
I think this should do the job (for more information http://lartc.org/)
you create a routing table (fbsd.out) that will use 10.0.0.2 as gateaway
for packets comming from your client.
I did not test this config, since I'm marking packets in the FORWARD
chain of the mangle table and use
ip rule add fwmark to route them.
hope this helps.
andrea
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-12-17 16:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-06 17:28 how to forward packets to another gateway, if i'm one Saulius Menkevicius
2002-12-17 14:00 ` Marcello Scacchetti
2002-12-17 15:16 ` Ben Russo
2002-12-17 16:07 ` Andrea Rossato
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.