Skip to contentSkip to conversation

Problem with ping/telnet

DISCUSSION murali nagarajan 3 participants 6 messages Feb 5, 2002 – Feb 6, 2002

lore
Share & tools
lore
#0 lore raw

Hello,

We have a custom designed board G4 MPC7450 with GT64260 Galileo controller. We have been able to port the Linux on this board. But we do have some issues for which I will appreciate if some one could help me.

Implementation details:
-----------------------
We have used Mission Critical Linux 2.4.5-Pre 5 (derived from debian distro) and PPCBoot 1.0.4 as our base versions. I used the file system meant for NFS mount from the mission critical linux web site. We made necessary modifications to the software to work on our custom design.

I am able to boot Linux successfully with a NFS mounted file system and a Ramdisk (I could test upto 128MB size) based file system. But this was possible only when I bypassed the /sbin/init and run the "Bash" shell directly. I made changes to init/main.c to run the shell directly after successful opening of the /dev/console. Bypassing of /sbin/init at boot time is inevitable until we integrate a MPSC port based serial console driver with our linux system. We have a crude one (emulates the low level UART functions using MPSC) that just works.

We have the following difficulties:

                                   ----------

- PING command does not work
The erro message I get is "ping: unknown protocol icmp"

- Telnet program does not work which tells me that the service is unknown. The error message I get is "telnet: tcp/telnet: unknown service"

