LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-12-2011, 11:01 PM   #1
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 287

Rep: Reputation: 30
Can't get online


When I returned from two days travel, my linux computer has stopped finding the internet.

ifconfig shows the gateway as 127.0.0.1. I can ping the gateway.

whereas my Windows computer (plugged into the same ethernet router) shows the default gateway as 192.168.0.0. The windows computer finds the internet normally.

If I try to ping either 192.168.0.1 or 192.168.0.105 (the windows computer) from the linux computer, it returns:

"Network is unreachable"

When I first installed Ubuntu (10.4) on the linux computer, I inadvertently gave it a different network name from my Windows computer. I haven't had time to try to figure out what to do to get them to talk to each other.

So I would like to get the linux computer back on line and while at it, get the two computers to talk to each other.

I have no idea where to start. Please assist
 
Old 12-13-2011, 01:03 AM   #2
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
ifconfig, isnt going to show you your default gateway. "route" will do that.

127.0.0.1 is the loopback address, which wont be assigned to a physical interface (ie: ethx), it should only be assigned to the "lo" interface.

Can you post the output of:
Code:
ifconfig -a
It sounds to me like possibly the interface is down, ("ifconfig ethx up"), and or, doesn't have an IP address, ("dhclient ethx"). I am assuming here that your router is using DHCP.
 
Old 12-13-2011, 07:45 AM   #3
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 287

Original Poster
Rep: Reputation: 30
192.168.0.0 in first post should be 192.168.0.1 (typo)

Router is DHCP

ifconfig -a yields

Odyssey@Intel-i3-550:~$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 48:5b:39:94:28:00
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:44 Base address:0x4000

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:149712 errors:0 dropped:0 overruns:0 frame:0
TX packets:149712 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:11433552 (11.4 MB) TX bytes:11433552 (11.4 MB)

Last edited by Odyssey1942; 12-13-2011 at 07:53 AM. Reason: omission
 
Old 12-13-2011, 10:32 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
What is the output of dhclient eth0 ?
 
Old 12-13-2011, 10:38 AM   #5
amilo
Member
 
Registered: Oct 2011
Location: Nederland
Distribution: Debian, Centos, Ubuntu
Posts: 78

Rep: Reputation: Disabled
check status of eth0 with mii-tool

Last edited by amilo; 12-13-2011 at 10:40 AM.
 
Old 12-13-2011, 12:56 PM   #6
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 287

Original Poster
Rep: Reputation: 30
Odyssey@Intel-i3-550:~$ dhclient eth0
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

can't create /var/lib/dhcp3/dhclient.leases: Permission denied
SIOCSIFADDR: Permission denied
SIOCSIFFLAGS: Permission denied
SIOCSIFFLAGS: Permission denied
Open a socket for LPF: Operation not permitted
Odyssey@Intel-i3-550:~$

mii-tool yields a series of
SIOCGMIIPHY on 'eth0' failed: Operation not permitted

through

SIOCGMIIPHY on 'eth7' failed: Operation not permitted
 
Old 12-13-2011, 01:01 PM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by Odyssey1942 View Post
SIOCSIFADDR: Permission denied
Sorry -- forgot to say the command must be run with root privileges
 
Old 12-13-2011, 05:31 PM   #8
Odyssey1942
Member
 
Registered: Jul 2006
Posts: 287

Original Poster
Rep: Reputation: 30
Odyssey@Intel-i3-550:~$ sudo dhclient eth0
[sudo] password for Odyssey:
There is already a pid file /var/run/dhclient.pid with pid 3663
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/48:5b:39:94:28:00
Sending on LPF/eth0/48:5b:39:94:28:00
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 20
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
Odyssey@Intel-i3-550:~$
 
Old 12-13-2011, 08:52 PM   #9
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
seems like you need to use static ip.

try following

Code:
ifconfig eth0 down
Code:
ifconfig eth0 192.168.0.200 netmask 255.255.255.0 up
Code:
route add default gw 192.168.0.1
Try pinging 192.168.0.1

