Linux - NetworkingThis 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.
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.
By chance I found that I couldn't browse or ping to localhost. To read CHM files I use 'archmage', and after running it you have to point your browser to localhost:number_of_port_chosen. Previously I never had any problem with it, and I always used localhost (for example, localhost:25471), but today it told me "Unknown host locahost". Later I found out that I could access the CHM -"massaged" by 'archmage'- if instead of localhost I used 127.0.0.1.
After that I tried to ping localhost, to no avail:
$ /sbin/ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:32581 errors:0 dropped:0 overruns:0 frame:0
TX packets:32581 errors:0 dropped:0 overruns:0 carrier:0
collisions:0
RX bytes:6119744 (5.8 Mb) TX bytes:6119744 (5.8 Mb)
$ less /etc/hosts
127.0.0.1 localhost
$ less /etc/sysconfig/network-scripts/ifcfg-lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
My Internet connection works as usual, and other than the scenarios described above everything seems to work OK. DNS works normally, too (at least I think), and /etc/resolv.conf contains the two nameservers given by my ISP. I can browse the web normally.
I don't know if this will have anything to do, but recently I changed my DSL modem (USB) and I realised that it uses 'zcip' (Zeroconf) during its initialization. As 'zcip' assigns IP addresses without manual assignment (perhaps to the virtual eth interface, though I'm not sure of that), I've thought that maybe it could have anything to do with the problem.
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
###.###.###.## 0.0.0.0 255.255.255.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 ###.###.###.## 0.0.0.0 UG 0 0 0 eth1
Code:
$ iptables -nL
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
DROP all -- ###.###.###.### 0.0.0.0/0
DROP all -- 10.0.0.0/8 0.0.0.0/0
DROP all -- 127.0.0.0/8 0.0.0.0/0
DROP all -- 169.254.0.0/16 0.0.0.0/0
DROP all -- 172.16.0.0/12 0.0.0.0/0
DROP all -- 192.168.0.0/16 0.0.0.0/0
DROP all -- 224.0.0.0/4 0.0.0.0/0
DROP all -- 240.0.0.0/8 0.0.0.0/0
DROP all -- 0.0.0.0/8 0.0.0.0/0
DROP all -- 255.255.255.255 0.0.0.0/0
LOG udp -- 0.0.0.0/0 ###.###.###.### udp spt:!53 LOG flags 0 level 4
DROP udp -- 0.0.0.0/0 ###.###.###.### udp spt:!53
LOG tcp -- 0.0.0.0/0 ###.###.###.### tcp dpts:!2234:2239 flags:0x16/0x02 LOG flags 0 level 4
ACCEPT udp -- [DNS nameserver] 0.0.0.0/0 udp spt:53
ACCEPT udp -- [DNS nameserver] 0.0.0.0/0 udp spt:53
DROP tcp -- 0.0.0.0/0 0.0.0.0/0 tcp flags:0x16/0x02
DROP udp -- 0.0.0.0/0 0.0.0.0/0
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
DROP all -- 0.0.0.0/0 0.0.0.0/0 state INVALID
[###.###.###.### is my IP. It's static and I don't feel like airing it...]
The rule related to 127.0.0.1/8 is:
Code:
iptables -A INPUT -i eth1 -s 127.0.0.0/8 -j DROP
So it affects the 'eth1' interface and shouldn't conflict with loopback. As you know, it is to avoid spoofed packets pretending to come from localhost.
I have used this same 'iptables' rules for a long time and they didn't seem to conflict before. But as I said I changed my modem and the new one works in a different way. The old one used 'atm' and created an interface 'atm0'; the new one creates a virtual eth interface and is launched as 'eth1'. Don't know if this will be related, though, but I explain it just in case.
Yes, after echoing "0" in /proc/sys/net/ipv4/icmp_echo_ignore_all I could ping localhost. My fault, as I didn't remember I have these two lines in my 'iptables' config:
However, echoing "0" in these two files didn't solve the browser problem, as it keeps saying "Unknown host locahost" when pointing it to localhost:[port#] to read a CHM file processed by 'archmage'. Anyway, I can read them using 127.0.0.1:[port#], but I'd like to know why localhost worked before and it doesn't work now (not a direct question, just thinking aloud)...
Yes; it happened with Konqueror, and then I tried with Mozilla. Mozilla brought me to a brazilian page called localhost.com.br.
I didn't think to try with a third one until now, when I read your suggestion. So I tried with Firefox and found that it works. Then I tried with w3m and it worked as well.
The sequence is more or less this: when I saw that Mozilla didn't work (for different reasons, as I know now), I tried to ping localhost. This of course didn't work because of the 'iptables' rule, and made me relate two unrelated things. So something in Konqueror causes to fail when directed to localhost; weird, though, because it worked before. Anyway, I can live with that. Guess I haven't been very empirical this time.
The worst thing is that I've wasted your time with this thread. I'm really sorry, and thanks again for the help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.