All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin A. Brown" <mabrown-lartc@securepipe.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Routing private and non-private ips
Date: Wed, 17 Jul 2002 17:18:17 +0000	[thread overview]
Message-ID: <marc-lartc-102692631116515@msgid-missing> (raw)
In-Reply-To: <marc-lartc-102676164426604@msgid-missing>

Lucky,

 : Well, there comes something to my mind: All of the 192.168.2.0/24 gets
 : masq'ed to the internet on the router. I think I somehow have to exclude
 : 192.168.2.206 (the pr.iv.at.ip) from the masq'ing, right?
 : Or is the best solution to put the to-be-NATed server in another subnet
 : (192.168.4.0/24) for example?

Perhaps you could insert a new rule with ipchains or iptables.

So, you have something in your chains rules that looks like this:

  ipchains -A forward  -s 192.168.2.0/24 -d 0/0 -j MASQ

Simply insert a special case:

  ipchains -I forward 1 -s 192.168.2.206 -d 0/0 -j ACCEPT

Then the packet will not be masqueraded and will be handled by whatever 
other packet mangling rules you have (in particular, it will be NAT'd 
by the rule policy database).  To verify that the RPDB has the rules you 
inserted, try this (your output should look similar to this; filled in 
with the correct pu.bl.ic.ip, of course):

# ip rule show
0:      from all lookup local
32765:  from 192.168.2.206 lookup main map-to pu.bl.ic.ip
32766:  from all lookup main 
32767:  from all lookup 253
# ip route show table all | grep nat
nat pu.bl.ic.ip via 192.168.2.206 table local scope host

Rules in both iptables and ipchains are handled sequentially, so you want 
to create the more specific chains rules first and then the more general.  
This prevents the general rule from matching before the specific rule is 
used.

Freundliche grüsse,

-Martin

-- 
Martin A. Brown --- SecurePipe, Inc. --- mabrown@securepipe.com



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

  parent reply	other threads:[~2002-07-17 17:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-15 19:32 [LARTC] Routing private and non-private ips Lucky
2002-07-16 18:19 ` Martin A. Brown
2002-07-17 15:15 ` Lukas Kolbe
2002-07-17 17:18 ` Martin A. Brown [this message]
2002-07-19 18:29 ` Lukas Kolbe

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-102692631116515@msgid-missing \
    --to=mabrown-lartc@securepipe.com \
    --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.