PDA

View Full Version : Cannot telnet to Fedora (core 5)


abhay_ddn
20th May 2007, 11:09 PM
Gurus,

I am trying to telnet to a fedora box from another fedora box but cannot.

I have the following setup:
1. Router: Linksys WRT54G
2. Box1: Fedora core 5/Windows Dual boot. Connected to Router via LAN cable.
3. Box 2: Fedora core 5. Connected to Router via Wireless Card using Linuxant driver.
Running telnet service. Assigned internal IP address of 192.168.1.102 by router.

What I can do successfully
1. Can access the internet from Box 1 and Box 2
2. Can ping Box 2 from Box 1
3. Can ping Box 1 from Box 2
4. If I run telnet to Box 2 from Box 2 itself, it works.

What I am trying to do but cannot
I want to be able to telnet to Box 2 (Fedora) from Box 1 (Fedora) but get the following error:
[root@localhost ~]#
[root@localhost ~]# telnet 192.168.1.102
Trying 192.168.1.102...
telnet: connect to address 192.168.1.102: No route to host
telnet: Unable to connect to remote host: No route to host

What I have tried already
I tried using the port forwarding feature of the router and set the router to forward all ports from
0 to 10000 (tcp and udp) to the Box2 IP address 192.168.1.102 since telnet uses port 23 I think.
But that did not help.

Also, I added the line "192.168.1.102 thinkpad" to /etc/hosts in both boxes. That allowed me to ping Box2 using the name "thinkpad" but did not help as far as telneting was concerned.

I think something needs to be configured at the Box2 end using iptables or something like that but I am a newbie as far as linux goes and my knowledge of networking is limited. Can the gurus here please help me out? (Once I get this going, my ultimate goal is to be able to boot Box 1 in windows and telnet to Box 2 which
would remain in Fedora).

Thanks!
Abhay

jhetrick62
21st May 2007, 01:42 AM
What is your ip address of box #1? A "no route to host" indicates that the machine does not see a route to send it's request on.

You do have to open the iptables firewall to accept telnet requests though. What you want to do should be no problem once set up properly. From a command line type "system-config-securitylevel" and press enter. You will have to enter your root password to get it open. Then make sure that "ftp" is checked as a trusted service and save it. That will open up iptables.

Now try. If you still get the "no route to host", post the output of both "ifconfig" and "route" statements here. BTW, forwarding all of those ports is both un-necessary and a serious security risk as it forwards all WAN requests on those ports directly to your machine. I suggest removing that as locally when calling the machine by it's ip address, forwarding is not necessary.

Jeff

abhay_ddn
21st May 2007, 03:12 AM

Jeff,

Thanks for your pointer. I opened up the firewall to the ftp trusted service and telnet too for good measure, and it works! I was also able to telnet into Box2 (fedora) from Box1 when it was booted up in Windows.

Yes, you are absolutely correct about the security hazard in opening up the WLAN ports in the router.
I had done that as a purely last resort diagnostic exercise, they were open only for the duration of the test whicg lasted a few minutes.

Also, I was able to ping and telnet from both linux/windows into linux using the name of Box2 instead of the ipaddress which was thinkpad by adding lines as below:
1. When Box1 was booted in Fedora
Added 192.168.1.102 thinkpad to the file /etc/hosts
2. When Box1 was booted in Windows XP
Added 192.168.1.102 thinkpad to C:\WINDOWS\system32\drivers\etc\hosts and
C:\WINDOWS\system32\drivers\etc\lmhosts
so this means I could use telnet thinkpad instead of telnet 192.168.1.102
This is probably something obvious to folks in these forums but thought I'd share this just the same.

Thanks for the help again. I am currently in the process of making sure all the basics such as ping, telnet etc. work in my two computer configuration so that when I learn about tomcat etc. I do not run into
issues because the fundamentals were not covered. These forums are great.

Abhay

marcrblevins
21st May 2007, 05:48 AM
To play telnet safe:

su -
vi /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no
only_from = 192.168.1.0/24
}


See the last line I added?

abhay_ddn
23rd May 2007, 06:20 PM
Sorry, saw your reply today. Yes, noticed the last line, it seems to restrict telnet access to that user. Things like this really help in establishing a certain comfort level for a newbie to a new operating system. Thanks for sharing that...