linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Richard Nairn" <Richard@nairnconsulting.ca>
To: "Kirkwood, David A." <DAVID.A.KIRKWOOD@saic.com>,
	linux-admin@vger.kernel.org
Subject: Re: Linux system as a router
Date: Tue, 07 Apr 2009 14:35:33 -0600	[thread overview]
Message-ID: <op.ur095jnoizdgzp@w5-cal-h014058.nrn.nrcan.gc.ca> (raw)
In-Reply-To: <2E9F9B9B52306D4DB3DEE15E678BDE61011EE61A@0668-ITS-EXMP02.us.saic.com>

If you are doing NATting at the router you need a rule such as 
iptables -t nat -I POSTROUTING -o eth0 -j MASQ if you have a dynamic address, or
iptables -t nat -I POSTROUTING -o eth0 -j SNAT --to-source 1.2.3.4 if you have a static address

you also need net.ipv4.ip_forward=1 in /etc/sysctl.conf

Then have your default route go out your WAN interface.

On Tue, 07 Apr 2009 14:13:18 -0600, Kirkwood, David A. <DAVID.A.KIRKWOOD@saic.com> wrote:

> How do I set up iptables to make the linux system function as a router?
> I think I need to set forwarding between the two interfaces, but I don't
> understand the syntax of the command.
>
> Thanks,
>
> David A. Kirkwood
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-04-07 20:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-07 20:13 Linux system as a router Kirkwood, David A.
2009-04-07 20:35 ` Richard Nairn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-04-07 20:33 Uwe Kiewel

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=op.ur095jnoizdgzp@w5-cal-h014058.nrn.nrcan.gc.ca \
    --to=richard@nairnconsulting.ca \
    --cc=DAVID.A.KIRKWOOD@saic.com \
    --cc=linux-admin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).