LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-26-2007, 10:04 AM   #1
lrt
Member
 
Registered: Sep 2007
Location: Chattanooga, TN
Distribution: Ubuntu
Posts: 84

Rep: Reputation: 15
iptables forwarding


i need to know how i can forward all internet traffic from eth0 to eth1 (two nics on the same machine) using iptables. eth0 is connected to my router (internet connection) and eth1 is connected to a switch. eth1 will act as a gateway for my dhcp clients.

i'm not very familiar with iptables, but i know this can be done fairly easily. could someone show me how? thanks
 
Old 11-26-2007, 12:21 PM   #2
curtisa
Member
 
Registered: Oct 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 33

Rep: Reputation: 16
Hi,
I had the same question / setup.
Try 'firestarter' from fs-security (google 'firestarter').
It worked fine for me when I couldn't figure out how to set this up by manually editing IP tables.
Rgds,
Alex
 
Old 11-26-2007, 12:59 PM   #3
lrt
Member
 
Registered: Sep 2007
Location: Chattanooga, TN
Distribution: Ubuntu
Posts: 84

Original Poster
Rep: Reputation: 15
i would hate to install some software i don't really know much about just to get this to work. but then again, i really don't know much about iptables either. eventually i want to sit down and learn iptables but at the moment i am being bombarded with other projects. thats why i was hoping someone would just show me how to set up this simple rule with iptables.

i will take a look at firestarter it looks user friendly, thanks for your help.

if anyone else could show me how to set this up with iptables i would greatly appreciate it. thanks!
 
Old 11-28-2007, 12:21 AM   #4
pingu_penguin
Member
 
Registered: Aug 2004
Posts: 50

Rep: Reputation: 15
give these commands a try ..

#echo '1' > /proc/sys/net/ipv4/ip_forward
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
#iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
#iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
 
Old 11-29-2007, 08:01 AM   #5
lrt
Member
 
Registered: Sep 2007
Location: Chattanooga, TN
Distribution: Ubuntu
Posts: 84

Original Poster
Rep: Reputation: 15
thanks pingu_penguin. i'll try that out. unfortunately i'm in the middle of another "IT emergency" right now so i'm currently busy with something else. i will post with results as soon as i get the chance.
 
Old 12-05-2007, 09:17 AM   #6
lrt
Member
 
Registered: Sep 2007
Location: Chattanooga, TN
Distribution: Ubuntu
Posts: 84

Original Poster
Rep: Reputation: 15
ok after a lot of trial and error, i figured out i really don't need iptables rules. all i needed was the first line that pingu_penguin provided:

Code:
echo '1' > /proc/sys/net/ipv4/ip_forward
and of course a correct configuration of dhcpd.conf since my clients are dhcp clients.

btw, i am running ubuntu 7.10

thanks for everyone's help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables / forwarding help sir-lancealot Linux - Networking 2 08-01-2007 08:50 AM
IPTABLES and Forwarding metallica1973 Linux - Networking 3 04-24-2007 05:22 PM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
help with iptables and forwarding laclac01 Linux - Networking 1 10-23-2005 07:16 AM
iptables forwarding... AnalyticaL Linux - Networking 5 09-28-2004 08:55 AM


All times are GMT -5. The time now is 02:37 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration