which iptables command to run firefox behind a linux router?

Posted on 2006-04-09
Last Modified: 2013-11-29
one of my PC is a linux router. its name is 'rato'. the ip adress of the router are :,,,,,
on this router, 'route' give:
[root@rato etc]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 eth3   U     0      0        0 eth2   U     0      0        0 eth1   U     0      0        0 eth0   U     0      0        0 eth6         UG    0      0        0 eth0
on this router, 'iptables' give:
[root@rato etc]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
[root@rato etc]#
on the router 'rato', I can run firefox and acces to internet thru adsl thru the net
I would like to be able to access to internet thru firefox on any pc of the net
what are the iptables commands to be able to run firefox from any pc of the
for instance, I want to run firefox on the ? which iptable should I type on the router?

Question by:gdmo
    LVL 2

    Expert Comment

    How do you actually exit your network to reach the internet ?
    As all of your interfaces are (RFC1918), there is no internet connection.

    All the same check the config file:

    cd /etc/sysconfig/iptables
    LVL 2

    Expert Comment

    Actually I just noticed, your default gateway is !!!
    Then you will probably need to check that ip_forwarding is turned on and also check the file I mentioned above.
    Another thing will be routing back to your rato firewall, either on the router you will need to route the other subnets back or you will need to configure masquerading.

    Author Comment

    Yes, the gateway is a adsl modem-router. But, for some reasons, I want to use un linux router and not a adsl modem-router. The reasons are that I want to have separate subnets.
    As far as I know, to configure masquerading, I will need to configure iptables on the 'rato' router. As I have not yet used iptables, I have not yet well understood iptables. I would like than somebody say which command iptables are to be used.
    LVL 2

    Expert Comment

    check out this link:

    you will need to work out exactly what you want to do with the traffic and then apply it into a file.
    If you want further information explain in detail what you want to achieve eg: source destination traffic flows, who sees who, etc..

    Author Comment

    I know exactly the result that I expect to obtain. But, unfortunately, I do not know the iptables commands I must write to obtain what I want.  I just want that a pc under linux whom ip adress is could acces web by firefox.
    LVL 2

    Accepted Solution

    You don't actually need to run iptables for you to browse the internet.
    1. turn on ip_forwarding
    2. set routes on your adsl router for subnets (,,,, via

    All your traffic will go through RATO as it now acts as a router.

    If you wish to setup iptables fIrewall, then I suggest you have a good read of the link above.

    For a quick fix you can check out this sample iptables file and modify as required:

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
    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…

    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

    16 Experts available now in Live!

    Get 1:1 Help Now