LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-12-2009, 03:47 PM   #1
Chuk
Member
 
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46

Rep: Reputation: 15
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?
 
Old 09-12-2009, 05:47 PM   #2
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
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).
 
Old 09-12-2009, 06:25 PM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655Reputation: 655
I think that bartonski is right on. Pay particular attention to the default gateway entry of the route command.
 
Old 09-13-2009, 07:05 PM   #4
Chuk
Member
 
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bartonski View Post

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,
 
Old 09-14-2009, 12:14 AM   #5
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
Quote:
Originally Posted by Chuk View Post
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-14-2009 at 12:16 AM.
 
Old 09-14-2009, 03:59 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,516

Rep: Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896Reputation: 896
Please give the output from
Code:
ping router
ping 74.125.45.100
ping www.google.com
cat /etc/resolv.conf
 
Old 09-14-2009, 09:04 PM   #7
Chuk
Member
 
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bartonski View Post

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.
 
Old 09-14-2009, 09:37 PM   #8
Chuk
Member
 
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by repo View Post
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.
 
Old 09-14-2009, 10:11 PM   #9
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
What do you get from

Code:
traceroute 74.125.45.100
(Please paste the exact output, not a description of what happens).
 
Old 09-14-2009, 10:19 PM   #10
Chuk
Member
 
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bartonski View Post
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.
 
Old 09-14-2009, 10:38 PM   #11
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
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.)
 
Old 09-14-2009, 11:08 PM   #12
Chuk
Member
 
Registered: Sep 2002
Location: British Columbia
Distribution: Ubuntu
Posts: 46

Original Poster
Rep: Reputation: 15
Solved

Quote:
Originally Posted by anomie View Post
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.
 
  


Reply

Tags
hardy, heron, internet, linux, network, ubuntu


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
Infected PC in LAN- sending packets to the internet - How to detect machine ? dlugasx Linux - Security 5 07-24-2009 04:47 PM
Help - how to build a 2nd Ubuntu machine without internet? bt101 Linux - Software 8 06-09-2009 09:14 AM
Configure Internet connection through LAN - windows machine Micik Mandriva 17 07-23-2007 07:33 AM
connect to internet with vista through a ubuntu machine kelsoge Linux - Newbie 3 05-17-2007 04:08 PM
Should I go this way? 2 Machine Lan (X-over cable) + usb modem internet? Mad Malc Debian 3 06-27-2004 06:57 AM


All times are GMT -5. The time now is 06:52 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration