Linux Advanced Routing and Traffic Control list
 help / color / mirror / Atom feed
From: Ira Abramov <lists-lartc@ira.abramov.org>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] same address range, different interfaces
Date: Thu, 20 Nov 2003 15:32:11 +0000	[thread overview]
Message-ID: <marc-lartc-106934244610704@msgid-missing> (raw)
In-Reply-To: <marc-lartc-106924600531191@msgid-missing>

Hey there, I wish people threw in more ideas...

what I tried now is this: my problem is that I need to route the packet
on the way out according to the original destination, but the only place
it will NAT the destination is before routing, so what I did waqs mark
packets with the netfilter MARK target and then have iproute2's code
select the routing table based on the fwmark. it's covoluted but should
work in theory:

1) MARK the incoming packet in table mangle on chain PREROUTING and
   OUTPUT
2) add a rule to the RPDB to map the NATsource based on the source and
   iface it came by, and then it goes to table main be default
   (problem! it should be a map based on the destination!)
3) open a new table (same ID as the MARK for conveniance) and add NAT to
   destination back to its real address (thus losing the original
   target, all I have left is the MARK to route with)
4) packet goes back to traverse the RPDB, where I catch it with another,
   lower priority rule than (2) based on the fwmark, sending it to the
   table I opened in (3) where I have a route to the right interface for
   the real address.

now this would work in theory if I could do (2) as NAT and then traverse
the RPDB again without sending it to a specific lookup table, is this
making sense? or can I send it to the local table and it will traverse
the rest of the RPDB when it gives up? am I missing another way of doing
this without a routing table per interface?

Any and all help is appreciated in advance,
Thanks,
Ira.



-- 
The little prince
Ira Abramov
http://ira.abramov.org/email/
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

      parent reply	other threads:[~2003-11-20 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-19 12:38 [LARTC] same address range, different interfaces Ira Abramov
2003-11-19 15:44 ` Ira Abramov
2003-11-20  9:44 ` Ira Abramov
2003-11-20 15:32 ` Ira Abramov [this message]

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=marc-lartc-106934244610704@msgid-missing \
    --to=lists-lartc@ira.abramov.org \
    --cc=lartc@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