From: Aleksandar Milivojevic <amilivojevic@pbl.ca>
To: netfilter@lists.netfilter.org
Subject: Re: ip alias
Date: Tue, 28 Sep 2004 08:56:58 -0500 [thread overview]
Message-ID: <41596DAA.9040900@pbl.ca> (raw)
In-Reply-To: <007f01c4a552$7c95a620$936ffea9@alpha>
John Black wrote:
> but the traffic from 192.168.1.23 that i need to go to the internet i would
> like to
> have addressed as 161.31.31.23
You need SNAT (source NAT), not DNAT (destination NAT). I'll assume
eth0 has address 161.31.31.23:
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source 161.31.31.23
or if eth0 has dinamically allocated IP address:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUARADE
I'm not sure why you are assigning local IP address as an alias to your
external interface (probably something you haven't mentioned), so I
wan't comment on whether it is needed or not. Also, in case when you
have multiple IP addresses (aliases) assigned to an interface, I'm not
sure exactly how MASQUERADE target behaves. man iptables for more
details and differences between SNAT and MASQUERADE targets.
--
Aleksandar Milivojevic <amilivojevic@pbl.ca> Pollard Banknote Limited
Systems Administrator 1499 Buffalo Place
Tel: (204) 474-2323 ext 276 Winnipeg, MB R3T 1L7
next prev parent reply other threads:[~2004-09-28 13:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-28 3:15 ip alias John Black
[not found] ` <Pine.NEB.4.60.0409280439060.15502@sdf.lonestar.org>
2004-09-28 4:44 ` John Black
2004-09-28 14:27 ` Jose Maria Lopez
2004-09-28 5:57 ` Aleksandar Milivojevic
2004-09-28 11:58 ` John Black
2004-09-28 13:56 ` Aleksandar Milivojevic [this message]
[not found] <41596898.178.36a5.6993354@arbbs.net>
2004-09-28 15:17 ` Aleksandar Milivojevic
[not found] <20040928051024.692C0BE3@sterenborg.info>
2004-09-28 12:04 ` John Black
2004-09-28 13:51 ` Jason Opperisano
2004-09-28 14:27 ` Jose Maria Lopez
-- strict thread matches above, loose matches on Subject: below --
2000-12-28 0:33 IP_ALIAS ruschein
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=41596DAA.9040900@pbl.ca \
--to=amilivojevic@pbl.ca \
--cc=netfilter@lists.netfilter.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.