LinuxQuestions.org
Help answer threads with 0 replies.
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 04-17-2002, 04:19 AM   #1
Trunks
LQ Newbie
 
Registered: Feb 2001
Posts: 11

Rep: Reputation: 0
Question Routing Problem ???


Hello,

Recently i am trying to set up my Linux box as a router. It has two NICs which are working fine(to ping itself alive).

The first "eth0" has a static address of 202.x.180.72 which connects to my Switch then Intel router. The second "eth1" has a static address of 192.168.10.1 which is connected to a hub and consequently my internal network.

From the linux box router, I can ping the outside network througt out eth0, so i think the default gateway 202.x.180.65 setting is correct. However, I cannot get to the internet from the 192.168.10.0 net nor ping 202.x.180.0 (destination net unreachable), furthermore, i found that eth0 & eth1 can't even ping each other inside the linux box. I thought I had set up ip packet forwarding correctly (i did already "echo 1 > /proc/sys/net/ipv4/ip_forward"), but apparently not.

I think i am getting something wrong or some missing in the "route add" syntax.

Any help or suggestion would be appreciated!!


----------------------------------------
INTERNET
----------------------------------------
|
ROUTER 202.x.180.65
|
|
SWITCH
|
|
---------------------------------------
eth0:202.x.180.72
|
Linux Router
eth1:192.168.10.1
--------------------------------------
|
|
192.168.10.0 Network
 
Old 04-17-2002, 04:28 AM   #2
Trunks
LQ Newbie
 
Registered: Feb 2001
Posts: 11

Original Poster
Rep: Reputation: 0
Some more info about the kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
202. x.180.72 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
255.255.255.255 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
202. x.180.64 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
192.168.10.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
192.168.10.0 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
202. x.180.64 202. x.180.65 255.255.255.192 UG 0 0 0 eth0
202. x.180.64 0.0.0.0 255.255.255.192 U 0 0 0 eth0
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 202. x.160.65 0.0.0.0 UG 0 0 0 et0

Last edited by Trunks; 04-17-2002 at 04:30 AM.
 
Old 04-17-2002, 04:29 AM   #3
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Have you set the default gateway on the machines in the 192.168.10.0 network to 192.168.10.1?

The linux router seems to be configured fine
 
Old 04-17-2002, 04:34 AM   #4
Trunks
LQ Newbie
 
Registered: Feb 2001
Posts: 11

Original Poster
Rep: Reputation: 0
Actually, NO..... would you show me how??
 
Old 04-17-2002, 04:40 AM   #5
Trunks
LQ Newbie
 
Registered: Feb 2001
Posts: 11

Original Poster
Rep: Reputation: 0
I just try the following:

route add -net 192.168.10.0 netmask 255.255.255.0 gw 192.168.10.1 dev eth1


but eth0:202.x.180.72 still cannot ping eth1???!!


any help?
 
Old 04-17-2002, 04:49 AM   #6
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
route add default gateway 192.168.10.1

Everything that doesn't have a specific destination that the local machine knows about will then get sent on to 192.168.10.1. The linux router in turn has a default gateway to reach the internet so the traffic will get sent onwards toward the internet.
 
Old 04-17-2002, 05:10 AM   #7
Trunks
LQ Newbie
 
Registered: Feb 2001
Posts: 11

Original Poster
Rep: Reputation: 0
no luck !!?

When i try to "ping 192.168.10.1 -I eth0", then the screen comes up>>
PING 192.168.10.1 (192.168.10.1) from 202.x.160.72 eth0: 56(84) bytes of data.
and stop response until i press <CTRL+C>.

current routing table:
202. x.180.72 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
255.255.255.255 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
202. x.180.64 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
192.168.10.1 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
192.168.10.0 0.0.0.0 255.255.255.255 UH 0 0 0 eth1
202. x.180.64 202. x.180.65 255.255.255.192 UG 0 0 0 eth0
202. x.180.64 0.0.0.0 255.255.255.192 U 0 0 0 eth0
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.10.1 0.0.0.0 UG 0 0 0 eth1
0.0.0.0 202. x.180.65 0.0.0.0 UG 0 0 0 eth0
 
Old 04-17-2002, 06:05 AM   #8
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Don't add the default gateway on the linux router. You already have the default gateway going to the external interface. Set that default gateway on each of the client machines on the 192.168.10.0 network.

Something like this:

Linux router
eth0 IP: 202.x.180.72
eth1 IP: 192.168.10.1
default gateway: 202.x.180.65

Client machine
eth0 IP: 192.168.10.3
default gateway: 192.168.10.1
 
Old 04-17-2002, 12:34 PM   #9
Trunks
LQ Newbie
 
Registered: Feb 2001
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for the info, i'll give it a trial when i back to the office.

Regards,
Trunks
 
  


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
routing problem DRagonRage Debian 8 09-21-2005 03:29 PM
routing problem DRagonRage Linux - Networking 1 09-21-2005 01:02 PM
Routing problem Infernal211283 Linux - Networking 3 02-28-2005 02:59 AM
Another Routing problem Bambi Linux - Networking 2 06-03-2004 03:13 PM
routing problem nowonmai Linux - Networking 2 10-09-2003 07:59 AM

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

All times are GMT -5. The time now is 12:39 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