All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Molina <jesse@opendreams.net>
To: netfilter@vger.kernel.org
Cc: Pascal Hambourg <pascal.mail@plouf.fr.eu.org>
Subject: Re: How do we arp for NAT?  Secondary IPs, proxy arp? something else?
Date: Fri, 12 Jun 2009 00:12:53 -0700	[thread overview]
Message-ID: <4A31FFF5.1030703@opendreams.net> (raw)
In-Reply-To: <4A1A6178.8080907@plouf.fr.eu.org>


Just wanted to reply again for documentation purposes regarding this old 
thread.  This was EXACTLY what I was looking for.

Here are some sample commands to replicate this;

# Add the IP 1.2.3.4 to eth1
# sudo ip route add local 1.2.3.4 table local dev eth1
#
# Show the local table
# sudo ip route show table local
#
# Delete the IP 1.2.3.4 from eth1
# sudo ip route delete local 1.2.3.4 table local dev eth1



I have not observed any daemon or service using the IPs that I 
configured with this method for ephemeral (outbound) services.  My 
upstream packet accounting confirms this.

Yes, the system replies to ARP requests for these IPs.

Unfortunately, local daemons that glob onto all addresses are still 
answering to services on these IPs if you don't filter or re-direct the 
traffic via iptables DNAT/SNAT, but that's not a major issue since it 
can be controlled as mentioned here.



I have been using this for a couple of weeks, works great.  I recommend 
this procedure over using secondary IPs on regular interfaces.

I hope this is useful to someone in the future.



Pascal Hambourg wrote:
> Hello,
> 
> Jesse Molina a écrit :
>>
>> To restate my question:  What alternative ways are there to make the 
>> GNU/Linux system reply to ARP requests for an IP, without that IP 
>> being an actual interface on the host, or that interface must not be 
>> used by local services *in any way*, for the reasons of using it via 
>> SNAT/DNAT?
> 
> ip route add local <address>/<mask> table local dev <interface>
> 
> This way <address>/<mask> will be considered local by the system which 
> will reply to ARP requests for it, actually usable by any local process, 
> but won't appear assigned to <interface> so chances are that no local 
> process will use it unless told explicitly.
> -- 
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
# Jesse Molina
# Mail = jesse@opendreams.net
# Page = page-jesse@opendreams.net
# Cell = 1.602.323.7608
# Web  = http://www.opendreams.net/jesse/



  parent reply	other threads:[~2009-06-12  7:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-24 10:37 How do we arp for NAT? Secondary IPs, proxy arp? something else? Jesse Molina
2009-05-24 11:19 ` Tore Anderson
2009-05-24 21:02   ` Jesse Molina
2009-05-24 21:55     ` Tore Anderson
2009-05-24 23:27     ` Mike Wright
2009-05-25  9:14     ` Pascal Hambourg
2009-05-29  8:09       ` Jesse Molina
2009-06-12  7:12       ` Jesse Molina [this message]
     [not found] ` <20090524164956.6f3fa24e@catlap>
2009-05-24 21:15   ` Jesse Molina
2009-05-25  4:51 ` Robert Nichols
2009-05-25  7:21 ` Покотиленко Костик

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=4A31FFF5.1030703@opendreams.net \
    --to=jesse@opendreams.net \
    --cc=netfilter@vger.kernel.org \
    --cc=pascal.mail@plouf.fr.eu.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.