LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-17-2008, 12:38 PM   #1
sergiomc
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Rep: Reputation: 0
Talking Know how to route


Hello everybody.
I am new user from the forums, I'm from peru.
I have a problem I hope you may help me.

I don't understand very well how the route tables (route command add, del etc) works.

This is the scenario:

eth0: ip 10.200.0.x / subnet 255.255.255.0 / gateway 10.200.0.2
eth1: ip 192.168.0.x / subnet 255.255.255.0 / gateway 192.168.0.2

What I want is that when I make a
ping 10.200.0.16 for example, it returns an answers of connection.
and the same with 192.168.0.50 for example

but now, I do the 2 commands above, and only returns answers on the net 192. The ping to 10.xxxx. returns bad.

The route table is the original, i didn't modify any because i didn't know how it works.

But i tried a little things i found on the web.

I tried route add -net 10.200.0.0 -subnet 255.255.255.0 -gw 10.200.0.2 dev eth0

I assummed that: all the requests from net 10.200.xxx and "ping" to 10.200.xxx will go though the gw 10.200.0.2
But, I assumed bad, because it didn't work.

So what am i missing ??

Thanks for your time and help.

sergiomc

PS: Sorry for my poor english, i speak spanish.
 
Old 08-17-2008, 02:00 PM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
You don't need to add another route - the correct routes are established for the attached network when you bring the interface up.

You need to enable tcp routing on the system:

cat /proc/sys/net/ipv4/ip_forward

if 0, it needs to be 1:

echo 1 > /proc/sys/net/ipv4/ip_forward

If you have iptables enabled, you may need to make changes. The easiest way to get routing to work is to first disable all firewalls, make routing work, and then reable firewalls adding the correct rules.

For ping to work, ensure each system has not disabled ICMP ping:

cat /proc/sys/net/ipv4/icmp_echo_ignore_all

should be 0. If 1, set to 0 using a similar echo command as above.

If you still have trouble, should output of:

route -n
ifconfig -a
cat /proc/sys/net/ipv4/icmp_echo_ignore_all
cat /proc/sys/net/ipv4/ip_forward
 
Old 08-17-2008, 09:25 PM   #3
sergiomc
LQ Newbie
 
Registered: Aug 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for your answer Mr. C.
I will try
echo 1 > /proc/sys/net/ipv4/ip_forward

I think I didn't do it in the tests.

iptables is not enabled in the server and in the client pc (windows), firewall is disabled.

I'll do the tests and let you know if any happens.

Thanks.

sergiomc
 
  


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
iproute2 (ip route), pppoe and default route lorddoskias Linux - Networking 0 05-09-2007 11:04 AM
Default route took 20s to display with 'route' command Akhran Linux - Newbie 3 11-04-2006 04:59 AM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM
ADSL as a Alternate route or backup route bhagat2000 Linux - Networking 0 05-27-2004 03:17 PM
Working with 'route' and unwanted route entries pioniere Linux - Networking 6 02-05-2003 12:14 PM

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

All times are GMT -5. The time now is 03:04 PM.

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