how to configure my router on linux?

I use centos4.2(RHEL4.2). I want to configure a router on linux.
My pc-router has three ethernet cards. The ip adress of the three cards are:
192.168.1.4    to internet(net1)
192.168.2.4    to acces to the net 192.168.2.0/24(net2)
192.168.3.4    to acces to the net 192.168.3.0/24(net3)
I have also set ip_forward to 1.
What else must I configure to run my router?
I want that any pc on the net 192.168.2.0/24(net2) can ping, or ssh to any pc on the net 192.168.3.0/24(net3).
When I run 'route', what must I see for my router?
gdmoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bourneispCommented:
Hi gdmo,

the way i would do this would be by using iptables/ipchains.

give one of the interfaces a default gateway out to the internet.
your client machines should use the ip of your gateway linux router as their gateway
ie.

192.168.1.0/24 gw = 192.168.1.4
192.168.2.0/24 gw = 192.168.2.4
192.168.3.0/24 gw = 192.168.3.4

Then using iptables/ipchains set the outbounds rules you require.
firewalls built into linux can get quiete complex and you can create quite and advance firewall allow access based on source and destination interfaces, ports, source and destination ip etc....
Cheers!
gdmoAuthor Commented:
I  have done what you wrote above about the gateways.
in fact, I have more than three nets.  when I issue 'route' on my pc,  I get:
[root@rato etc]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.6.0     192.168.6.4     255.255.255.0   UG    0      0        0 eth3
192.168.5.0     192.168.5.4     255.255.255.0   UG    0      0        0 eth2
192.168.4.0     192.168.4.4     255.255.255.0   UG    0      0        0 eth1
192.168.3.0     192.168.3.4     255.255.255.0   UG    0      0        0 eth0
192.168.9.0     192.168.9.4     255.255.255.0   UG    0      0        0 eth6
0.0.0.0         192.168.3.3     0.0.0.0         UG    0      0        0 eth0

But I do not succeed that a pc from the net 192.168.3.0 ping another pc from the net 192.168.5.0.
You wrote that I should set "the outbounds rules that I require".  I have read the doc about iptables, but I have never yet used iptables. I am a newbie in networking. Which command should I do with iptables to ping? I want that any pc on the net 192.168.5.0/24(net5) can ping, or ssh to any pc on the net 192.168.9.0/24(net9).
bourneispCommented:
Hi gdmo

Do you have any firewalls set on any of these networks at the moment or the machines you are trying to connect to.

this looks to be quite a complex network and there could be many places that this could be failing.

Try doing a traceroute from a machine on the 192.168.3.0/24 to a machine on the 192.168.5.0.

Cheers

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.