[–] 7 points 1 week ago* (last edited 1 week ago) (6 children)

I'm the cat

1 is my pc. 254 is the managed micro switch i use to isolate work stuff. Most things are neatly arranged - eg: 70 is the testbed proxmox, 79 is its idrac, 71-78 are the vms, same with 80 on my production proxmox. DHCP is zoned from 101 to 199, IoT are assigned fixed IPs in similar ranges, etc.

Modem is 11

  • source
  • [–] 3 points 1 week ago* (4 children)

    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.

  • source
  • parent
  • context
  • [–] 6 points 1 week ago (1 child)

    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.

  • source
  • parent
  • context
  • [–] 1 point 1 week ago (2 children)

    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.

  • source
  • parent
  • context
  • [–] 5 points 1 week ago* (last edited 1 week ago) (2 children)

    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.1 or 192.168.1.1 depending on the situation.

  • source
  • [–] 8 points 1 week ago

    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.

  • source
  • parent
  • context
  • [–] 2 points 1 week ago (3 children)

    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.

  • source
  • parent
  • context
  • [–] 25 points 1 week ago* (last edited 1 week ago) (4 children)

    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.

  • source
  • parent
  • context
  • [–] 3 points 1 week ago

    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.

  • source
  • parent
  • context
  • view more: β€Ή prev next β€Ί