LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't get online (https://www.linuxquestions.org/questions/linux-newbie-8/cant-get-online-918430/)

Odyssey1942 12-12-2011 11:01 PM

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

fukawi1 12-13-2011 01:03 AM

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.

Odyssey1942 12-13-2011 07:45 AM

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)

catkin 12-13-2011 10:32 AM

What is the output of dhclient eth0 ?

amilo 12-13-2011 10:38 AM

check status of eth0 with mii-tool

Odyssey1942 12-13-2011 12:56 PM

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

catkin 12-13-2011 01:01 PM

Quote:

Originally Posted by Odyssey1942 (Post 4548918)
SIOCSIFADDR: Permission denied

Sorry -- forgot to say the command must be run with root privileges :doh:

Odyssey1942 12-13-2011 05:31 PM

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:~$

asimba 12-13-2011 08:52 PM

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

Dark_Helmet 12-13-2011 09:08 PM

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.

fukawi1 12-13-2011 11:21 PM

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 :p

akuthia 12-13-2011 11:36 PM

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...

fukawi1 12-13-2011 11:59 PM

Quote:

Originally Posted by akuthia (Post 4549362)
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)



asimba 12-14-2011 06:21 AM

Quote:

Originally Posted by Dark_Helmet (Post 4549288)
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.

catkin 12-14-2011 07:34 AM

Quote:

Originally Posted by asimba (Post 4549581)
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 ...


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