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 02-19-2005, 03:24 AM   #1
gtop
LQ Newbie
 
Registered: Feb 2005
Posts: 5

Rep: Reputation: 0
kernel 2.6.3 ping -I <interface> fails


On an embedded system running 2.6.3 when I try "ping -I eth0 10.10.52.154" I get the following error message:
bad interface address 'eth0'

When I try it on my PC running kernel version 2.4 it works.

I have tried "ping -I 10.10.5.141 10.10.52.154" which works but it doesn't say its from 10.10.52.141 as in 2.4 on my PC. I need to run ping with -I interface option in the application I am working on.

Has something changed in the kernel?

Thanks.
 
Old 02-19-2005, 07:20 AM   #2
gtop
LQ Newbie
 
Registered: Feb 2005
Posts: 5

Original Poster
Rep: Reputation: 0
I forgot to mention that the eth0 interface does exist based on the ifconfig command results:

sh-2.03# ifconfig
eth0 Link encap:Ethernet HWaddr 0E:00:00:EA:18:34
inet addr:10.10.52.141 Bcast:10.10.52.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:223729 errors:0 dropped:0 overruns:0 frame:0
TX packets:11105 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:57784916 (55.1 Mb) TX bytes:1120986 (1.0 Mb)
Interrupt:44 Base address:0x1000 DMA chan:8

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:429224 errors:0 dropped:0 overruns:0 frame:0
TX packets:429224 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:29354670 (27.9 Mb) TX bytes:29354670 (27.9 Mb)
 
Old 02-19-2005, 11:43 AM   #3
rclancy
LQ Newbie
 
Registered: Feb 2005
Location: Vancouver, Canada
Distribution: Slackware 10.1
Posts: 9

Rep: Reputation: 0
I am running Slackware 2.6.10 on each of two computers behind a gateway. I can tell you that they both behave normally in the respect you mention; and so, below you will find my 'ping -I' output from one machine to the other, for your reference:

root@SILENUS:/home/rclancy# ping -I eth0 192.168.1.101
PING 192.168.1.101 (192.168.1.101) from 192.168.1.101 eth0: 56(84) bytes of data.
64 bytes from 192.168.1.101: icmp_seq=1 ttl=64 time=0.059 ms
64 bytes from 192.168.1.101: icmp_seq=2 ttl=64 time=0.053 ms
64 bytes from 192.168.1.101: icmp_seq=3 ttl=64 time=0.053 ms

--- 192.168.1.101 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 0.053/0.055/0.059/0.003 ms

The outupt of your 'ifconfig' looks normal to me, but one wonders if there is a bad interface address on eth0.

If your two IP addresses represent network makchines to which you have access, try 'tcpdump -v' in one machine and then ping it from the other to see if 'tcpdump' is recording the traffic you know to be there.

Since 'ping' is a routing diagnosis tool, examine your output for 'route.' Here is my output for comparison:

root@SILENUS:/home/rclancy# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

If you still have your .config file from 2.4 you might compare your card settings there with the one you have in your 2.6 .config Also check 'demesg' | less' to see how the card is initialising compared with 2.4.

I hope this gets you started, and if you post your output to the above, then someone who knows something might be able to help.

Bye,
 
Old 02-20-2005, 06:35 AM   #4
gtop
LQ Newbie
 
Registered: Feb 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the response. I'm starting to suspect our kernel
which is built and modified by another group in the
company. Below is the result from the route command. ping
does work when I don't use the -I option. Does anybody
know where the ping command is processed in the kernel
source? I have a copy of it. The tcpdump -v command works
and outputs the ping packets when I do the ping. I won't put
its spewage since it is so long.

Thanks for the help!


sh-2.03# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.52.0 * 255.255.255.0 U 0 0 0 eth0
default gw-10-10-52.ger 0.0.0.0 UG 0 0 0 eth0
s
 
Old 02-20-2005, 11:25 AM   #5
rclancy
LQ Newbie
 
Registered: Feb 2005
Location: Vancouver, Canada
Distribution: Slackware 10.1
Posts: 9

Rep: Reputation: 0
The output of your 'route' command is not normal, for it lacks a line indicating "localhost." See my output for 'route' above. There should be a middle line which looks like this:

loopback * 255.0.0.0 U 0 0 0 lo

"loopback" reflects that a machine also communicates with itself, even if not on a network, and should have a default IP address of 127.0.0.1 and a verbal designation of "localhost." All machines have this loopback address.

SUGGESTIONS

1) Read Linux Networking-HOWTO at http://www.tldp.org/HOWTO/NET3-4-HOWTO-5.html for your own spiritual edification.

2) To re-establish your loopback interface run the following commands:

root# ifconfig lo 127.0.0.1
root# route add -host 127.0.0.1 lo

3) Run 'route' again to observe the resulting output.

4) Check /etc/networks. It should look like this:

