LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-02-2012, 11:13 AM   #1
open.controller
LQ Newbie
 
Registered: Aug 2012
Posts: 2

Rep: Reputation: Disabled
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.
 
Old 08-02-2012, 04:03 PM   #2
rigor
Member
 
Registered: Sep 2003
Location: 19th moon ................. ................Planet Covid ................Another Galaxy;............. ................Not Yours
Posts: 705

Rep: Reputation: Disabled
After you have your routes set up, please run this command, and post the output:

Code:
netstat -r
 
Old 08-03-2012, 02:46 AM   #3
dualarrow
LQ Newbie
 
Registered: Jul 2012
Posts: 5

Rep: Reputation: Disabled
Is forwarding turned on

you may want to check if you have forwarding on with

sysctl net.ipv4.conf.all.forwarding

you should get a 1 back if its on. if not, you could try

sysctl net.ipv4.conf.all.forwarding=1

then test again and see if its working

Andrew
 
Old 08-03-2012, 08:27 AM   #4
open.controller
LQ Newbie
 
Registered: Aug 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi all,
I was missing allowing ip forwarding in my setup. I followed this http://www.revsys.com/writings/quicktips/nat.html and it worked fine.
Cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Generate Traffic with only one machine - what's wrong with my routing solution? PurpleRain Linux - Networking 1 05-05-2009 03:00 AM
routing? one machine talks to another but not vice versa bigearsbilly Linux - Networking 4 08-01-2008 05:17 AM
Routing Problem on Multihomed Machine rlh989 Linux - Networking 1 06-21-2006 10:33 PM
Routing - no path for one machine, OK for another loggy Linux - Networking 1 05-24-2004 05:23 PM
Multi-Service Machine Including Routing a Good Idea?? Breezwell Linux - Networking 2 11-10-2001 10:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration