-   Linux - Networking (
-   -   linux router setup... use iptables??? (

atuk1 02-05-2006 03:29 PM

linux router setup... use iptables???
Hi all,

Wonder if somebody can help me out a little here.
I'm trying to simulate two machines sitting on two different C class networks - being connected by a router (which in this case i want to be a linux router).

I want to be able to ping either network from each other.

so for eg

clientA: eth0

clientB: eth0

serverA: eth0 eth1

I've read around enough to know the answer lies in a iptables file/ setting - but i think i'm gonna have to get a good book on the iptables subject ...

Any help would be most appreciated.

thanks in advance - at.

Centinul 02-05-2006 04:11 PM

Well I believe IPTables is probably definitely what you would like to use in this case. There are two books that I know of out there.

Linux Firewalls - It is mainly geared towards firewalls but has a lot of information on IPTables as far as setting up multiple Class C networks behind one router.
Linux Routers - I have no read this so I really can't comment on it, but it has gotten good reviews from Amazon.

I hope this helps

Nathanael 02-05-2006 04:15 PM

1. google for 'iptables tutorial' will give you a very good book

2. clients: need a default route added to their routing table
route add default gw <gateway address> dev eth0

3. router: needs to have forwarding enabled:
echo 1 > /proc/sys/net/ipv4/ip_forward

if this still should not work, make sure iptables is not blocking any traffic at all (in none of the tables)
setting the policies to ACCEPT and Flushing all the tables will do the job, though i think you should be fine.
i gues you are not trying to setup NAT so the obove mentioned things sould be enough. once you get that part running, you can close down ports with iptables aso.
little hint: usually you set a router to be the hightes of you ip range (

hope this helps

All times are GMT -5. The time now is 12:10 PM.