how to configure my router on linux?

Posted on 2006-04-02
Last Modified: 2008-01-09
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:    to internet(net1)    to acces to the net    to acces to the net
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 can ping, or ssh to any pc on the net
When I run 'route', what must I see for my router?
Question by:gdmo
    LVL 2

    Expert Comment

    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. gw = gw = gw =

    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....

    Author Comment

    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   UG    0      0        0 eth3   UG    0      0        0 eth2   UG    0      0        0 eth1   UG    0      0        0 eth0   UG    0      0        0 eth6         UG    0      0        0 eth0

    But I do not succeed that a pc from the net ping another pc from the net
    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 can ping, or ssh to any pc on the net
    LVL 2

    Accepted Solution

    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 to a machine on the


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    732 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

    17 Experts available now in Live!

    Get 1:1 Help Now