LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   issues with connecting to a ip address (https://www.linuxquestions.org/questions/linux-networking-3/issues-with-connecting-to-a-ip-address-4175530546/)

blackhawk2165 01-09-2015 11:31 AM

issues with connecting to a ip address
 
Hello,

I have a mac mini with ubuntu server 14.04 running on it. I haven't had this problem before but now it won't let me ping any ip address. It gives me back connect: network is unreachable. I went into the interfaces file and before when it worked, I set up a static IP address and also specified the net mask, network, and gateway. I had it set to 192.168.0.44 which was working before and now is not. I changed it to 192.168.0.1 because I have a linksys router.

business_kid 01-09-2015 01:07 PM

If I see that, I check the contents of /etc/resolv.conf

That should have dns servers for you to use. Now that you have changed isps, that could be an issue.

blackhawk2165 01-09-2015 01:22 PM

All my resolv.conf file has in it is this:

# Dynamic resolv.conf(5) file for glib resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

should there be more in there?

veerain 01-10-2015 03:22 AM

Run this command:

Code:

ip a
It will list network devices along with their allocated ip address. Then ping that ip address to see ping works.


And /etc/resolv.conf is used mostly in desktop setups to provide two DNS nameservers.

Code:

nameserver 8.8.8.8
nameserver 8.8.4.4

With these if you type ping google.com it will lookup nameservers in the resolv.conf and give the ping app a ip address and with that ip address it would ping.

TB0ne 01-10-2015 10:03 AM

Quote:

Originally Posted by veerain (Post 5298549)
Run this command:
Code:

ip a
It will list network devices along with their allocated ip address. Then ping that ip address to see ping works.

This won't do ANYTHING helpful at all. The ping to an address on that machine will ALWAYS work, since it's locally attached. The OP posted that they get a "network unreachable" error, which is usually indicative of a missing default route.

OP, you mention both 192.168.0.44 and 192.168.0.1. Typically, the default route will be the address of whatever router (in a SOHO environment, at least) you're attached to. With my cable connection, my default route is 192.168.0.xx, but when I had DSL with Linksys, they're typically 192.168.1.xx. Are you sure that you're using the right network?
Quote:

And /etc/resolv.conf is used mostly in desktop setups to provide two DNS nameservers.
No, it *MIGHT* provide two DNS servers...it could only have one, or up to three. Also resolv.conf is ALWAYS used on EVERY system, to identify DNS servers.
Quote:

Code:

nameserver 8.8.8.8
nameserver 8.8.4.4

With these if you type ping google.com it will lookup nameservers in the resolv.conf and give the ping app a ip address and with that ip address it would ping.
Partially correct, misleading, and (unless the OP can attach to a network other than their own), useless. The OP clearly said they can't ping ANY addresses, and that their network is 192.168.xx.xx. So, without a default route (which lets their system know how to get to other network), they will NEVER be able to see anything 8.x.x.x. Also, the OP is having problem pinging ADDRESSES...which is a different symptom than not being able to ping by NAMES.

OP, once you fix your default route, things should start working. Best advice would be to get on to the router configuration web page, and check your network information. If you confirm that it's 192.168.0.xx, your default route should be the .1 (TYPICALLY...but verify). After that, if you REALLY want to add the Google DNS servers (which is optional, since your ISP is providing DNS), add them to /etc/resolvconf/resolv.conf.d/tail (create it if not present). Then, when resolvconf runs, it SHOULD shove those two at the bottom of the /etc/resolv.conf file.


All times are GMT -5. The time now is 05:28 AM.