LinuxQuestions.org
Help answer threads with 0 replies.
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 07-24-2002, 10:59 PM   #1
Brendon
LQ Newbie
 
Registered: Jul 2002
Distribution: Red Hat 7.2
Posts: 5

Rep: Reputation: 0
Can't connect to localhost


I want to set up a simple 2 computer network. It's connected and I can ping the other computer. My second computer is running Windows. I've tried various TCP/IP numbers and such. I'm accessing the internet through this other computer. When I try to browse the network it gives me a 'Cannot connect to localhost' error. Localhost is listed in the /etc/hosts file as IP 127.0.0.1. I can't go to localhost with a browser so I don't think it has anything to do with my network. Is there anything else I need to do for localhost to work? Thanks.
 
Old 07-25-2002, 01:07 AM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
OK local host is refering to your own machine, so if you are trying to access localhost from a remote machine you are actually accessing yourself on that remote machine, what you need to do is setup networking + SAMBA to access windows/linux shares.
 
Old 07-25-2002, 10:07 PM   #3
Brendon
LQ Newbie
 
Registered: Jul 2002
Distribution: Red Hat 7.2
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for your help. I'm sitting on my machine and trying to connect to localhost from my machine. I should be able to just go to localhost on a browser right? Is it like Windows and you can see yourself on the network without having a network installed? I think that my first problem is not being connected to localhost which makes no sense to me because that should never be a problem. Awhile back I had some problems printing, it gave the same error message, "cannot connect to localhost.", so I think that it is more of an internal problem, not necessarily a networking one.
 
Old 07-26-2002, 03:34 AM   #4
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
run /sbin/ifconfig
see the output
if there isn't an entry for lo interface this is your hurdle
run as root
/sbin/ifconfig lo up
And second thought you said you are trying to access local host from a browser - do you have a web server running? I bet not. You need to install/configure a web server then - I suggest apache as it is a de facto web server on most *NIX's even on some windows.

Last edited by neo77777; 07-26-2002 at 03:37 AM.
 
Old 07-26-2002, 12:44 PM   #5
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
If you don't have any servers installed, connecting to your machine will bring this kind of an error. Try to ping your machine:
ping -c 4 localhost
If no success, bring lo up as neo7777 suggested (ifconfig lo up).
Then to have access to your machine files like in Windows(I suppose when you refer to a browser you're thinking about Konqueror or something similar) install samba (from installation cds) and configure it (if you have graphal configuration utilities, use them, if not - you need to edit configuration files).
Note that one very nice configuration utility (but not the only one) - Webmin (allows to configure your system using a web browser) needs Apache (web server, can be found on your installation cd, too) to run.
 
Old 07-27-2002, 11:13 PM   #6
Brendon
LQ Newbie
 
Registered: Jul 2002
Distribution: Red Hat 7.2
Posts: 5

Original Poster
Rep: Reputation: 0
My roommate and I are sharing an internet connection. He is running Windows and I am running Linux. I can ping his machine and I can ping localhost. The internet connection currently works, I don't want to scew it up but I want to be able to access files on his machine and vice-versa. I also have a Windows partition on my computer and the networking works for that. I am able to acces the internet by putting his IP number as my DNS Server. I know I need to set up Samba to acces Windows shares, but how can I just set up the simple network. I understand how to do it if it were 2 Linux machines, or a Windows machine connecting to a Linux gateway, but I'm trying to connect a Linux machine to a Windows gateway. Can I set up the Windows machine as a DNS server and if not how do I make it work?
 
Old 07-28-2002, 12:09 AM   #7
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
Nevermind, sorry.
 
Old 07-28-2002, 07:34 AM   #8
myra
Newbie
 
Registered: Apr 2002
Location: Austin, TX
Distribution: Red Hat 7.2
Posts: 15

Rep: Reputation: 0
Brendon
sorry I don't have the answer as I have the exact same setup as you and I can't even ping or get to the internet from the Linux box... am hoping you are someone can give me some hints as to how you got them to ping..
thanks
 
Old 07-28-2002, 07:57 AM   #9
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
If there's nothing more, only those 2 boxes use:
route del default
route add default gw windows_box_ip_here
and Linux DNSes can be set to normal (the same one you have in Windows).
 
Old 07-28-2002, 08:06 PM   #10
myra
Newbie
 
Registered: Apr 2002
Location: Austin, TX
Distribution: Red Hat 7.2
Posts: 15

Rep: Reputation: 0
thanks, ok that made things better, but there must be something else. still get "host unreachable".
any other suggestions


thanks for all your help
Myra
 
Old 07-29-2002, 11:54 AM   #11
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Can you ping anything? Try also to access a site using numbers (and look if your /etc/resolv.conf is empty).
 
Old 07-30-2002, 10:13 AM   #12
myra
Newbie
 
Registered: Apr 2002
Location: Austin, TX
Distribution: Red Hat 7.2
Posts: 15

Rep: Reputation: 0
ok, last night I reinstalled linux and added in the network stuff during install. now I can ping with IP addresses.

/etc/resolv.conf is empty but going to fix that. thanks again for all your help!




Last edited by myra; 07-30-2002 at 12:29 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ksysguard cannot connect to localhost gavinbeatty Linux - Software 4 07-22-2005 09:31 AM
Cannot connect to anything on localhost JohnKFT Slackware 17 05-11-2005 02:21 AM
can't connect to localhost acidblue Fedora 0 12-05-2004 07:20 PM
How to connect in localhost for RH8.0? edhan Linux - Newbie 4 09-05-2003 07:01 PM
can only connect with ssh to localhost Yaukuai Linux - Security 7 10-12-2001 09:08 AM

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

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