You still might to add dns servers in resolv.conf

you can use opendns - if you chose

208.67.222.222
208.67.220.220
 
Old 12-13-2011, 09:08 PM   #10
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Quote:
Originally Posted by asimba
seems like you need to use static ip.
Not necessarily. From his original post:

Quote:
Originally Posted by Odyssey1942
whereas my Windows computer (plugged into the same ethernet router) shows
Both computers are plugged into the same router. 99% of the time, the router is running a dhcp server. And, if the router were not running a dhcp server, someone would have had to disable it.

Anyway, Odyssey1942, you can clear up that part of things by letting us know if anyone has done anything "special" to the router or if your network was plug-and-go. If someone else tinkered with the set up, then they would be the first go-to person.

So, I'm assuming that there was no tinkering involved. In that case, something caused your Linux box to lose connection information. For reasons I'm not familiar with, my Linux boxes will sometimes do that with wireless connections.

My first suggestion (assuming you're running a debian-based/ubuntu distribution) is to run:
Code:
sudo /etc/init.d/networking restart
If that doesn't work for you, then logout and try logging back in (not a full reboot). And if that doesn't work, you can try a full reboot. The full reboot is probably overkill, but it might be faster than trying various command-line approaches. If you can't afford (or don't want) to reboot, that's fine--it just means we'll all have to work on that command line approach .

Also, let us know whether the connection to the router is hard-wired or wireless.

Last edited by Dark_Helmet; 12-13-2011 at 09:10 PM.
 
Old 12-13-2011, 11:21 PM   #11
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
Just to elaborate on amilo's post.

We do have a link?
Code:
fukawi1 ~ # mii-tool eth0
eth0: negotiated 1000baseT-FD flow-control, link ok
Alternatively, you can shove your head under the desk and look for the link LED
 
Old 12-13-2011, 11:36 PM   #12
akuthia
Member
 
Registered: Oct 2007
Location: triad, nc, usa
Distribution: Ubuntu
Posts: 232

Rep: Reputation: 29
Have you done anything with a VPN, or maybe a VM? according to the op, his NIC is registering the gateway as his loopback address...
 
Old 12-13-2011, 11:59 PM   #13
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 190Reputation: 190
Quote:
Originally Posted by akuthia View Post
Have you done anything with a VPN, or maybe a VM? according to the op, his NIC is registering the gateway as his loopback address...
Without intending to put words in the OP's mouth. I believe that was a miscommunication.
As is suggested by the ifconfig output
Quote:
Code:
Odyssey@Intel-i3-550:~$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 48:5b:39:94:28:00 
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:44 Base address:0x4000 

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:149712 errors:0 dropped:0 overruns:0 frame:0
TX packets:149712 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:11433552 (11.4 MB) TX bytes:11433552 (11.4 MB)
 
Old 12-14-2011, 06:21 AM   #14
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
Quote:
Originally Posted by Dark_Helmet View Post
Not necessarily. From his original post:
I understand what you say - Its too easy to admin a home router and do what not.

Unless you know how router is set - AND how windows IP is set(dynamic/static) - Safe bet would be provide a static non conflicting ip and be done with that.

Thats the quickest he could do.
 
Old 12-14-2011, 07:34 AM   #15
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by asimba View Post
Safe bet would be provide a static non conflicting ip and be done with that.

Thats the quickest he could do.
It would also be a good test technique, taking the DHCP server out of the problem domain. If the OP was still unable to connect with anything on the LAN, it would suggest a switch port, cable or local NIC problem ...
 
1 members found this post helpful.
  


Reply


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
do real online operating systems exist that can be booted into ram then saved online wisker87 Linux - Networking 5 05-02-2010 06:53 PM
Easy script that update webpage, to show online, skype online, music playing? frenchn00b Debian 1 04-07-2008 04:12 AM


All times are GMT -5. The time now is 10:42 PM.

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