setting up a linux pc as a router

please tell me the steps to make linux system as a router..

i have two networks and i want to setup a linux router so that both network can communicate with each other.i have a system with 2 nic's in the network .
i am just confused what ip's to give to the 2 NICs on the router system.

now please tell me the steps.and how to make the routes permanent.
Who is Participating?

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

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.

I've done the same thing before using the following guide:

Worked like a charm!

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
A little more info would make this easier, such as what subnet masks you need to use?

If you are you trying to use two class C subnets such as and, you'll have to assign to have an IP address of to eth1 and alias to eth1/1.

Then, each client host on the subnet would use as its gateway and each client host on the subnet would use as its gateway respectively.

Personally, I would use two Class B subnets such as and and the client hosts on both subnets would use the eth1 gateway device on the Linux router; Granted everything is actually on a single subnet of 65535 hosts, but at least no aliasing of eth1 would be necessary

Also, IP forwarding should be setup on the linux router /etc/sysconfig/network FORWARD_IPV4="1" to load the default route at boot time.


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
Operating Systems

From novice to tech pro — start learning today.