#
# networks This file describes a number of netname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
#

loopback 127.0.0.0
localnet 127.0.0.0

'/etc/networks' must show these values if your loopback interface is to be re-established at boot time.

# End of networks.

5) Also check /etc/hosts. It should look something like the following, where the 'loopbacking' line is the one of relevance here:

# For loopbacking.
127.0.0.1 localhost
#
192.168.1.101 SILENUS.home.net SILENUS
192.168.1.102 JUNO.home.net JUNO
#
# End of hosts.

I do not know if the above will be sufficient to fix your problem, for there may be more than one thing wrong.

I too upgraded from 2.4 to 2.6, but this part of an overall upgrade in the entire Slackware package. As a result, there were also many configuration file replacements which could be handled with a script, but data had to be transferred from the old to the new configuration files by hand. If you upgraded your package along with the kernel, then perhaps your problem is accounted for by configuration file changes. You might consider identifying your LINUX distribution and number with your account. Some of the configuration files differ in file name and path with various Linux distributions.

Bye,

Last edited by rclancy; 02-20-2005 at 11:58 AM.
 
Old 02-20-2005, 03:18 PM   #6
gtop
LQ Newbie
 
Registered: Feb 2005
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for the input.

I tried the ifconfig and route commands but I still get the same
error message:
bad interface address 'eth0'

I did find something interesting when doing dmesg. I have the
following in the list of messages:
eth0: SMC91C11xFD (rev 1) at 0xc4851000 IRQ 44 DMA8 @ 15800000 32bit bus [nowait]
eth0: Invalid ethernet MAC address. Please set using ifconfig

Could a bad MAC address be causing the problem? It's
0E:00:00:EA:18:34 according to the ifconfig command. Is this
really a "bad" MAC address or is it normal to had a bad MAC
address until all is initialized? I don't want to change it until I
know what it should be.

I've started reading the Networking-HOWTO...
 
Old 02-21-2005, 12:34 AM   #7
rclancy
LQ Newbie
 
Registered: Feb 2005
Location: Vancouver, Canada
Distribution: Slackware 10.1
Posts: 9

Rep: Reputation: 0
So when you reconfigured the 'localhost' with:

root# ifconfig lo 127.0.0.1
root# route add -host 127.0.0.1 lo

what happened? Did the 'route' comand THEN show a normal output? And what about the files I mentioned? What is their content?

I should say at the outset, that I do not have the knowledge to know what your "dmesg" output concerning the MAC address means exactly, but the hardware address cannot be modified with 'ifconfig.' As far as I know, changing a hardware address is very unusual.

With this in mind, I suggest running down the obvious things first, assuming an interface problem on your local machine, for the time being at least. As you said, your system was working fine before the upgrade so assume it works now at the hardware level, until all else is exhausted.

Also, your 'ifconfig' output shows a normally running system. The first line identifies the eth0 MAC address and it confirms that your driver is connected to the card and can read the address which is built into the memory of the card.

I suggest continuing to test configuration as follows:

1) Let us know about the results of the last posting, 'route' output, file contents such as /etc/networks -- etc.

2) Find out how the IP address was assigned (by a router? administrator?). Once you are sure it is the right IP address, then you can try:

root# ifconfig eth0 10.10.52.141

[assuming this IP address is correct for your machine, or substitute the right one.] It looks like a consistent network with an IP of 10.10.52.0 But problems with interface showing the wrong IP address, broadcast address or subnet mask can be fixed with this command. It is the network equivalent of the 'localhost' commands you have tried. You can satisfy yourself about it in the HOWTO. If this fixes your problem, it will only last until you reboot, unless you place it in the appropriate config file for your distribution.

If the above fails, review the compile options built into the kernel. The options are different in 2.6 compared with 2.4, and so might be the drivers. You would approach investigation by

a) getting data on the specification of your card. You can run this command:

root# lspci -v | less

For example, you can expect something like the following in the part of the output that concerns your ethernet card. For your comparison, here is what I see in my own output, for my ethernet card.

02:0a.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 74)
Subsystem: 3Com Corporation 3C905C-TX Fast Etherlink for PC Management NIC
Flags: bus master, medium devsel, latency 32, IRQ 22
I/O ports at dc00 [size=128]
Memory at ff9ffc00 (32-bit, non-prefetchable) [size=128]
Expansion ROM at ff9c0000 [disabled] [size=128K]
Capabilities: [dc] Power Management version 2

b) take your own specs and compare then with your 2.6.x .config file:

root: /usr/src/llinux-distributon# make menuconfig (or make xconfig)

Go to "Divice Drivers > Networking support >

Find your driver and look at the settings.

Bye,
 
Old 02-21-2005, 10:42 AM   #8
gtop
LQ Newbie
 
Registered: Feb 2005
Posts: 5

