Ceci est une ancienne révision du document !
Chatting with a person in another group on Telegram, I mentioned that I wanted to set up a Pi-hole. The other person said that they would like to do so too, but they shared a house with three other people and the issue was that they had a VLAN set up to keep the users separate from each other, and the cameras separate. He did not know enough networking to add a Pi-hole in the mix. When I asked what his current DNS was, he told me it was 127.0.0.1… (localhost).
When I was knee-high to a grasshopper, I got a rubber-keyed ZX Spectrum computer for my birthday. Though I knew nothing about computers, what fascinated me was that one could move ‘sprites’ across the TV. It was either in the manual or in a magazine, that they showed you how, with BASIC. The catch was that you had to sketch out your sprite on graph paper, add up the rows of blocks, and use that number to ‘draw’ with. Challenge accepted! I got some graph paper, and went to work. The maths was a bit strange, but I saw why immediately, as it allowed blocks in different columns to have a unique number. I went to town, making crazy sprites… Just to find out that the book taught you to move only an 8×8 block of ‘blocks’ and nothing else. All my awesome sprites were at least four to eight times as large! The frustration was real. I went on then to make 8×8 sprites and move them across the screen, by redrawing and deleting them in BASIC. It was slow and jarring and flickering, and a horrible experience overall. I hated it. As a kid, I could not understand why I could not make smooth scrolling sprites like I saw on the tapes that came with the computer, much less control the sprite to do what I wanted. It just flickered from left-to-right, or right-to-left as that was all I managed to change. I gave up on a bad job. Though my budding career as a games programmer was crushed right there, what stuck with me was the patterns of ‘blocks’ I made for the sprites and their values. The ‘blocks’ I coloured in on the graph paper made this strange wave pattern, where they would fill up from the right-hand-side until they reached a number, then do it again to reach the next number. They were 1,2,4,8,16,32,64,128. So if you wanted to ‘count’ to 15, you would start at the one then add the two, then add the four, then add the eight, but now you would be stuck, so you would need to start the process over, keeping the eight ‘coloured in’, one, two, four, get stuck, leave it coloured in, for a total of twelve and start over until all the blocks were coloured in and you would have one less than the next block over, sixteen. I started to recognize these patterns and I could tell you the values of most of them without actually counting up the values. (Yes, I spent a *lot of time making sprites).
What I was doing was actually binary maths, but I did not know it at the time. Actually a long time, as we did not cover binary in school. So it was at my third job, as a technician, when the boss got us some training. The part everyone had an issue with was networking. IP addressing, which I oddly recognized as sprite ‘blocks’, had it all came flooding back. I did not know any theory behind it, to me it was all a ‘sprite’, so adding the ones and zeroes made perfect sense.
In my example, the ‘sprite’ for the plus-sign would be (0.0.0.16.56.16.0.0), and my network address is (10.0.0.2.255.0.0.0) - do you see where I make the connection? IP addresses make for some ugly sprites, but you can draw them out and start to recognize the patterns.
Then they had us break apart those octets to binary, useful for network engineers, not really for home users, but file it away somewhere. However, the binary was just another ‘sprite’ to me. Those ‘patterns’ I learned from making ‘sprites’ also came in handy again, as I knew, say, the last two blocks would total to 192 if I needed them coloured in. So if we needed to work an IP address backwards (the part that seemed to break my fellow technicians' brains), say the number 210 for the first number (and say I could not remember the pattern). I would know that the first three blocks together would be 224 and 224 is larger than 210, so it would have to be the last two blocks, value as stated above, and I can immediately put ones in the last two blocks, do the subtraction, end up with 18, and put a one in the 16’s column and one in the 2’s column, then zeroes in the rest. Really, that’s how easy it was. If this way of thinking about it helps anyone, I’ll count it as ‘mission accomplished’.
At this point you may be saying, well we only use DHCP at home and at work, so what’s the point? Well you may encounter it somewhere, maybe when you start setting up your smart IOT devices, or faffing with your router making subnets that can access the internet and some that cannot, or you end up sharing a house where someone else set it up and you need to add a Pi-hole.
Let's break an IP address down, take it apart, if you wish. If we look at an IP address of say 192.168.1.2/24, like a lot of home routers give you, the first three numbers, 192.168.1 – is the network part, and the last number, the 2, is the host portion. I’m just looking at IPv4 here, it’s easier to grasp. The octet in IPv4 is always 32 bits long (8×8 on graph paper). There is also a subnet mask that, you guessed it, masks the network portion of our IP. The way it does this is it fills in (masks) the network portion with all ones, and leaves all zeroes for the host portion. Thus in our example above the first three numbers will get 11111111.11111111.111111.00000000 and the last one zeroes. That translates to 255.255.255.0. The next logical column, that would follow 128, would be 256. So if you fill in all the blocks to just before 256, the total is 255. You can do the maths if you want to, that will be 127 (all the blocks before 128) plus 128, I won’t lead you down the wrong path. That said, the subnet mask can move, so it will not always be 255.255.255.0. If I were to mask, say, the first 20 bits, that would translate to 255.255.240.0 and that really is the fundamentals of an IP address. There are two IP addresses in each range you cannot assign to a device from the host portion, that being the first and the last, 0 and 255. Other than that, go bananas (OK, 127.0.0.1 is reserved as the loopback address, but other than that… ).
Now, when you deal with your ISP and they give you a fixed IP, this will mostly happen for businesses and not home users, they may slice that pie smaller than 255.255.255.0. Then like before, the first and last IP addresses in that range cannot be used, so just looking at an IP address you can’t tell unless you are salted, you need to check if the host portion translates to all 0’s or all 1’s. The company I used to work for used these fixed IP addresses to do whitelisting on our infrastructure. If you see an IP address 10.128.224.64, it will translate to: 00001010.10000000.11100000.01000000 (and usually we lose the full stops). If my subnet mask is 255.255.255.0, that^^^ is a host address, but if my subnet mask is 255.255.255.224, it is not any more. How do I know? Well, if I mask out 1’s up to 5 characters from the end, I’m left with five 0’s, meaning it is a network address, the first address I told you that you cannot use. So as long as it is not all 0’s or all 1’s you can assign it to a device. So do not fool yourself into thinking you can tell just by looking.
There is another caveat. There are private IP addresses that cannot be routed. Most of the time, your home router will hand out IPs on the 192.168.0.x range that usually has a network mask of 255.255.255.0, meaning you can have 255-2=253 number of addresses and this is what most people see. I just want to point out that there are three sets of IP addresses that are private. 192.168.0.0-192.168.255.255, 172.16.0.0-172.31.255.255, and 10.0.0.0-10.255.255.255
In Ubuntu Gnome, we see the networking section under the settings, right at the top in the left column. By default, we cannot change a network unless we try to connect to it.
I’ll use WiFi as an example. If you look at the image top right, you will notice that I can only click on any one of these. The magic happens only after you do.
Now that I have clicked on a few, I suddenly see a gear icon displayed (see image, bottom left).
If you want to follow along, but you do not have wireless, you can use the “network” button below “Wi-Fi” if you have a cable, or if you have neither, you can do what I did and click on any of the detected SSIDs. We just want the configuration window to display, we don’t need to connect to the foreign networks.
Notice the tabs along the top row (see image bottom right). The flower will open if you change that IPv4 method from DHCP to manual.
On KDE, one can go directly to “configure network connections” or use system settings, but in that case, the networking section is near the bottom.
In the next issue we can discuss topics like NAT, network address translation, and maybe how a router works.
As always, complaints to: misc@fullcirclemagazine.org