Linux Routing

Posted on 2005-04-11
Last Modified: 2013-12-06

I would like to do the following with my Linux Fedora Core 2 server.
I have two NIC's one with a static IP on the Internet and an other that's connected to a hub with the local LAN.

I would like to redirect all the traffic that's indended for the fixed IP on two ports 9998 and 9999 to be send to an IP in the local LAN.

Is this possible?  If Yes how do I do it does anybody have a good tutorial or some software i have to install.  I'm gonna warn you I'm a new with Linux.

Question by:gregorydeceuninck
    1 Comment
    LVL 87

    Accepted Solution

    Yes, this is possible. I use shorewall to do this ( Actually all the necessary info is on that site or in the example files of the product. Look for the expression "Port forwarding". This would be inside the "rules" file and would look something like this:

    Action         source   dest                                           protocol    dest-port
    DNAT          net         loc:           tcp              9999

    You can do the same with iptables, and shorewall more or less configures iptables, but it is simpler to use shorewall to configure your firewall.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. Once you open the link you will see …
    The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
    After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    729 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

    19 Experts available now in Live!

    Get 1:1 Help Now