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.
A few weeks ago, my Ubuntu machine (Hardy Heron) suddenly stopped connecting to the internet. I usually run it headless, and it was still fine connecting to other machines on my LAN (in either direction), but I can't ping out or run any other 'net stuff. I even tried pinging by IP address instead of name.
I did notice that my eth0 (I only have one NIC in the machine) had mysteriously changed to eth1, but I fixed the /etc/networking/interfaces file and the udev rules and now it's back to eth0. Still gets LAN but no internet. I've done ifup/ifdown a few times, even restarted more than once.
I could always try another NIC, but I thought I'd see if anyone had any hardware suggestions first.
Anyone run into this before? Have any suggestions, or links to suggestions, or ideas what to Google for?
If you can connect via LAN, this suggests that the network connection its self is OK. The network interface its self doesn't know or care where the packets came from.
I'm thinking that there could be a firewall issue (packets from your router are getting discarded) or a routing issue (your Ubuntu box doesn't know where to send packets to reach the outside world).
Since you didn't say anything about changing any firewall rules, let's start with the routing issues.
give the output from '/sbin/ifconfig' and '/sbin/route'
There's also the outside possibility that you're not connecting to the network that you think you are, e.g. you have an ad-hoc wireless connection between some box on your lan and the ubuntu box, and even though you think you're connected via cat5 between Ubuntu and router, you're not (extremely unlikely that you'd do that by accident, but it's a logical possibility).
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1000 0 0 eth0
default router 0.0.0.0 UG 100 0 0 eth0
Is there a problem with "router", maybe? Should that have an IP? IIRC, router is in my hosts file. How about that 192.168.0.0 on the first line?
thanks all,
Yeah, I'll need to see the line in your hosts file where router is specified. Assuming that router is, say, 192.168.0.1, I think that part of the the routing table is OK.
"192.168.0.0" means "The whole 192.168.0.x subnet".
I believe that the problem is in the second line:
Code:
link-local * 255.255.0.0 U 1000 0 0 eth0
Here's a post on another mailing list which discusses link-local addresses:
Quote:
Link-local is a method of automatically obtaining an IP address for peer computers, without using dhcp. It's currently available on Windows and
Macs. There is a specific address range reserved for this. One
condition of using these addresses, is that they're not to be routed to
the internet, which gives me concern about the lines included in the
quote above. Assuming you're connected with a "real" IP, you've got
both that address and the link-local, on the same NIC.
My understanding, is that Linux isn't quite there yet, regarding using
link-local.
If you've ever plugged a Windows box into a network where DHCP isn't working, and gotten a '169.x.x.x' IP address, that IP address is the link-local address for that interface. This means that if you were to hook a crossover cable between two Windows boxes, they should be able to talk to each other, without needing to set anything else up... but this probably isn't the right thing to have sitting in your routing table.
I thnk that
Code:
/sbin/route del link-local
should take care of this.
Caveat: I haven't ever played with the routes on my own linux boxen (never had to). Might want to get a second opinion on this before you go changing routing tables. To paraphriase JRR Tolkein: "Do not meddle in the affairs of routing-tables, for they are subtle and quick to deny network access".
Last edited by bartonski; 09-14-2009 at 12:16 AM..
Thanks, I actually read that same post at one point but couldn't figure out how to get that rule out. I actually ended up having to do it by IP and add -net and the netmask.
Code:
route -v del -net 169.254.0.0 netmask 255.255.0.0 eth0
My new route table is missing that rule but still no internet.
The program 'traceroute' can be found in the following packages:
* traceroute-nanog
* traceroute
Try: sudo apt-get install <selected package>
-bash: traceroute: command not found
And apt-get isn't much help without the internet. If you think it might help further, I can probably download the package on this machine and just transfer it over my LAN.
If so, that's a problem. Is your router doing any sort of packet filtering? And/or do you have it set up to only allow traffic from e.g. certain MAC addresses? (That is not uncommon for wireless networks.)
I am not sure of the notation, what does the /24 represent?
your router's IP address is 192.168.0.1
you can't ping to your router
Is that all true?
That is all correct.
Quote:
If so, that's a problem. Is your router doing any sort of packet filtering? And/or do you have it set up to only allow traffic from e.g. certain MAC addresses? (That is not uncommon for wireless networks.)
I think you are my hero! This does not make sense to me, but I had my router (a D-Link DI-624) set to give my Linux box a static IP. I shut that off, and bang! I'm online again.
The weird thing is, I haven't changed anything here for weeks. Something must have reset something somewhere, somehow.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.