10.0.0.0/8 address space with a gateway address that gets randomized every 24 hours. Tomorrow’s address is advertised on a HTTP server local to the network that cannot be externally accessed. For security reasons.
About twenty years ago I was hired in to straighten up a network at a investment place. They were running all static IP addresses and the guy who set it up set the gateway to 69. I laughed and started converting them to dhcp and seriously considered leaving the gateway alone.
I have to ask a question now. My question is, is that you?
Gateway has multiple IP addresses, from .1 through .10 . (I used to have multiple OpenWRT servers for different things, but consolidated them all into a single rackmount server.)
My guess is that enough people were buying routers and using them as access points. They all tend to be on 192.168.0.1 .254 means you don’t get as bad collisions when that happens. It would cut down on technical support calls.
A typical ip address scheme is to assign lower blocks to dhcp pools and reserve high ip addresses to servers and network gear. Anything over 250 is typically a switch or a router in this case.
There are reasons to put it at the end. For example, 192.168.1.254/24 can be expanded to /23 and have the same gateway address while you migrate clients that are statically assigned or while waiting on DHCP leases to expire, since /23 is a supernet of /24.
I shared another post here with how subnetting works. Basically, if you start with 192.168.1.254 on a /24 for your gateway and move to a /23, your usable range goes from 192.168.1.1-192.168.1.254 to 192.168.0.1-192.168.1.254.
In this situation, the gateway address stays the same and since the /24 is contained within the /23, they can still connect to the gateway and keep working while you migrate things. The only thing they cannot talk to is clients in the 192.168.0.0/24 space until they pull new DHCP or have their static address updated. As such, it can make future expansion easier, if necessary.
If you used 192.168.1.1/24 as the gateway initially, you’ll notice that in this same expansion plan it’s now smack in the middle of the subnet in a /23. Is that the end of the world? No, but it looks like shit and complicates things if you did something like I usually do and allocate certain “sections” of the subnet to non-DHCP space. Also, now you need to manage two DHCP pools, one below 192.168.1.1 and one above it. It’s one of those small things that compounds with each bandaid until you’re dying by a thousand cuts.
I’m theory you would design your network with a large enough subnet from the get-go for expansion, but sometimes you screw up, so habits like this can make those screw ups less painful.
That’s mostly because it violates established standards, but you know that already. Lol.
Also, if you’re talking to a network engineer, they probably have PTSD dealing with a client that did this with a 1.0.0.0/8 used internally or some shit and now huge swathes of the internet doesn’t work, but somehow it’s “our fault” that they can’t load random web sites.
It’s just a ‘proper’ IPv6 private address, the IPv6 equivalent of ‘10.’.
I say proper as a private address in ipv6 is supposed to be fd, then 40 random bits, then whatever you want. Nothing stops you from having fd::/64 as your private network though. The thinking was people who got tired of merging networks that happened to choose the same 10.x.x.x scheme and/or vpn connecting to multiple sites similarly with the same private address. So they thought it would be swell if every private network on earth would likely be unique, so they said you ‘must’ randomize 5 bytes of it. Then no renumbering/no conflicting vpn connections.
I recently had a ticket for a university that had a /12 of public IPs. They gave every computer, printer, etc. a public IP on their whole network. Nothing has NAT. It was insane. They could buy an entire other university building with the money they’d make selling some of that address space down to even a /24.
IPv6 address is converted to its binary form {…}; The binary value is encoded to base32 (RFC 4648) {…}; Padding symbols “======” are removed from the end of the string.
You can now put text into the address like with .onion sites, or session messenger nicks.
I’ll be everywhere…wherever you look. Wherever there’s a fight so hungry people can eat, I’ll be there. Wherever there’s a cop beatin’ up a guy, I’ll be there. I’ll be in the way guys yell when they’re mad…I’ll be in the way kids laugh when they’re hungry and they know supper’s ready. And when our folks eat the stuff they raise and live in the houses they build…I’ll be there.
People also commonly do not know that the reserved for intranet ip address range of 192.168.0.0 is actually /16 so you can pick any number between 0 and 255 for that 3rd byte and have their whole network in a range other that 192.168.0.0/8 like pretty much everybody else.
Back before i knew anything about networking and set my desktops with statics, i had .1-9 as user devices, .10-19 as servers, .20-29 as printers, .50-59 as networking devices. So my current server is .14 and has been that since uni, DNS is .50, gateway is .51. Now my dhcp pool starts at 100.
Mostly to make the next sysadmin (or yourself in 6 months) weep. There’s nothing preventing there being multiple IP subnets on a single network segment, but you’d usually handle that with separate VLANs, or at least an interface alias, so the machine saw both subnets. About the only reason I could see for just adding a static route would be if you’re in the middle of reconfiguring your network to a new subnet but you still need the hosts you haven’t updated to be able to route.
The real nightmare when someone puts two ip addresses on the same host through different interfaces. Now that makes for some confusing troubleshooting and explanations in various applications.
What really gets me is in about 3/4 networks in the last couple of weeks I’ve been asked to help troubleshoot, the problem has been duplicate IP addresses. I don’t know what is going on with people…
That won’t work, unless I’m misunderstanding you. You’d still need a gateway within your subnet to handle inter-subnet routing or an additional address on the gateway network.
It can be made to work, just really really stupid.
Ultimately the ‘gateway’ is really a mac address, and the IP is just the thing to ARP to get the mac address. And you can do some gnarly things to pull off things like off-subnet gateway addresses.
You should never ever do it, but you can if you hate yourself enough.
By adding a host, or /32, route to the gateway you should then be able to use it as the default gateway on your main subnet. I was not being serious when I suggested it, as another comment says, it’s a pretty stupid idea, and there really isn’t any sane usecase for it, except possibly one of those 1am “if it’s stupid but it works it’s still stupid, but it’ll do until morning” type fixes that you shudder to recall years later.
Subnet Masks are how you get networks. It’s simple binary ANDing math.
For example, if you have a 192.168.1.1 IP address and a subnet mask of 255.255.255.0, that means the first 3 octets (each block of numbers between the dots representing an 8 bit value) of 255 are the network part of the IP (192.168.1.0/24) and the fourth octet is the host addresses space of the address. It’s saying 192.168.1 is the network and the last number is the host on that network.
If you take 1 from 192.168.1.X and convert it to binary, you get 00000001. If you convert 255 to binary, you get 11111111.
If you line them up and “AND” them together sort of like you’re adding them together in a “both must be true” comparison, you get
00000001
11111111
00000001
A 1 and a 1 makes 1. Anything else makes a 0. Basically the 192 gets ANDed to 255 and comes out as itself. Same for 168 and 1.
For a 255.0.0.0 (or /8) 255.255.0.0 (or /16), and 255.255.255.0 (or /24) it’s easy, because it’s all 1s or 0s for each block of 8 bits of the 32 bits that make up an IPv4 address. Each block just plops out as itself or zero because it’s all 1s or all 0s for each of the 4 blocks.
Now try that with 23 bits instead of 24.
00000001 for the third octet “1” part of 192.168.1.1
11111110 for “254” part of 255.255.254.0 (aka a /23)
00000000 or 0 for the third octet.
This means that the network ID is 192.168.0.0/23 and the usable IP addresses are 192.168.0.1 through 192.168.1.254.
With a /23 network, you get 512 addresses instead of 256 with a /24 (192.168.0.0-192.168.1.256 versus 1.0 through 1.256). The first IP is the network ID and the last is the broadcast address, both of which are unusable, so you have 510 IP addresses in a /23 to use for devices instead of 254 with a /24.
This is how basic IPv4 subnetting works and it’s how you size various networks for things like Enterprise that needs more than a small home network of less than 254 devices.
Congrats. If you understood that, you now have enough knowledge to probably pass some network exams.
Thank you for this explanation! Now i finally understand what the “mask” part means! Any 0s will mask the IP address in the AND operation and tell the computer that address is not part of the network.
Glad I could help with learning a new thing! If you are curious on anything else networking, I’m a Network Engineer by trade and happy to share knowledge.
That’s another private range that was added for Carrier-Grade NAT that is part of RFC6598. It’s a non-Internet routable 100.64.0.0/10 subnet for things like WISPs, Satellite providers like Starlink, Tailscale, and cellular providers that are strapped for IPv4 addresses.
If a bit in those 4 bytes is 1 that means that the same bit in the IP address is part of what defines the network whilst the bits that are 0 are bits that can change in the IP address and that machine will still be part of that sub-network.
So a mask of 255.255.252.0 (notice the 3rd byte) on a network with a prefix 192.168.0.0 means that 192.168.0.20 is in that sub-network AND 192.168.2.20 is part of that sub-network too, because the two lowest bits of the 3rd byte in that mask are 0, meaning that IP address where those bits vary are still in the same sub-network (i.e. the ranges 192.168.0.XXX, 192.168.1.XXX, 192.168.2.XXX and 192.168.3.XXX are all in the same sub-network).
If instead the sub-network prefix was the same 192.168.0.0 but with a mask of 255.255.255.0 (the most common case you find in home internal networks) then 192.168.2.20 would NOT be part of the same sub-network as 192.168.0.20
You probably also see now why a network mask is needed alongside the network prefix - in both examples above 192.168.0.0 is the network prefix, but without the network mask you don’t know which 0 bits in that network code can be changed to make an IP address still in the same sub-network.
Note that you can change the mask to make the sub-network smaller as well as to make them bigger: for example 192.168.0.0/255.255.255.223 is a perfectly valid subnetwork that fits 30 machines.
See chronicledmonocle@lemmy.world 's post for a full explanation.
Thankyou! So when I see things like 192.168.1.0/24, is that CIDR notation? And does that do a similar thing of the subnet mask by telling you which addresses are part of the subnetwork?
Can you have CIDR and subnet mask at the same time?
Well, a network mask is by definition always a sequence of 1s followed by 0s (in other words, you can’t arbitrarilly have some bits be 0 in between bits which are 1), so that /24 in CIDR notation is literally “/” + the number of bits in the network mask which have the value 1.
In other words, because of that “sequence of 1s followed by 0s” rule both 255.255.255.0 and /24 are just two different descriptions of the same network mask, first as 4 decimal numbers separated by dots, whilst the second as the count of bits in the binary representation of the mask which have the value 1.
For example, the 255.255.252.0 network mask from my first example in my last post could also be represented by /22 since the mask has 8+8+6 = 22 bits with value 1 and the rest are 0 - 192.168.0.0/22 means the same as 192.168.0.0/255.255.252.0
There is no point in having both that part of the CIDR representation and the decimal mask representation at the same time because they’re both different representations of the same thing so having both is redundant.
Depends on the equipment. I prefer cidr because its simpler, and ipv6 uses CIDR. Do you want to spell out a /64 in a netmask format? It would look like this: 255.255.255.255.255.255.255.255.0.0.0.0.0.0.0.0
Why can’t you have ip addresses without subnet masks? Couldn’t the whole internet be on a single network? Would be horrible for a number of reasons, but everything could still work.
Your question is already answered here, but it also reduces traffic by keeping packets within a network defined by the subnet mask. It establishes guardrails so packet broadcasts aren’t sent everywhere.
The Internet is a single network. But not all of it can communicate with other parts without the right access permissions. Subnet masks are one very basic aspect of that access control.
Mine is 1 for router/gateway, 2-199 is static with 2-9 (technically 1-9) being network gear, 10-19 being servers/related, 20-29 computers, 30-39 phones… all the way up to 100-119 for cameras and access, currently. And then 200+ for dhcp.
Everything on the network runs dhcp but gets a static ip from the router. If I ever forget to assign a new device, it’s obvious since it won’t be near the related equipment, and it’ll be like 213 or something, sticking out like a sore thumb.
Edit: Yes, 255 is technically not ‘reserved’ by itself. I was only thinking about the addresses scoped to /24 for a simple answer. A broadcast address is reserved, though.
148 comments
log in to comment.
10.0.0.0/8 address space with a gateway address that gets randomized every 24 hours. Tomorrow’s address is advertised on a HTTP server local to the network that cannot be externally accessed. For security reasons.
That’s the kind of overengineering I was hoping for!
Nothing advertises hostnames, and the DHCP table is dumped and every client gets new address at the same time, too.
Just make sure the MAC addresses randomize, too, and then you’ve got yourself a proper fucking mess for a hacker to sort out.
Throw in some random static DHCP leases that cycle every hour and update the firewall rule alias
the honeypot house of mirrors
I use 10.13.37.42 as my gateway.
Sigh why on earth did I not do 10.13.37.0/24?? Mine is lame as hell
Why not 10.69.42.01?
I have never found the number 69 joke/reference funny, just annoying.
You are very welcome to use that IP adress yourself, but I am going to stick to 10.13.37.42
Gateway is .69
Dhcp is .70 - .254
Static routes are .68 and below
I will not be taking any questions
The “gateway” is 69. Noted
No no no, the period comes first, .69
Gotta get your red wings.
I understood that reference…
Also, I’ve got those. 😏
About twenty years ago I was hired in to straighten up a network at a investment place. They were running all static IP addresses and the guy who set it up set the gateway to 69. I laughed and started converting them to dhcp and seriously considered leaving the gateway alone.
I have to ask a question now. My question is, is that you?
It wasn’t me. Why leave room for DHCP if you’re not going to use it?
www.youtube.com/watch?v=2g5Hz17C4is
Gateway has multiple IP addresses, from .1 through .10 . (I used to have multiple OpenWRT servers for different things, but consolidated them all into a single rackmount server.)
Last address? Who the heck does that???
I’ve had modems from my ISP which assigned themselves 192.168.0.254 for some reason. I have no idea why
My guess is that enough people were buying routers and using them as access points. They all tend to be on 192.168.0.1 .254 means you don’t get as bad collisions when that happens. It would cut down on technical support calls.
My new fibre modem is .254. It was a bitch to get into (whatever the mode’s called that makes it a simple gateway).
Bridge mode?
It’s called multicast edit: broadcast and it’s for spamming every device on the network /s
Don’t confuse the broadcast address with multicast!
hey, don’t you blame multicast for the sins of others! Multicast and Anycast are under witness protection!
I work for a French company that does this, I don’t know if all French companies do this, but it threw me for a loop for sure.
10.10.0.254 here, because I wanted my main rig to be .1
Use .0, it’s free real estate.
A typical ip address scheme is to assign lower blocks to dhcp pools and reserve high ip addresses to servers and network gear. Anything over 250 is typically a switch or a router in this case.
There are reasons to put it at the end. For example, 192.168.1.254/24 can be expanded to /23 and have the same gateway address while you migrate clients that are statically assigned or while waiting on DHCP leases to expire, since /23 is a supernet of /24.
What am I missing here?
192.168.1.1/24 would also be a valid gateway for a /23, with the benefit of not having a gateway in the middle of your /23 network?
I feel like this example is a greater justification for putting the gateway on the network/CIDR + 1, like a civilized person.
I shared another post here with how subnetting works. Basically, if you start with 192.168.1.254 on a /24 for your gateway and move to a /23, your usable range goes from 192.168.1.1-192.168.1.254 to 192.168.0.1-192.168.1.254.
In this situation, the gateway address stays the same and since the /24 is contained within the /23, they can still connect to the gateway and keep working while you migrate things. The only thing they cannot talk to is clients in the 192.168.0.0/24 space until they pull new DHCP or have their static address updated. As such, it can make future expansion easier, if necessary.
If you used 192.168.1.1/24 as the gateway initially, you’ll notice that in this same expansion plan it’s now smack in the middle of the subnet in a /23. Is that the end of the world? No, but it looks like shit and complicates things if you did something like I usually do and allocate certain “sections” of the subnet to non-DHCP space. Also, now you need to manage two DHCP pools, one below 192.168.1.1 and one above it. It’s one of those small things that compounds with each bandaid until you’re dying by a thousand cuts.
I’m theory you would design your network with a large enough subnet from the get-go for expansion, but sometimes you screw up, so habits like this can make those screw ups less painful.
Bleh, gotchu, I was getting the bit boundary wrong (192.168.0.0/24 > 192.168.0.0/23; NOT 192.168.1.0. that’s not how bits work)
There’s nothing preventing the gateway from being a DHCP client, just saying..
oh my god
i love this idea so much. I've been doing networking for 13 years now and I've never considered a dynamically addressed gateway
At first I didn’t understand then I read your comment… oh, my, god!
also servers
Settle down, Satan.
your home router is a DHCP client of your ISP’s DHCP server, so…yea.
[deleted]
Just set the Gateway to use DHCP.
Settle down Satan
So statically assign all IPs except for your gateway?
I used to use 1.2.3.4 as my gateway.
At the time I didn’t understand why this offended … Basically everybody.
As a Network Engineer: If you did this in my presence, I’d burn you at the goddamn stake. 😂
Like I said … Basically everybody.
That’s mostly because it violates established standards, but you know that already. Lol.
Also, if you’re talking to a network engineer, they probably have PTSD dealing with a client that did this with a 1.0.0.0/8 used internally or some shit and now huge swathes of the internet doesn’t work, but somehow it’s “our fault” that they can’t load random web sites.
Fwiw, I now use 10.10.220.0/24. I now know what class A, B and C are. I didn’t then.
Hopefully that offers you some comfort.
Everyone knows you need to be using a network like fd25:c74c:a5e9::/64. So much more fun that way.
I’m sure this is hilarious, but I don’t know enough about IPv6 to get it.
It’s just a ‘proper’ IPv6 private address, the IPv6 equivalent of ‘10.’.
I say proper as a private address in ipv6 is supposed to be fd, then 40 random bits, then whatever you want. Nothing stops you from having fd::/64 as your private network though. The thinking was people who got tired of merging networks that happened to choose the same 10.x.x.x scheme and/or vpn connecting to multiple sites similarly with the same private address. So they thought it would be swell if every private network on earth would likely be unique, so they said you ‘must’ randomize 5 bytes of it. Then no renumbering/no conflicting vpn connections.
Haha all good homie.
Thankfully, the internet is now as classless as I am. I don’t miss having to align to those.
Hey, for all you know he might actually be the proper owner of that subnet…
I know if by some crazy coincedence I had that in my subnet I’d be using it for fun.
I recently had a ticket for a university that had a /12 of public IPs. They gave every computer, printer, etc. a public IP on their whole network. Nothing has NAT. It was insane. They could buy an entire other university building with the money they’d make selling some of that address space down to even a /24.
RIP
Meanwhile my gateway is
fe80::17a9:3ba7:5¥4🐔:b8ä7%42Wait is there an existing unicode to ipv6 method. I assume it would just be the bit values of the emoji in utf8?
fe80::“hello 🐔” aka fe80::6865:6c6c:6f20:f09f:9094
I approve of the idea of cursed ipv6 notation.
That would be a funny way to avoid DNS, just make the address the name.
github.com/zhoreeq/meshname/blob/…/protocol.md :
You can now put text into the address like with .onion sites, or session messenger nicks.
I was joking, but it would be cool if each segment could be rendered as a UTF-8 glyphs.
sup
R U local?
I’ll be everywhere…wherever you look. Wherever there’s a fight so hungry people can eat, I’ll be there. Wherever there’s a cop beatin’ up a guy, I’ll be there. I’ll be in the way guys yell when they’re mad…I’ll be in the way kids laugh when they’re hungry and they know supper’s ready. And when our folks eat the stuff they raise and live in the houses they build…I’ll be there.
I love that people forget about 127.0.0.0/8 being the loopback network. Everyone just uses .1 when there are so many to choose from.
According ding the the law of minimal keystrokes, there’s actually only 9 to choose from.
After applying the law of minimal motion, you’re down to even fewer.
Then you go a step further to just using 127.1 (or your preferred last digit)
People also commonly do not know that the reserved for intranet ip address range of 192.168.0.0 is actually /16 so you can pick any number between 0 and 255 for that 3rd byte and have their whole network in a range other that 192.168.0.0/8 like pretty much everybody else.
I have had to deal with a lot of companies where they did the opposite, acted like 192 was a /8 and did stuff way out of the private range.
My home server is at 192.168.1.230 because that’s what IP was assigned to the machine at the moment I set it up.
Yep. Love that chaos, ya know?
DHCP gave me 170. I said “let’s make this static shall we?”
Lol mine is .116 for the same reason
Lol, same-ish, lazy gang ftw.
There are dozens of us
Back before i knew anything about networking and set my desktops with statics, i had .1-9 as user devices, .10-19 as servers, .20-29 as printers, .50-59 as networking devices. So my current server is .14 and has been that since uni, DNS is .50, gateway is .51. Now my dhcp pool starts at 100.
First address? As in, the network address? Last address? As in, the broadcast address? Suspicious.
This guy networks
*First Usable Address. Obviously u can drop the usable part.
0.0.0.0 is usable, not routable, but still very usable
/31, looking shady since 3021
Subnet: 10/8
Gateway: 10.2.5.5
Thanks. I hate it.
Nah, put your gateway in a different subnet, but on the same network segment, and add a static /32 route to it on every client.
Is there a specific reason behind this? Never considered it but I could see it being useful since most specific routes win.
Mostly to make the next sysadmin (or yourself in 6 months) weep. There’s nothing preventing there being multiple IP subnets on a single network segment, but you’d usually handle that with separate VLANs, or at least an interface alias, so the machine saw both subnets. About the only reason I could see for just adding a static route would be if you’re in the middle of reconfiguring your network to a new subnet but you still need the hosts you haven’t updated to be able to route.
The real nightmare when someone puts two ip addresses on the same host through different interfaces. Now that makes for some confusing troubleshooting and explanations in various applications.
What really gets me is in about 3/4 networks in the last couple of weeks I’ve been asked to help troubleshoot, the problem has been duplicate IP addresses. I don’t know what is going on with people…
That won’t work, unless I’m misunderstanding you. You’d still need a gateway within your subnet to handle inter-subnet routing or an additional address on the gateway network.
It can be made to work, just really really stupid.
Ultimately the ‘gateway’ is really a mac address, and the IP is just the thing to ARP to get the mac address. And you can do some gnarly things to pull off things like off-subnet gateway addresses.
You should never ever do it, but you can if you hate yourself enough.
Becomes easier in IPv6 to do these shenigans too.
Technically, sure, but you have to do a ton of fuckery and I have no idea why anybody would do all that work rather than just use an IP in the subnet.
By adding a host, or /32, route to the gateway you should then be able to use it as the default gateway on your main subnet. I was not being serious when I suggested it, as another comment says, it’s a pretty stupid idea, and there really isn’t any sane usecase for it, except possibly one of those 1am “if it’s stupid but it works it’s still stupid, but it’ll do until morning” type fixes that you shudder to recall years later.
Also change the random address daily without announcing it. If the 7th floor wants internet they can damn well work for it. 😆
10.10.10.70 here. There was a reason in the distant past that I did this and now it’s stuck that way forever.
IP addresses are one thing, but wtf is a subnet mask??
Wtf is 255.255.255.255 and why does it keep showing up???
Subnet Masks are how you get networks. It’s simple binary ANDing math.
For example, if you have a 192.168.1.1 IP address and a subnet mask of 255.255.255.0, that means the first 3 octets (each block of numbers between the dots representing an 8 bit value) of 255 are the network part of the IP (192.168.1.0/24) and the fourth octet is the host addresses space of the address. It’s saying 192.168.1 is the network and the last number is the host on that network.
If you take 1 from 192.168.1.X and convert it to binary, you get 00000001. If you convert 255 to binary, you get 11111111.
If you line them up and “AND” them together sort of like you’re adding them together in a “both must be true” comparison, you get
00000001
11111111
00000001
A 1 and a 1 makes 1. Anything else makes a 0. Basically the 192 gets ANDed to 255 and comes out as itself. Same for 168 and 1.
For a 255.0.0.0 (or /8) 255.255.0.0 (or /16), and 255.255.255.0 (or /24) it’s easy, because it’s all 1s or 0s for each block of 8 bits of the 32 bits that make up an IPv4 address. Each block just plops out as itself or zero because it’s all 1s or all 0s for each of the 4 blocks.
Now try that with 23 bits instead of 24.
00000001 for the third octet “1” part of 192.168.1.1
11111110 for “254” part of 255.255.254.0 (aka a /23)
00000000 or 0 for the third octet.
This means that the network ID is 192.168.0.0/23 and the usable IP addresses are 192.168.0.1 through 192.168.1.254.
With a /23 network, you get 512 addresses instead of 256 with a /24 (192.168.0.0-192.168.1.256 versus 1.0 through 1.256). The first IP is the network ID and the last is the broadcast address, both of which are unusable, so you have 510 IP addresses in a /23 to use for devices instead of 254 with a /24.
This is how basic IPv4 subnetting works and it’s how you size various networks for things like Enterprise that needs more than a small home network of less than 254 devices.
Congrats. If you understood that, you now have enough knowledge to probably pass some network exams.
Thank you for this explanation! Now i finally understand what the “mask” part means! Any 0s will mask the IP address in the AND operation and tell the computer that address is not part of the network.
Glad I could help with learning a new thing! If you are curious on anything else networking, I’m a Network Engineer by trade and happy to share knowledge.
Ok one last question: did tailscale have to buy the 100.100.100.x range, or is that available to anyone and they are just the only user i know?
That’s another private range that was added for Carrier-Grade NAT that is part of RFC6598. It’s a non-Internet routable 100.64.0.0/10 subnet for things like WISPs, Satellite providers like Starlink, Tailscale, and cellular providers that are strapped for IPv4 addresses.
It tells you how to read the IP address. It’s a really cool trick that’s an enormous pain in the ass.
Its just descriptor of size of your local network (aka size of address pool you can assign to your devices)
If a bit in those 4 bytes is 1 that means that the same bit in the IP address is part of what defines the network whilst the bits that are 0 are bits that can change in the IP address and that machine will still be part of that sub-network.
So a mask of 255.255.252.0 (notice the 3rd byte) on a network with a prefix 192.168.0.0 means that 192.168.0.20 is in that sub-network AND 192.168.2.20 is part of that sub-network too, because the two lowest bits of the 3rd byte in that mask are 0, meaning that IP address where those bits vary are still in the same sub-network (i.e. the ranges 192.168.0.XXX, 192.168.1.XXX, 192.168.2.XXX and 192.168.3.XXX are all in the same sub-network).
If instead the sub-network prefix was the same 192.168.0.0 but with a mask of 255.255.255.0 (the most common case you find in home internal networks) then 192.168.2.20 would NOT be part of the same sub-network as 192.168.0.20
You probably also see now why a network mask is needed alongside the network prefix - in both examples above 192.168.0.0 is the network prefix, but without the network mask you don’t know which 0 bits in that network code can be changed to make an IP address still in the same sub-network.
Note that you can change the mask to make the sub-network smaller as well as to make them bigger: for example 192.168.0.0/255.255.255.223 is a perfectly valid subnetwork that fits 30 machines.
See chronicledmonocle@lemmy.world 's post for a full explanation.
Thankyou! So when I see things like 192.168.1.0/24, is that CIDR notation? And does that do a similar thing of the subnet mask by telling you which addresses are part of the subnetwork?
Can you have CIDR and subnet mask at the same time?
Well, a network mask is by definition always a sequence of 1s followed by 0s (in other words, you can’t arbitrarilly have some bits be 0 in between bits which are 1), so that /24 in CIDR notation is literally “/” + the number of bits in the network mask which have the value 1.
In other words, because of that “sequence of 1s followed by 0s” rule both 255.255.255.0 and /24 are just two different descriptions of the same network mask, first as 4 decimal numbers separated by dots, whilst the second as the count of bits in the binary representation of the mask which have the value 1.
For example, the 255.255.252.0 network mask from my first example in my last post could also be represented by /22 since the mask has 8+8+6 = 22 bits with value 1 and the rest are 0 - 192.168.0.0/22 means the same as 192.168.0.0/255.255.252.0
There is no point in having both that part of the CIDR representation and the decimal mask representation at the same time because they’re both different representations of the same thing so having both is redundant.
Thanks, that rule about which masks are allowed was definitely not clear to me at first, thank you
Depends on the equipment. I prefer cidr because its simpler, and ipv6 uses CIDR. Do you want to spell out a /64 in a netmask format? It would look like this: 255.255.255.255.255.255.255.255.0.0.0.0.0.0.0.0
[deleted]
If you’re serious, you can’t have one without the other.
Why can’t you have ip addresses without subnet masks? Couldn’t the whole internet be on a single network? Would be horrible for a number of reasons, but everything could still work.
It is about security.
So you can differentiate between the outside network and the local network. And even divide 2 local networks as well.
Would it be possible? Sure. Just like it would be possible to have no speed limits for cars.
Your question is already answered here, but it also reduces traffic by keeping packets within a network defined by the subnet mask. It establishes guardrails so packet broadcasts aren’t sent everywhere. The Internet is a single network. But not all of it can communicate with other parts without the right access permissions. Subnet masks are one very basic aspect of that access control.
Yeah I was just saying saying that it’s possible to have one without the other.
It’d be like one big DDoS attack without them. Haha!
192.168.0.2 😤
Literally seen this in the real world too.
We need more creative solutions
serverfault.com/…/setting-a-default-gateway-which…
Spread them out, you want to avoid signal interference!
It’s good to be reminded that some things are just conventions rather than hard rules. I forget things like that (if I ever knew them to begin with).
On topic, I usually do
192.168.0.1or192.168.1.1depending on the situation.The whole of DNS configuration is just conventions.
Also it’s always the fault for every problem.
Bonus points for using a /16
Why does my router default to 10.0.0.138? Several do, actually…
Good luck getting your printer to work
Ooooohhhh…
Star Wars nerd and/or George Lucas fan? His first movie was THX 1138 and that number appears in several of his movies.
ITT: What are you people even arguing about?
It’s sysadmins and network engineers having a fun circle jerk. Lol.
I used to have my gateway as part of the DHCP range until an openwrt update broke that
You have the same issue with ipv6
Yep. My server got promoted into a router, so now my gateway is on IPv6 PD::10 :)
[deleted]
.254
Anything else is mental illness. .1 is sus but acceptable in a pinch. But why cut into the DHCP pool like that. 1-100 is DHCP, obviously.
My DHCP is 100-something I dont remember because I don’t care about or respect the devices using DHCP.
As God intended. If you’re important in any context, you have a static IP. Otherwise you’re a second or third class device.
Gonna use 10.233.212.254 on my 10.233.212.0/23 👍
There are no windows in your house.
https://vlipsy.com/clips/dr-tran-there-are-no-windows-in-your-house-aoFRHS2T
I never run into Dr.Tran in the wild and it’s a shame. More people need to support red blooded American secret agents that also have a doctorate
Buttery what!? Smoked what!? So crazy!
My soho setup is:
1-100 = DHCP
101 = Default gateway
102 - 199 = Unused
201-254 = Static, manually assigned IPs (if any)
I came up with it before I got my Net+. I told myself I’d change it as soon as it caused any problems. That was 12 years ago.
I use the low numbers for statics, less to remember/communicate if its a 1/2 digit number instead of 3.
I’m stealing this config, I love it.
Mine is 1 for router/gateway, 2-199 is static with 2-9 (technically 1-9) being network gear, 10-19 being servers/related, 20-29 computers, 30-39 phones… all the way up to 100-119 for cameras and access, currently. And then 200+ for dhcp.
Everything on the network runs dhcp but gets a static ip from the router. If I ever forget to assign a new device, it’s obvious since it won’t be near the related equipment, and it’ll be like 213 or something, sticking out like a sore thumb.
.1 gateway .2-.99 static range .100-.254 dynamic range (dhcp)
btw. /23 networks are cool, too.
yes to /23. Lower 24 is all static. Upper 24 is all DHCP. And the GW lives right in the middle at .1
DHCP first is unhinged bruh
1-127 is static, DHCP starts at 128.
Libvirt/QEMU agrees with me so I must be right
Why not 255?
255 is reserved for broadcast.
Edit: Yes, 255 is technically not ‘reserved’ by itself. I was only thinking about the addresses scoped to /24 for a simple answer. A broadcast address is reserved, though.
When in doubt: www.calculator.net/ip-subnet-calculator.html
The highest address of a subnet is the broadcast address. You can’t assign it to a host.
But 10.233.212.225 is middle of the range for the /23.
I had students like you when teaching Cisco classes…
Their peers heads would always explode, lol.