Find the answer to your Linux question:
Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By mizzle
Hi, 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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2012
    Posts
    2

    Routing via a linux machine.


    Hi,
    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 10.10.10.4. Another machine (Gateway Machine (ubuntu 11.10 )) has two NICs: eth0 and eth1. eth1 (10.10.10.10) is connected to the internal network machine and has no direct connection with the outside world. eth0 (192.168.1.171) is connected to the external physical adapter.

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

    $ route add default gw 10.10.10.10

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

    $ route add default gw 192.168.1.171 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 10.10.10.0 netmask 255.255.255.0 gw 10.10.10.10

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

    Now the problem I am facing is that when I ping the external machine(192.168.1.185) through the internal network machine(10.10.10.4); 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 (10.10.10.4) can also successfully ping 10.10.10.10 and 192.168.1.171 (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 (10.10.10.4). 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.

    Thanks.

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    881

  3. #3
    Just Joined!
    Join Date
    Aug 2012
    Posts
    2
    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. #4
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    881
    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
  •