Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Routing via a linux machine.

    I am a university student and very new to networking with linux. I am trying to do some routing via linux but am stuck at a point. I'll explain my problem in detail:

    I have an individual network with a single machine having IP Address Another machine (Gateway Machine (ubuntu 11.10 )) has two NICs: eth0 and eth1. eth1 ( is connected to the internal network machine and has no direct connection with the outside world. eth0 ( is connected to the external physical adapter.

    Now, I want to communicate with the external network machine having IP Address I have added the default gateway in the internal network machine as:

    $ route add default gw

    (The default gateway for the external network is I've also added the default gateway in the Gateway machine as:

    $ route add default gw to direct the traffic to the outside world.

    For the incoming traffic I've also included the network by using the route command:

    $ route add -net netmask gw

    The Gateway machine can also directly communicate with the external machine ( using iperf etc.

    Now the problem I am facing is that when I ping the external machine( through the internal network machine(; I'm able to see the packets destined for the external machine at the eth1 interface in Gateway Machine using wireshark.The internal network machine ( can also successfully ping and (eth0 IP).

    However the packets are unable to reach the eth0 interface. and as a consequence the internal network machine can not communicate with the outside network. I verified this using wireshark that the packets are being received on the eth1 interface which is configured as the default gateway for the internal machine ( As I have also added a default route in the gateway machine I expect the packets to reach out to the external network via eth0 but this doesnt happen and the packets dont reach the eth0 interface. Can Anyone please help me in this and point out if I am missing something? All help much appreciated.


  2. #2

  3. #3
    Hi Mizzle,
    Thanks for pointing to this. Turns out I needed to add some entries in the ip tables and also allow ip forwarding. It worked. Thanks alot.

  4. $spacer_open
  5. #4
    Linux Engineer
    Join Date
    Apr 2012
    Virginia, USA
    You're welcome. Glad that worked for you, it is something that I need to actually sit down and implement at some point, but haven't had the direct need to. Now I know where to find the good info, lol!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts