Linux - NewbieThis 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
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
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:~$
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 08:10 PM.
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.
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 ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.