What can be the issue? I suspect if any of the boot script is not done. I ran manually /etc/init.d/rcS and /etc/rc3.d/* (my inittab says run level 3) from the bash prompt. This did not help to solve my above problem.

I assume that TCP/IP is fine because I have performed NFS mount of the root file system and can access all the files. The booted OS seems to be stable as I have run some complex Linux applications and also able to build new Linux images.

With best regards,
Murali

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#1 lore raw
Quoted 2 lines · murali nagarajan

- PING command does not work
The erro message I get is "ping: unknown protocol icmp"

Don't know. Might be a kernel compile issue or something, or it might be related to the second issue. Not sure.

Quoted 2 lines

- Telnet program does not work which tells me that the service is unknown. The error message I get is "telnet: tcp/telnet: unknown service"

This one's easy. Telnet explicitly asks the system for the default port number for telnet service. If you don't have a valid /etc/services file (with telnet listed), it won't be able to do so, and it will fail. If you specify a port number by hand (e.g. telnet foo.com 23), it should work. Or you can just put in an /etc/services file.

Later,
David

---------------------------------------------------------------------
Check out my weekly web comic:
http://www.techmagazine.org

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#2 lore raw

Hello David,

With your info, I am able to do a telnet from my board to the host, only if I specify the port number. What surprises me is that the presence of both /etc/services (entry to telnet is available with a port number) and the /etc/protocols files. For some reason, may be the boot process is unable to read these information. But when I want to do a telnet to my board from my host iMAc, I am unable to do. I get an error message "connection refused".

/proc file system is not mounted during the boot time and I mount it immediately after getting the "bash" prompt.

With PING still looking for some leads...(I can ping from the host to my taget board)

Any ideas?

Thanks,
Murali
-------------------------------------

Quoted 8 lines
Quoted 2 lines

- PING command does not work
The erro message I get is "ping: unknown protocol icmp"

Don't know. Might be a kernel compile issue or something, or it might be related to the second issue. Not sure.

Quoted 1 line

- Telnet program does not work which tells me that the service is

unknown.

Quoted 9 lines
Quoted 1 line

The error message I get is "telnet: tcp/telnet: unknown service"

This one's easy. Telnet explicitly asks the system for the default port number for telnet service. If you don't have a valid /etc/services file (with telnet listed), it won't be able to do so, and it will fail. If you specify a port number by hand (e.g. telnet foo.com 23), it should work. Or you can just put in an /etc/services file.

Quoted 3 lines

Later,
David

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#3 lore raw
Quoted 6 lines · murali nagarajan

With your info, I am able to do a telnet from my board to the host, only if I specify the port number. What surprises me is that the presence of both /etc/services (entry to telnet is available with a port number) and the /etc/protocols files. For some reason, may be the boot process is unable to read these information. But when I want to do a telnet to my board from my host iMAc, I am unable to do. I get an error message "connection refused".

This sounds vaguely familiar like I've run into it before, but I can't remember where.

The boot process doesn't read /etc/services. That's read on-the-fly by the telnet program itself with calls to either getservbyname or getservent, which are standard C library calls, and should always work if the service is listed and the files (and directory) are readable by the user that telnet is being run as.

You said this is an NFS root, right? Is it set to squash root permissions to nobody, by chance? If so, you might try turning that off. Just a vague notion.

Beyond that, I'm out of ideas. Maybe some of the folks who do daily embedded work could say more. I haven't done that in the better part of a year, and I'm a little rusty. :-)

Later,
David

---------------------------------------------------------------------
Check out my weekly web comic:
http://www.techmagazine.org

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#4 lore raw
Quoted 10 lines · David A. Gatwood
Quoted 6 lines · murali nagarajan

With your info, I am able to do a telnet from my board to the host, only if I specify the port number. What surprises me is that the presence of both /etc/services (entry to telnet is available with a port number) and the /etc/protocols files. For some reason, may be the boot process is unable to read these information. But when I want to do a telnet to my board from my host iMAc, I am unable to do. I get an error message "connection refused".

Quoted 8 lines

This sounds vaguely familiar like I've run into it before, but I can't remember where.

The boot process doesn't read /etc/services. That's read on-the-fly by the telnet program itself with calls to either getservbyname or getservent, which are standard C library calls, and should always work if the service is listed and the files (and directory) are readable by the user that telnet is being run as.

It sounds like you might be missing some of the glibc resolver libraries that allow programs to access the various databases (i.e., things like /etc/services and /etc/protocols.) In particular, I think you might be missing the /lib/libnss_files.so. There is a discussion of this somewhere in the glibc info pages as I recall. Also, your /etc/nsswitch.conf file is important for determining which source of information takes precedence (for instance, in the case of name resolution, do you use /ect/hosts first or a domain name server first).

Regards.

--
Jeff Kowing
[email protected]

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

#5 lore raw

Hello,

I have received many responses and here I am responding with what I have tried so far and some more info to solve this issue.

Consolidated answeres to many questions raised in the responses:
- The File system has the glibc resolver libraries, all of those mentioned in the "man pages of nsswitch.conf". All those /lib/libnss_files and the symbolic links are verified correctly.
- The nsswitch.conf has entries for all important service switches including protocols and services.
- For the name resolution in the "hosts" entry of nsswitch.conf, "files" is given the precedence. The settings in the /etc/hosts are ok.
- PLEASE note that the NFS file system in use has been successfully used with an evaluation board where I could run all network related programs incl. ping & telnet. I have made no changes to the file system.

****One significant difference between the eval. board and the curent one is that I DO NOT run /sbin/init when the kernel boots and therby preventing the boot scripts execution. I run the /bin/sh directly. (Inittab was set to 3 and then 1 without any differnce)

Another observation:
--------------------
I have run set of boot scripts from the bash, but it looks like either they are insufficient or not done correctly. This is because when I try to perform a insmod of a very simple skeleton driver, I get "unresolved symbols - even for printk". But I do have a ksyms file under /proc. Probably the acess to these files is somehow not taking place. (The kernel has loadable Module support enabled!)

My questions:
- Is there any simple script file that I can run when I do not boot the system via /sbin/init.
- What are all the necessary steps that needs to be performed if we have to replace the /sbin/init boot process.
- PING not being able to read /etc/processes and TELNET not being able to read the /etc/services and INSMOD failing due to unresolved symbols :
Anything in common?

Thanks to all who have responded.

With best regards,
Murali

----- Original Message -----
From: "Jeffrey D. Kowing" <[email protected]>
To: "David A. Gatwood" <[email protected]>
Cc: "murali nagarajan" <[email protected]>; <[email protected]>
Sent: Tuesday, February 05, 2002 5:03 PM
Subject: Re: Problem with ping/telnet

Quoted 5 lines
Quoted 4 lines · David A. Gatwood
Quoted 1 line · murali nagarajan

With your info, I am able to do a telnet from my board to the host,

only if

Quoted 1 line
Quoted 1 line
Quoted 1 line

I specify the port number. What surprises me is that the presence of

both

Quoted 1 line
Quoted 1 line
Quoted 1 line

/etc/services (entry to telnet is available with a port number) and

the

Quoted 1 line
Quoted 1 line
Quoted 1 line

/etc/protocols files. For some reason, may be the boot process is

unable to

Quoted 1 line
Quoted 1 line
Quoted 1 line

read these information. But when I want to do a telnet to my board

from my

Quoted 1 line
Quoted 1 line
Quoted 1 line

host iMAc, I am unable to do. I get an error message "connection

refused".

Quoted 7 lines
Quoted 7 lines

This sounds vaguely familiar like I've run into it before, but I can't remember where.

The boot process doesn't read /etc/services. That's read on-the-fly by the telnet program itself with calls to either getservbyname or getservent, which are standard C library calls, and should always work

if

Quoted 12 lines
Quoted 2 lines

the service is listed and the files (and directory) are readable by the user that telnet is being run as.

It sounds like you might be missing some of the glibc resolver libraries that allow programs to access the various databases (i.e., things like /etc/services and /etc/protocols.) In particular, I think you might be missing the /lib/libnss_files.so. There is a discussion of this somewhere in the glibc info pages as I recall. Also, your /etc/nsswitch.conf file is important for determining which source of information takes precedence (for instance, in the case of name resolution, do you use /ect/hosts first or a domain name server first).

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/