Find the answer to your Linux question:
Results 1 to 10 of 10
Hi every one, I met a very strange problem with ethernet cross connection. When I connect my 2 linux boxes to office LAN (using hub), telnet connection from one host ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2004
    Posts
    47

    cross connect 2 hosts and telnet problem


    Hi every one,

    I met a very strange problem with ethernet cross connection. When I connect my 2 linux boxes to office LAN (using hub), telnet connection from one host to the other works well. But when I directly connect that 2 linux boxes using cross cable, telnet doesn't work, though I see that network interface from both hosts are setup fine (ping command works, and even the http service works over 2 hosts). When the client box establish a telnet connection to the server box, I can see that in the server box, telnetd is waked up (inetd forks a new in.telnetd for servicing the new connection), but from my client box, nothing displays on the shell prompt after telnet command pressed, and after that, shell returns with timeout message.

    I hope someone know this problem and how to solve it.
    Thanks very much,
    SYB

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    It could be that it's trying to get a reverse DNS reply for the other box, and times out since there's no DNS server. Try adding both hosts and their names to the /etc/hosts file on both hosts.

  3. #3
    Just Joined!
    Join Date
    Nov 2004
    Posts
    47
    thank you, Dolda2000.

    I think it is not DNS problem because when using telnet, i just used ip address, not hostname.

    I want to correct my question at "shell returns with timeout message". I am sorry I didn't give the exact description of the phenomenon occured. After pressing <telnet 192.168.0.4>, shell never returned (or didn't return as long as I could wait), and nothing showed on screen.

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Well, you don't need to connect by hostname to get a host resolution problem, because the thing is that the receiving telnetd server will try to do a reverse lookup on anyone who is connecting to it.

  5. #5
    Just Joined!
    Join Date
    Nov 2004
    Posts
    47
    To Dolda2000, Ok, I understand the problem and now know that you're right.
    But I meet another problem with dns. Fortunately, this time, I know what the problem is. I just dont know how to solve it .

    In one linux box, the resolver work fine. But in the other box, the resolver seems not to work. The latter is a board which has my custom root filesystem. The former is a PC running RedHat. As far as I know about dns configurations, I made them same in both hosts. That is:

    -in /etc/host.conf, gives the order to find hostname/ip mapping:
    order hosts, bind
    -in /etc/hosts, I specified the 2 hosts
    127.0.0.1 localhost
    192.168.0.4 RethatBox
    192.168.0.2 SybvnBox

    With this same configuration, the RedHat box works fine, <ping RedhatBox> (or SybvnBox) returns with response messages. But in the SybvnBox, ping SybvnBox returns: Resolver error.

    It is easy to guess that RedHat has good configuration by itself. So I think I have to put more control to my Sybvnbox. But I dont know what it is. Please give me some advice.

    Thanks very much

  6. #6
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    It is a "board"? Are you working on some kind of embedded device? If so, that's really cool. =)

    As for /etc/host.conf, I don't think any Linux libc has used that for ages. What libc are you using? glibc uses /etc/nsswitch.conf for setting name lookup modules and ordering.

  7. #7
    Just Joined!
    Join Date
    Nov 2004
    Posts
    47
    Yes, I am working on an ARM-7 based board. Is it cool because I 'm looked like newbie but playing with gun?

    Yes, it is my feeling today.

    I think you point me a right way. But now another problem occur, and it is not network problem now. I hope you can help me also, or I will post it in the right forum.

    (1) I cannot dertermine what glibc was compiled for my system.
    Because the compiling job was done by other person, and I cannot ask for information now. It is possible to build a new busybox so that I can be sure about what glibc used. Anyway, I still have question. I know that if an executable uses dynamic link library, then I can use ldd to check what library it uses. But the busybox in my system now used static link. May you tell me how to know what libc it used?

    (2) nsswitch.conf seems not solve the problem.
    I still dont compile a new busybox now, but because i did try and fail with /etc/host.conf, it is high possibility that my busybox was compiled with glibc 2. So I make a trial with nsswitch.conf. The line "hosts: files dns" is in this file. But the problem isnt solved. Anyway, I have to be sure about libc version used first.

    May you give me further suggestion?
    Thanks a lot

  8. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    I just happen to like embedded devices a lot. =D I'd just love to get my hands on one of those really small ones and... do funny things with it. =D

    Anyway, if you have the static library on the system (check for something like /lib/libc*.a), then it should be able to tell you something.

    The first thing you need to determine is if it is glibc or some other libc. The easiest way to find out is probably to run the "strings" command on an executable and search for strings containing "GNU". If it is glibc, then one of the strings containing GNU should tell you the version number. If it's not glibc, then I guess it's harder, since there's no way of knowing for sure what to search for. You could try searching for "libc" and see if it gets some kind of result with a version number.

  9. #9
    Just Joined!
    Join Date
    Nov 2004
    Posts
    47
    just joking, please dont mind It's my hobby, too.

    When I do a trial with a file built by myself, strings and file command can give information about glibc as you suggested. But with that busybox, I did try arm-linux-strings busybox | grep 'GNU', or even check all strings in the file by eyes, but didnt find any information regarding the libc used. I wonder if a file isnt stripped, can it give us information about what libc used? But in my case, the executable was stripped already. There's no lib*.a concerning that executable in my system, also.

    Ok, I have more time to study, but I dont have much time to solve the problem.
    It reminds me to the first problem is that my board can service telnet connection when it is in LAN, but it cannot when directly connect to other host. Though I just realize about nsswitch.conf when you notice me, it existed in the root filesystem before (as well as host.conf). Now I have /etc/host.conf, /etc/nsswitch.conf, /etc/hosts, /etc/resolv.conf and all looked well, when the board connect to LAN, it can serve telnet connection, but it cann't if cross connect, and in both case, gethostbyname always fail (ping with hostname always fail).

    Suppose that my problem concern to reverse lookup as you suggested. I get information from http://www.helpdesk.umd.edu/documents/2/2142/ and it said like this:
    " Reverse lookup is the process by which a server receiving a request for service from a remote machine ascertains whether the identity claimed by the machine is in fact its true one. The process goes like this:

    1. The request arrives in a packet with an IP address indicating the point of origin.
    2. The server queries name service on the net to find out what host name is associated with that IP address.
    3. The server then queries name service to find out what IP address is associated with that host-name.
    4. If this last request fails to find an IP address, or finds one that doesn't match the original, the request for service is rejected. "

    It means my board must have the ability of gethostbyname so that it can carry out step 2 and 3 above. But I see that, even when the board is in LAN, i doesn't recognize host by name. So by what way it can carry out reverse lookup?

    Do I have some mistake in above thinking?

  10. #10
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Hmmm... good question. Maybe you should strace the telnet server and see what it hangs on.

    If you're short on time, though, maybe the simplest solution is to just recompile the telnet server and nothing else?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •