Linux Netfilter discussions
 help / color / mirror / Atom feed
* Setup simple PC-based router using IPTABLES
@ 2005-01-12  8:53 Lim Boon Ping
  2005-01-12  9:09 ` Ming-Ching Tiew
  2005-01-12  9:10 ` Jacob Mathew
  0 siblings, 2 replies; 3+ messages in thread
From: Lim Boon Ping @ 2005-01-12  8:53 UTC (permalink / raw)
  To: netfilter

Hi,
 
I need some help on using IPTABLES to setup a simple PC-based router (for LAN usage).
The PC consists of  a 10/100 NIC on eth0, and a gigabit fiber NIC on eth1. The gigabit fiber NIC is connected to another fiber-based port, whereas the 10/100 NIC is connected to a 10/100 hub. Now, for all packets coming from eth0, forward it to eth1, and vice versa. 
Could anyone verify/suggest commands to set for this setting?
# iptables -A FORWARD -i eth0 -o eth1 
# iptables -A FORWARD -i eth1 -o eth0 
 
Is it that's all we need to do? Thanks.
 
Regards,
Jocelyn

		
---------------------------------
Do you Yahoo!?
 Read only the mail you want - Yahoo! Mail SpamGuard.

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

* Re: Setup simple PC-based router using IPTABLES
  2005-01-12  8:53 Setup simple PC-based router using IPTABLES Lim Boon Ping
@ 2005-01-12  9:09 ` Ming-Ching Tiew
  2005-01-12  9:10 ` Jacob Mathew
  1 sibling, 0 replies; 3+ messages in thread
From: Ming-Ching Tiew @ 2005-01-12  9:09 UTC (permalink / raw)
  To: netfilter

From: "Lim Boon Ping" <syseeker@yahoo.com>
>
> Could anyone verify/suggest commands to set for this setting?
> # iptables -A FORWARD -i eth0 -o eth1 
> # iptables -A FORWARD -i eth1 -o eth0 
>  
> Is it that's all we need to do? Thanks.

iptables is not even needed. 

Just

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

Will do.








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

* Re: Setup simple PC-based router using IPTABLES
  2005-01-12  8:53 Setup simple PC-based router using IPTABLES Lim Boon Ping
  2005-01-12  9:09 ` Ming-Ching Tiew
@ 2005-01-12  9:10 ` Jacob Mathew
  1 sibling, 0 replies; 3+ messages in thread
From: Jacob Mathew @ 2005-01-12  9:10 UTC (permalink / raw)
  To: Lim Boon Ping; +Cc: netfilter

#Allow all connections OUT and only existing and related ones IN"
iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j 
ACCEPT
iptables -A FORWARD -i eth1 -o eth1 -j ACCEPT

# Enable SNAT (MASQUERADE) functionality on eth0"
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

in this scenario eth0 is external and eth1 is internal

regds
Jacob

----- Original Message ----- 
From: "Lim Boon Ping" <syseeker@yahoo.com>
To: <netfilter@lists.netfilter.org>
Sent: Wednesday, January 12, 2005 2:23 PM
Subject: Setup simple PC-based router using IPTABLES


> Hi,
>
> I need some help on using IPTABLES to setup a simple PC-based router (for 
> LAN usage).
> The PC consists of  a 10/100 NIC on eth0, and a gigabit fiber NIC on eth1. 
> The gigabit fiber NIC is connected to another fiber-based port, whereas 
> the 10/100 NIC is connected to a 10/100 hub. Now, for all packets coming 
> from eth0, forward it to eth1, and vice versa.
> Could anyone verify/suggest commands to set for this setting?
> # iptables -A FORWARD -i eth0 -o eth1
> # iptables -A FORWARD -i eth1 -o eth0
>
> Is it that's all we need to do? Thanks.
>
> Regards,
> Jocelyn
>
>
> ---------------------------------
> Do you Yahoo!?
> Read only the mail you want - Yahoo! Mail SpamGuard.
>
> 



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

end of thread, other threads:[~2005-01-12  9:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-12  8:53 Setup simple PC-based router using IPTABLES Lim Boon Ping
2005-01-12  9:09 ` Ming-Ching Tiew
2005-01-12  9:10 ` Jacob Mathew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox