All of lore.kernel.org
 help / color / mirror / Atom feed
From: diab <lartc@diab.org>
To: lartc@vger.kernel.org
Subject: Re[2]: [LARTC] simple dual Internet connection setup not sending return packets on correct interface
Date: Fri, 26 Nov 2004 17:25:42 +0000	[thread overview]
Message-ID: <22708593.20041126182542@diab.org> (raw)
In-Reply-To: <924388892.20041126171758@diab.org>

>> 1) SNAT to the right source address, like
>> iptables -A POSTROUTING -j nat -t SNAT [-s from.where or -d to.where]\
>>          --to-source source.addr.of.eth0

BJM> Surely you mean -t nat -j SNAT?
sorry, yeah it was -t nat -j SNAT.. i double checked now :)

BJM> But these two iptables rules conflict with each other.  If -s
BJM> "from.where" is my internal lan and the same in both rules, they are
BJM> both trying to do the SNATting of the same packets.  In my two rules, I
BJM> added a -o <iface> (where <iface> is the interface matching the
BJM> source.addr.of.<iface>).
yes they are conflicting with each other.. i thought that you could
select which connection the packets should be using either based on
the address the packets are coming FROM (-s some.ip.on.the.lan) or
going TO (-d wan.destination.address.).

BJM> I have:
BJM> ip rule add from 66.11.173.224 lookup 1
BJM> ip rule add from 24.235.240.15 lookup 2
anyways, you can "name" routing tables in /etc/iproute2/rt_tables
then it makes a bit more sense ("ip rule" also displays/uses them so eg.
if you name 1 to "abcd" then
ip rule add from x.x.x.x lookup abcd
also works.

iif is the interface packets are coming in (there is also oif).. if
it's not a static ip address it might be convenient not having to use
the IP of the connection but the interface. (same goes for the "via
XX when you are doing "ip route add default dev XY table N")

if you do "man ip" it reads (ip rule add/ip rule del):

iif NAME
  select  the  incoming  device  to match.  If the interface is
  loopback, the rule only matches packets originating from
  this host.  This means that you may create separate routing tables for
  forwarded and local packets  and,  hence,  com­
  pletely segregate them.

-
diab


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

      reply	other threads:[~2004-11-26 17:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-26 16:17 Re[2]: [LARTC] simple dual Internet connection setup not sending return packets on correct interface diab
2004-11-26 17:25 ` diab [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=22708593.20041126182542@diab.org \
    --to=lartc@diab.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 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.