Original Poster
Rep: Reputation: 0
I want to preface this post with the fact that I am working
with an embedded system with a company configured
release of 2.6.3. Some things that work on PC versions of Linux do not apply to this system. I don't know what the distribution is but I am trying to find out from the kernel "maker".

Results after doing #2 in post #5 above, I also installed my fpga ethernet driver (fpeth0) which can be seen below.

sh-2.03# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
localhost * 255.255.255.255 UH 0 0 0 lo
1.2.3.0 * 255.255.255.0 U 0 0 0 fpeth0
10.10.52.0 * 255.255.255.0 U 0 0 0 eth0
default gw-10-10-52.ger 0.0.0.0 UG 0 0 0 eth0

There is no /etc/networks file on my embedded system.
/etc/hosts has:
sh-2.03# more hosts
127.0.0.1 localhost loopback

There is a /etc/network directory which contains:
sh-2.03# pwd
/etc/network
sh-2.03# ls -alg
drwxr-xr-x 6 root root 0 Oct 2 2002 .
drwxrwxr-x 24 root root 0 Jan 1 01:00 ..
drwxr-xr-x 2 root root 0 Oct 2 2002 if-down.d
drwxr-xr-x 2 root root 0 Oct 1 2002 if-post-down.d
drwxr-xr-x 2 root root 0 Oct 1 2002 if-pre-up.d
drwxr-xr-x 2 root root 0 Mar 15 2004 if-up.d
lrwxrwxrwx 1 root root 16 Oct 25 2004 ifstate -> /var/run/ifstate
lrwxrwxrwx 1 root root 15 Oct 25 2004 interfaces -> /tmp/interfaces
-rw-r--r-- 1 root root 338 Feb 18 2004 interfaces.org
-rw-r--r-- 1 root root 44 Oct 2 2002 options

I'm not sure what is important in /etc/network directory and what uses it. Anybody know?

In reference to #2 in post #7 above the ifconfig eth0 10.10.52.141 did not make any difference with respect to the ping -I command. I am pursuing the person who configured the kernel that is programmed in flash on the embedded system.

In reference to #2a in post #7 the lspci command does not work on my embedded system. It looks like a PC specific command that works with PCI network cards.

In reference to #2b in post #7, I am looking at the configuration file and also having the kernel "maker" investigate this. It sounds like a good possibility but since it is not a PC kernel version a lot is probably not known about it.

Thanks for the help!
 
Old 02-21-2005, 06:11 PM   #9
rclancy
LQ Newbie
 
Registered: Feb 2005
Location: Vancouver, Canada
Distribution: Slackware 10.1
Posts: 9

Rep: Reputation: 0
So now 'route' shows you have at least configured 'localhost.'

I know nothing of embedded systems or their limitations. However, here again is an example of what a normal /etc/hosts should look like on a network if you want to try it out. Make a copy of the original first. Notice the additons to the file over and above what you have.

/etc/hosts
# For loopbacking.
127.0.0.1 localhost
#
10.10.52.141 YourHostName.whatever.??? YourHostName
10.10.52.154 AdifferentHostName.whatever.??? YourHostName
#
# End of hosts.

Thus you would
1) add your IP address
2) followed by your fully qualified domain name
3) followed by your host name.
4) for each host on the network

Run
# /etc/hostname
to get your host name (without FQDN)

Your hostname should also be in /etc/hostname which gives your system its hostname at boot time.

Your system may be Debian. If so, its /etc/hosts may be slightly different. Look for a sample of /etc/hosts in Debian on the web, if you find your system is Debian. It may be /etc/hosts should look like this:

10.10.52.141 YourHost Name YourHostName.whatever.??? YourHostName

You may have something on your system. Try a

# locate debian
or
# find / -name debian -print

It is your '/etc/network' which looks Debian. This directory would be for setting up and changing network interfaces, and they are foreign to me. You can search the web. For some reason, your system shows a symbolic link pointing to /tmp for the file /etc/interfaces.

Bye,

Last edited by rclancy; 02-21-2005 at 06:13 PM.
 
Old 02-21-2005, 06:41 PM   #10
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
I am not a real good tcpip expert but I could be wrong here. The very first thing that caught my eye in your second post is you are using 255.255.255.0. I believe the 10.0.0.0 is a class A address and should use subnet 255.0.0.0. If you wish to you a Class C use something in the range of 192.168.0.0 - 192.168.255.0

Brian1
" Google the Linux way @ http://www.google.com/linux "
 
  


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
ping on wrong interface despite route ocgltd Linux - Networking 1 09-26-2005 11:23 PM
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
Patching 2.6.6 kernel with swsusp2: fails with no /proc/swsusp interface sdo Fedora - Installation 0 07-12-2004 07:47 PM
Can't ping anywhere past the external interface! Ironica Linux - Networking 2 05-25-2004 04:57 PM
eth0 interface fails linuxbeak Linux - Newbie 5 02-24-2003 03:52 PM

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

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