[SOLVED] Destination Host Unreachable - can't get around it
SlackwareThis Forum is for the discussion of Slackware Linux.
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.
Sorry, but I don't know what a public IP adress is.
A public IP address is one that is assigned to one and only one specific computer/interface, findable via DNS, visible to everyone on the Internet, that is assigned officially through a registration service to that computer/interface.
For example, if I do an nslookup into the DNS system for microsoft.com, I get this:
Nobody else should be assigning those IP addresses to their computer/interfaces. They are registered as belonging to Microsoft.
Locally, you can't expect people configuring their own LANs for local use with official public IP addresses - there aren't enough, and there is no practical way to register them all. So, there are certain classes of IP addresses that are "private". Anyone can use them, but none of them can be reached via the Internet - data sent to or from them is not allowed directly on the public network.
The most common range of private IP address space is in the subnet 192.168.x.x. You can us them to your heart's content, and many people will be using the same ones - but they don't go anywhere past the router in your home or office. The router has to translate them into a public address (the WAN address on the publicly-visible side of the router, assigned by your ISP). The router basically collects any data to/from your local IP address, and figures out how to communicate with the public outside world.
If you start assigning your own IP addresses, you need to work in one of three ways:
With public IP addresses registered in your name
With private IP addresses such as 192.168.0.1, where the 192.168.0 matches what is needed by your home/office router.
By using DHCP, where your computer asks the network "can anyone tell me what IP address to use?" (usually your router)
You need to know what version you're trying to do to get networking to work.
posted by @ marav:
... You need to know what version you're trying to do to get networking to work.
Thanks for a clear, instructive explanation.
No its not a public IP address
I only get 169.254.xxx.xxx addresses when trying dhcp and its likes, and they don't work for me, I get error messages, can't quote them just now, but can find them.
So I usually configure manually, as in 2, in your post.
I had never heard of public addresses and never thought of using them.
I have all distros accessing internet now, but one install which has been problematic in many respects keeps activating and desactivating the connection, apparently without any intervention from my part. But perhaps I should not raise this here and should start a new thread?
I only get 169.254.xxx.xxx addresses when trying dhcp and its likes....
That is an address your "device" gets when your router is unable to provide you with an IP address.
With other words, your device is unable to communicate with your DHCP service (router as an example).
Check cable, network configuration (Wired Ethernet or WiFi, and if either is actually activated).
169.254.x.x is another private IP address space. It is one range that is commonly assigned by your own operating system when it fails to get an address assigned by DHCP. I know for sure that M$ used to use addresses in that range after DHCP failure. Maybe Slackware does, too. Seeing that IP address strongly suggests that you are not actually being given an IP address from a DHCP server.
henca previously pointed some of this out in comment 10.
In order to get an IP address from a DHCP server, you need to have a minimum level of networking operational so that your computer and the DHCP server (usually your router) can talk. Any home-grade router I have used will default to assigning addresses in the 192.168.0.0 range, and set themselves up at address 192.168.0.1 (as you mentioned in comment 13). You can set your router up differently (I do), and if a router is set up differently then that initial communications can fail.
Thank you @ dhalliwe and @MDKDIO for interesting and helpful info.
I am not very experienced in configuring stuff and I am beguinning to realize that my problem may be mainly one of how to handle the syntax and semantics of instructions and commands. Or put it simply I get mixed up when trying to get an IP address.
One partial explanation may be that I use several different distros and that is certainly a good reason to be confused. But it is a choice I don't regret as I feel it is the best way for me to learn and also to try to get everything I want - at a more reasonable price/cost.
This is a problem I have met many times with a few distros, mainly when booting from live isos on usb sticks. But also immediately after installation.
In the present case I suspect that when my Internet provider installed new hardaware at my place, after something went wrong, some distros were unable to get a working IP adress untill @henka tipped me and I discovered that they where using one that was different than what I had before.
In that sense I may call this SOLVED, but will be checking for eventual further comments.
In addition to IP addresses, you need to pay attention to the network mask and any gateways (for routing purposes).
The mask tells the networking system how to group IP addresses together. In the case of a 192.168.0.x IP address, the common network mask is 255.255.255.0. That tells the network interface "we're part of the group of addresses in the range 192.168.0.x, and we'll be able to talk directly to any IP address with 192.168.0 as the first three digits and any value of x as the fourth digit". A network address of 192.168.1.x would not be directly reachable. If the mask was 255.255.0.0, then anything in 192.168.x.x is directly reachable.
I use 192.168.192.x (old habit), so if I had a router that was configured with 192.168.0.x as its local network, I would not be able to talk to it with my computer configured as it is. To set up a new router, I have to change my local IP address to 192.168.0.x (or use DHCP), change the router to use 192.168.192.x, and then change my computer back.
The router has two network connections (at least) - an internal one for the private IP address space, and an external one for public communications. It will have it's internal one set to a single address - e.g. 192.168.0.1 - and it's netmask set to 255.255.255.0.
A computer on the LAN does not need to talk to the router to talk to other systems on the same LAN. Any other addresses in the 192.168.0.x range can be reached directly. But if I want to access the public network, I need to know where on the 192.168.0.x list I can find a system that will connect me to the public side. That address is the gateway. In terms of an ancient office phone system, think of it as "the number I need to dial to get an outside line".
The route command (only available to root) tells you what the networking system is configured to use. On my system, I get:
Quote:
root# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.192.254 0.0.0.0 UG 0 0 0 eth0
loopback 0.0.0.0 255.0.0.0 U 0 0 0 lo
192.168.192.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
You can see that I use 192.168.192.x for my LAN, the router is at 192.168.192.254. The last line says "anything destined for 192.168.192.x can be sent directly on eth0". The "default" line says "anything you can't figure out, send it to 192.168.192.254 and hope it knows what to do with it. It's also on eth0."
DHCP will provide an IP address, a mask, and a gateway.
The router may also be acting as a switch, allowing multiple physical connections (e.g. several hard-wired ports, or wireless connections). The switch function is just a simple repeater: anything received on the LAN gets sent out to everything else on the LAN. The router function is different - it requires connecting the LAN and WAN sides, and translating data packets so everything understands everything else across multiple networks. On the WAN side, your router is configured to make your ISP happy.
I keep seeing people talk about "network manager" as a tool for configuring the network. I've never used it. I must have run netconfig at some time, but for many years I have just edited /etc/rc.d/rc.inet1.conf directly. There is probably a danger in mixing the two - thinking you've done something in rc.inet1.conf, only to have network manager do something else that conflicts.
Oh, one other useful command line tool is traceroute. It will tell you the steps that are followed along the network to try to reach a destination. If I do a traceroute to the network printer on my LAN, I get this:
Quote:
root# traceroute 192.168.192.86
traceroute to 192.168.192.86 (192.168.192.86), 30 hops max, 60 byte packets
1 192.168.192.86 (192.168.192.86) 0.745 ms 0.814 ms 0.909 ms
root#
As you can see, the printer is on the same 192.168.192.x network, so I can reach it directly.
If I try a traceroute to an outside location, I'll see this (to start):
Quote:
root# traceroute rogers.com
traceroute to rogers.com (40.85.218.2), 30 hops max, 60 byte packets
1 192.168.192.254 (192.168.192.254) 1.565 ms 2.260 ms 3.255 ms
2 99.247.178.1 (99.247.178.1) 28.602 ms 34.395 ms 34.924 ms
3 24.156.142.173 (24.156.142.173) 34.735 ms 35.149 ms 35.143 ms
As you see here, my system says "I have no idea how to reach rogers.com (even though DNS has told me it's at 40.85.218.2), so I'll just send it to 192.168.192.254 and hope for the best".
Thanks @dhalliwe for fantastic bonus info on posts #22,#23. This is the kind of stuff it can take me days to find among the thousands of findings when searching the internet.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.