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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-12-2009, 02:47 PM
|
#1
|
|
Member
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46
Rep:
|
Ubuntu machine gets LAN but not internet
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?
|
|
|
|
09-12-2009, 04:47 PM
|
#2
|
|
Member
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 439
Rep:
|
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).
|
|
|
|
09-12-2009, 05:25 PM
|
#3
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
I think that bartonski is right on. Pay particular attention to the default gateway entry of the route command.
|
|
|
|
09-13-2009, 06:05 PM
|
#4
|
|
Member
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46
Original Poster
Rep:
|
Quote:
Originally Posted by bartonski
give the output from '/sbin/ifconfig'
|
Code:
eth0 Link encap:Ethernet HWaddr 00:10:dc:fd:68:e5
inet addr:192.168.0.4 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::210:dcff:fefd:68e5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:348 errors:0 dropped:0 overruns:0 frame:0
TX packets:229 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:86795 (86.7 KB) TX bytes:26535 (26.5 KB)
Interrupt:22 Base address:0xe000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:26 errors:0 dropped:0 overruns:0 frame:0
TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1272 (1.2 KB) TX bytes:1272 (1.2 KB)
and from '/sbin/route'
Code:
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,
|
|
|
|
09-13-2009, 11:14 PM
|
#5
|
|
Member
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 439
Rep:
|
Quote:
Originally Posted by Chuk
and from '/sbin/route'
Code:
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-13-2009 at 11:16 PM.
|
|
|
|
09-14-2009, 02:59 AM
|
#6
|
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Slackware 14.0
Posts: 8,464
|
Please give the output from
Code:
ping router
ping 74.125.45.100
ping www.google.com
cat /etc/resolv.conf
|
|
|
|
09-14-2009, 08:04 PM
|
#7
|
|
Member
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46
Original Poster
Rep:
|
Quote:
Originally Posted by bartonski
I thnk that
Code:
/sbin/route del link-local
should take care of this.
|
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.
|
|
|
|
09-14-2009, 08:37 PM
|
#8
|
|
Member
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46
Original Poster
Rep:
|
Quote:
Originally Posted by repo
Please give the output from
Code:
ping router
ping 74.125.45.100
ping www.google.com
cat /etc/resolv.conf
|
None of those pings do anything. (Except ping localhost is normal). Actually, the google one does nothing, the others say
Code:
PING 74.125.45.100 (74.125.45.100) 56(84) bytes of data.
or the router's IP when I use router instead.
Sounds like a clue. I can ping the router from this Windows machine (with the internet working), and I can ping this machine from the linux box.
Code:
domain <ISP>.net
search <ISP>.net
nameserver 192.168.0.1
(where <ISP> is my ISP name). 192.168.0.1 is my router, which is set to share DNS.
|
|
|
|
09-14-2009, 09:11 PM
|
#9
|
|
Member
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 439
Rep:
|
What do you get from
Code:
traceroute 74.125.45.100
(Please paste the exact output, not a description of what happens).
|
|
|
|
09-14-2009, 09:19 PM
|
#10
|
|
Member
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46
Original Poster
Rep:
|
Quote:
Originally Posted by bartonski
What do you get from
Code:
traceroute 74.125.45.100
|
Nothing very informative I'm afraid:
Code:
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.
|
|
|
|
09-14-2009, 09:38 PM
|
#11
|
|
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Debian, FreeBSD, Ubuntu (desktop)
Posts: 3,859
Rep: 
|
So... - your IP address is 192.168.0.4/24
- your router's IP address is 192.168.0.1
- you can't ping to your router
Is that all true?
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.)
|
|
|
|
09-14-2009, 10:08 PM
|
#12
|
|
Member
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46
Original Poster
Rep:
|
Solved
Quote:
Originally Posted by anomie
So... - your IP address is 192.168.0.4/24
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.
Thanks to everyone, it's up and working now.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:56 AM.
|
|
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
|
|