Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-11-2005, 12:32 PM
|
#1
|
LQ Newbie
Registered: Dec 2005
Posts: 7
Rep:
|
Weird - cannot connect to localhost
This is strange, I have a new Ubuntu installation, and I can't connect to localhost (127.0.0.1) through any service - ssh, telnet, ftp, apache, etc. However, I can connect to those if I type in the machine's "real" IP - like 192.168.1.100. I can even access it from the outside by typing in the external IP of my router and port forwarding those services to the box. Connecting to localhost still does not work. I am sure it is something simple...any ideas?
Thanks,
Andrew
|
|
|
12-11-2005, 12:35 PM
|
#2
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
You simply may not have those services bound to the loopback device. Easy way to find out: Post the output here and someone can comment. Any reason why you need to connect to localhost other than testing the connection to localhost?
|
|
|
12-11-2005, 12:38 PM
|
#3
|
LQ Newbie
Registered: Dec 2005
Posts: 7
Original Poster
Rep:
|
I think it is setup correctly, it looks like they are bound to everything, but here is the output. As far as the reason - I have setup an imap server, and I need my scripts to be able to connect to it. Also, my sql servert, etc. Thanks again.
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:32770 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:32771 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:41523 127.0.0.1:32770 ESTABLISHED
tcp 0 0 127.0.0.1:32770 127.0.0.1:41523 ESTABLISHED
tcp 0 1 192.168.1.100:44662 127.0.0.1:631 SYN_SENT
tcp6 0 0 :::143 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::443 :::* LISTEN
tcp6 0 52 ::ffff:192.168.1.100:22 ::ffff:192.168.1.101:3118 ESTABLISHED
udp 0 0 0.0.0.0:68 0.0.0.0:*
|
|
|
12-11-2005, 12:40 PM
|
#4
|
Member
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384
Rep:
|
Hi,
just a few guesses...
do you have an entry for localhost in your /etc/hosts ?
do you have iptables running and dropping local connections (iptables -L to list the rules, and iptables -A INPUT -i lo -j ACCEPT; iptables -A OUTPUT -o lo -j ACCEPT to allow localhost connections)
all the services you're refering to can be configured to listen only on specific interfaces (but usually, it's not the default config)... check your sshd.conf
is your lo interface up and running (actually, i cannot remember any machine on which it was down, but still...)? You should see its status by running ifconfig.
by the way, can you ping 127.0.0.1? localhost? that's definitly the first thing to check...
Hope this helps
|
|
|
12-11-2005, 12:45 PM
|
#5
|
LQ Newbie
Registered: Dec 2005
Posts: 7
Original Poster
Rep:
|
thanks for the reply. the answers to you questions, in order:
==hosts file==
127.0.0.1 localhost.localdomain localhost bones
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
==iptables -L output==
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
i have no sshd.conf for whatever reason...
i cannot ping 127.0.0.1. hmm, now that definately is weird...what do you think it is?
|
|
|
12-11-2005, 12:47 PM
|
#6
|
LQ Newbie
Registered: Dec 2005
Posts: 7
Original Poster
Rep:
|
oh i also tried the iptables commands you posted, to no avail.
|
|
|
12-11-2005, 12:53 PM
|
#7
|
Member
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384
Rep:
|
yep, since your iptables -L said default policy accept for all tables, you didn't need the 2 iptables commands...
what did the ifconfig gave? It should say something like
Code:
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
with other lines giving the RX/TX stats
what's important is that the interface says UP and that the IP and mask are correct.
|
|
|
12-11-2005, 12:54 PM
|
#8
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Rep: 
|
Try su (or sudo) and run Your netstat output is a bit strange. It looks like you may have no regular IP bound to your ethernet card (but it is listening for IPv6 on all devices).
|
|
|
12-11-2005, 12:55 PM
|
#9
|
LQ Newbie
Registered: Dec 2005
Posts: 7
Original Poster
Rep:
|
oh snap, i think you may have identified what the problem is. i don't think the IP and mask are what they should be. i think this is because of the setup of my wireless usb adapter. check it out:
lo Link encap:Local Loopback
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6687 errors:0 dropped:0 overruns:0 frame:0
TX packets:6687 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:613745 (599.3 KiB) TX bytes:613745 (599.3 KiB)
rausb0 Link encap:Ethernet HWaddr 00:11:50:88:77:C9
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::211:50ff:fe88:77c9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:99899 errors:0 dropped:0 overruns:0 frame:0
TX packets:95553 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:98598734 (94.0 MiB) TX bytes:91556172 (87.3 MiB)
sit0 Link encap:IPv6-in-IPv4
inet6 addr: ::127.0.0.1/96 Scope:Unknown
UP RUNNING NOARP MTU:1480 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:912 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
is that right or wrong...if it's wrong...how do i fix it?
thanks again for the replies, i appreciate it.
|
|
|
12-11-2005, 01:00 PM
|
#10
|
Member
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384
Rep:
|
the address of lo0 is quite strange...
try a ifconfig lo0 127.0.0.1 netmask 255.0.0.0 up
that should do it.
you might want to change your network config file... but both location and syntax depends on what distrib you're running.
|
|
|
12-11-2005, 01:12 PM
|
#11
|
LQ Newbie
Registered: Dec 2005
Posts: 7
Original Poster
Rep:
|
wow, that did it, thanks a lot.
|
|
|
All times are GMT -5. The time now is 01:08 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|