setting up a linux pc as a router

Posted on 2006-04-08
Last Modified: 2008-03-17
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.
Question by:swapan2005
    LVL 2

    Accepted Solution

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

    Worked like a charm!

    Assisted Solution

    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.


    LVL 7

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
    I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now