LinuxQuestions.org
Review your favorite Linux distribution.
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 06-27-2005, 02:11 AM   #1
Z8002
LQ Newbie
 
Registered: Sep 2003
Location: Lancashire
Distribution: SuSe 9.0
Posts: 12

Rep: Reputation: 0
Why can I not ping two networks?


I can see that my last question was too vague, sorry.

If I have two etherenet cards; eth0 connects to a machine 192.168.0.2 and eth1 to 192.168.0.99, then why does the following happen?

ping 192.168.0.99 .............. reply

ping 192.168.0.2 .............. unreachable

ping -I eth0 192.168.0.2 ....... reply


How do I configure my network so that ping will try both by default, without my having to specify the interface to be pinged?


If anyone can help, I'll be grateful.
 
Old 06-27-2005, 02:41 AM   #2
mmmm
Member
 
Registered: Oct 2004
Location: Poland
Distribution: Slack 10.1, Mandrake 10.1
Posts: 118

Rep: Reputation: 15
Type : `netstat -r`
It lists route tables from kernel.
It sth like :
Destination Gateway Genmask Flags MSS Window irtt Iface
10.1.2.0 * 255.255.255.0 U 0 0 0 eth0
default ´my gateway´ 0.0.0.0 UG 0 0 0 eth0
What does it mean ? It says kernel :
1. If packet is to 10.1.2.* send it throw eth0
2. Else - send throw eth0
On you comp it should be :
192.168.0.99 * 255.255.255.0 U 0 0 0 eth1
192.168.0.2 * 255.255.255.0 U 0 0 0 eth0
It will say kernel the same, that you say by ´-l eth0´
If you cant configure it, I can help you, but you must post output of ´netstat -r´
 
Old 06-27-2005, 07:24 AM   #3
stefan_nicolau
Member
 
Registered: Jun 2005
Location: Canada
Distribution: Debian Etch/Sid, Ubuntu
Posts: 529

Rep: Reputation: 32
You have probably configured two overlaping networks, something like:
192.168.0.99/24 eth1
192.168.0.2/24 eth0

This means that anything in the 192.168.0.1-192.168.0.255 range is sent through eth1

post the output of 'ifconfig -a' and 'route' (route is the same as netstat -r)

Please use different logical networks for different physical networks:
192.168.0.0/24 eth0
192.168.1.0/24 eth1
 
Old 06-27-2005, 09:40 AM   #4
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
This is normal behaviour. You have just confused the poor machine. When you configure an address of 192.168.0.1 255.255.255.0 on an interface the OS will create a route 192.168.0.0 that points to the interface as a directly connected network. You now stick 192.168.0.99 255.255.255.0 on another interface, the OS will create another 192.168.0.0 route pointing out of that. When you attempt to send packets to 192.168.0.0 they match the first entry in the table and will never get as far as the second unless the first goes down.
 
Old 06-27-2005, 02:48 PM   #5
Z8002
LQ Newbie
 
Registered: Sep 2003
Location: Lancashire
Distribution: SuSe 9.0
Posts: 12

Original Poster
Rep: Reputation: 0
Thank you all for your help.

After reading your replies, I dug out a textbook and read up on ip addresses and sub networks.

I settled for a netmask of 255.255.255.224, to give me six networks from 192.168.0.x


I used addresses from the 192.168.0.32 network for eth0 and all the devices on my LAN,

I used addresses from the 192.168.0.160 network for eth1 and all the kit connecting to the ADSL modem.

Four spare networks left for future expansion..


Suddenly, everything started working. Most excellent.


I'm sure this seems pretty basic to you chaps, but no-one had ever told me what was required before and you've made me a very happy man.
 
Old 07-05-2005, 10:49 AM   #6
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Glad to be of assistance :-)
 
  


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
Strange Ping Issue - Can't ping localhost but can ping others on LAN code_slinger Linux - Networking 15 03-30-2015 02:39 PM
can't route/ping between networks ender03 Linux - Networking 21 02-01-2005 06:14 AM
PPP establish can ping the gateway router but unable to ping the host deepalalla Linux - Networking 0 11-18-2004 09:10 AM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 04:57 AM
I can ping google.com successfully,but ping client(in my intranet) failed.Why? whepin Linux - Newbie 4 12-30-2001 04:54 AM

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

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