All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aleksandar Milivojevic <amilivojevic@pbl.ca>
To: Netfilter User Mailinglist <netfilter@lists.netfilter.org>
Subject: Re: ip alias
Date: Tue, 28 Sep 2004 10:17:13 -0500	[thread overview]
Message-ID: <41598079.2020000@pbl.ca> (raw)
In-Reply-To: <41596898.178.36a5.6993354@arbbs.net>

John Black wrote:
> eth0 161.31.31.22 
> eth0:0 161.31.31.23 (i hope)
> eth1 192.168.1.1

So, eth0 is your external interface with two IP addresses assigned to 
it, and eth1 is interface to your local network?  Don't hope if the 
interface has an address assigned.  Check it with "ifconfig" or "ip 
address show".

Access to the Internet from the firewall box will work out of the box. 
Linux will use address of eth0 for all packets that are to leave the box 
out of eth0.

To allow hosts on your local network to access the internet, you need to 
enable forwarding and define simple NAT rule:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/16 -j SNAT 
--to-source 161.31.31.23

If you wanted to allow access *from* the Internet to one of the hosts on 
your local network (that doesn't have public IP address), than you would 
use DNAT target.

> this is how it was shown in the double nat howto.  so i was
> trying to take that and make it work for a signle.

Howtos are nice, but having an understanding on how things work should 
be priority.  Otherwise you end up with configuration that you have no 
idea what it is doing.  And that is a very bad thing, especially when 
building an firewall.

-- 
Aleksandar Milivojevic <amilivojevic@pbl.ca>    Pollard Banknote Limited
Systems Administrator                           1499 Buffalo Place
Tel: (204) 474-2323 ext 276                     Winnipeg, MB  R3T 1L7


       reply	other threads:[~2004-09-28 15:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <41596898.178.36a5.6993354@arbbs.net>
2004-09-28 15:17 ` Aleksandar Milivojevic [this message]
     [not found] <20040928051024.692C0BE3@sterenborg.info>
2004-09-28 12:04 ` ip alias John Black
2004-09-28 13:51   ` Jason Opperisano
2004-09-28 14:27   ` Jose Maria Lopez
2004-09-28  3:15 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
  -- 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=41598079.2020000@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.