linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux system as a router
@ 2009-04-07 20:13 Kirkwood, David A.
  2009-04-07 20:35 ` Richard Nairn
  0 siblings, 1 reply; 3+ messages in thread
From: Kirkwood, David A. @ 2009-04-07 20:13 UTC (permalink / raw)
  To: linux-admin

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Linux system as a router
@ 2009-04-07 20:33 Uwe Kiewel
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kiewel @ 2009-04-07 20:33 UTC (permalink / raw)
  To: linux-admin

Kirkwood, David A. 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.

echo "1" > /proc/sys/net/ipv4/ip_forward

Maybe you will need masqerading

HTH,
	Uwe


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Linux system as a router
  2009-04-07 20:13 Kirkwood, David A.
@ 2009-04-07 20:35 ` Richard Nairn
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Nairn @ 2009-04-07 20:35 UTC (permalink / raw)
  To: Kirkwood, David A., linux-admin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-07 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-07 20:33 Linux system as a router Uwe Kiewel
  -- strict thread matches above, loose matches on Subject: below --
2009-04-07 20:13 Kirkwood, David A.
2009-04-07 20:35 ` Richard Nairn

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 NNTP newsgroup(s).