LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-12-2024, 07:45 PM   #16
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Original Poster
Rep: Reputation: Disabled

Quote:
posted by @marav:
Is xxx.xxx.xxx.xxx a public IP address ?
Sorry, but I don't know what a public IP adress is.
 
Old 03-12-2024, 08:15 PM   #17
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 162

Rep: Reputation: 154Reputation: 154
Quote:
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:
Code:
nslookup microsoft.com
Server:		64.71.255.204
Address:	64.71.255.204#53

Non-authoritative answer:
Name:	microsoft.com
Address: 20.236.44.162
Name:	microsoft.com
Address: 20.112.250.133
Name:	microsoft.com
Address: 20.231.239.246
Name:	microsoft.com
Address: 20.76.201.171
Name:	microsoft.com
Address: 20.70.246.20
Name:   microsoft.com
Address: 2603:1030:b:3::152
Name:   microsoft.com
Address: 2603:1030:20e:3::23c
Name:   microsoft.com
Address: 2603:1030:c02:8::14
Name:   microsoft.com
Address: 2603:1020:201:10::10f
Name:   microsoft.com
Address: 2603:1010:3:3::5b
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:
  1. With public IP addresses registered in your name
  2. With private IP addresses such as 192.168.0.1, where the 192.168.0 matches what is needed by your home/office router.
  3. 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.
 
1 members found this post helpful.
Old 03-13-2024, 05:45 AM   #18
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Original Poster
Rep: Reputation: Disabled
Quote:
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?
 
Old 03-13-2024, 07:27 AM   #19
MDKDIO
Member
 
Registered: Mar 2004
Location: Sweden
Distribution: Slackware 15
Posts: 521

Rep: Reputation: 187Reputation: 187
Quote:
Originally Posted by fredmyra View Post
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).
 
1 members found this post helpful.
Old 03-13-2024, 07:46 AM   #20
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 162

Rep: Reputation: 154Reputation: 154
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.
 
1 members found this post helpful.
Old 03-14-2024, 05:04 PM   #21
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Original Poster
Rep: Reputation: Disabled
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.
 
Old 03-15-2024, 09:38 AM   #22
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 162

Rep: Reputation: 154Reputation: 154
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.

Hope this helps...
 
1 members found this post helpful.
Old 03-15-2024, 09:47 AM   #23
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 162

Rep: Reputation: 154Reputation: 154
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".
 
1 members found this post helpful.
Old 03-17-2024, 04:17 PM   #24
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Original Poster
Rep: Reputation: Disabled
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.

Very, very useful !
 
Old 03-17-2024, 07:45 PM   #25
dhalliwe
Member
 
Registered: Mar 2022
Location: Ontario, Canada
Distribution: Slackware
Posts: 162

Rep: Reputation: 154Reputation: 154
Hearing that makes me glad I spent the time on it.

 
  


Reply



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
Ping to Honeyd virtual host replying Destination Host Unreachable Doejohn Linux - Networking 2 12-22-2023 10:43 AM
iptables - Reply Forwarding Error / Destination unreachable (Host unreachable) keflex87 Linux - Networking 1 05-12-2015 12:03 AM
Network is Unreachable/Unknown host/Destination Host Unreachable [Debian] denv Linux - Networking 4 03-27-2014 02:58 PM
[SOLVED] Snort Signature: ICMP Destination Unreachable Port Unreachable very noisy mhollis Linux - Security 4 08-15-2011 02:01 PM
tftp - "Destination Unreachable" due to "Port Unreachable" renjithgopal Linux - Security 5 07-24-2003 10:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:01 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
Open Source Consulting | Domain Registration