r/ProgrammerHumor • • 17d ago

Meme staticIpAddress

Post image
2.9k Upvotes

45 comments sorted by

113

u/Pretty-Character-437 17d ago

I don't get it. Wouldn't this break the connection? Does the IP not get switched if the ethernet is bad enough somehow?

144

u/overdosingOnPie1313 17d ago edited 17d ago

As long as you're careful about it, you can safely pierce through the outer plastic shield without harming your connectivity. But the bit about maintaining an IP address is just a joke.

edit: Err I misspoke. I was thinking about public IPs. Yes, maintaining the connectivity 24/7/365 will ensure that the device maintains the same IP. Of course, you could just configure a DHCP reservation on the router to accomplish the same thing, but hey XKCD #1172, amiright?

42

u/SneeKeeFahk 17d ago

When that DHCP lease expires you could get a new IP address. You probably won't but you could.

15

u/overdosingOnPie1313 17d ago

Yes, when it expires. That's why it renews if the connection is still present.

14

u/SneeKeeFahk 17d ago

Yes, maintaining the connectivity 24/7/365 will ensure that the device maintains the same IP.

Sorry, I don't mean to be a pedantic dick but you are not guaranteed the same IP address when your DHCP lease expires. If you want a static IP then you need to either configure it in the DHCP server or on the client but even then the client is more of a request than a guarantee.

Leaving it connected only guarantees that it will get an IP address not that it will get the same address.

4

u/henke37 17d ago

The DHCP spec says that you SHOULD let clients keep their address if at all possible.

7

u/SneeKeeFahk 17d ago

Yea and it usually does work out that way but we all know that sometimes shit happens and it's better to err on the side of caution.

2

u/overdosingOnPie1313 17d ago

Hmm. Had never seen that but I also reserve everything important so I missed all my chances. TIL!

1

u/ice456cream 17d ago

Surely that's why they said when it expires

I believe there is a DHCP option to renew the current lease without changes without releasing it/starting a new lease from 0.

It's up to the dhcp server if it wants to grant it though, so it can limit max session length

1

u/SneeKeeFahk 17d ago

Which is why it's just better to reserve the address with the DHCP server instead of relying on maybes and shoulda. I've been burnt too many times in prod but shoulds and maybes to make that mistake again. 

1

u/TheAsteroid 17d ago

Client side request can become a guarantee if the requested IP is outside the DHCP pool. You know, just in case you can't set it on the router/DHCP server.

1

u/SneeKeeFahk 17d ago

I didn't know that, so if my pool is 100 - 200 and I request 205 as a static IP the DHCP spec will give it to me?

2

u/TheAsteroid 16d ago

I think it's more like DHCP doesn't know about it anymore. Your device just starts talking with that IP, and because no one else will ever be assigned that, it works fine.

1

u/SpaceCadet87 17d ago

In my experience, whether it works that way doesn't depend on the cable staying connected either.

I've seen devices with the same IP address multiple years later, routers seem to just remember this mac address gets this IP address and don't really change it until something forces them to.

3

u/blckshdw 17d ago

They don’t “just seem” to remember. The flow is pretty straight forward

Host screems out to everyone “help help I need an adult, give me ip”
Server(s) respond ‘here my child, you can be 1.2.3.4 ave the rest of the info”
Host can accept that and reply yep thanks

Before the lease expires the host says “daddy, can I be 1.2.3.4 more longer?”
Servers says yeah or naaa

If the lease is expired the dhcp server can do what it wants to with it. Most servers willl just allocate new unused addresses until they run out. If they run out the expired ones start to get recycled. If your old address hasn’t been reissued you’ll prob just get that same one again. Otherwise your gonna have to get a different one

On most networks this takes a long time to go through the entire pool of addresses and then the oldest expired ones before you get a new address but it’s also totally acceptable to reissue an expired lease at any time.

5

u/SpaceCadet87 17d ago

Host screems out to everyone “help help I need an adult, give me ip”

Fuck LOL

Ya made me choke on my coffee

2

u/SneeKeeFahk 17d ago

Yea, for a home lab thing id just rely on always getting the same IP but if it's a work thing then you bet I'm going to set it in the DHCP server so I don't get a Saturday night call lol.

2

u/SpaceCadet87 17d ago

Yea, for a home lab thing id just rely on always getting the same IP

Oh no, not for me. I'm in full control of the network, no excuse for not doing address reservation. Also avahi and mdns as well just in case.

2

u/SneeKeeFahk 17d ago

I respect your dedication. I'm in full control too but I'm just asleep at the wheel lol

10

u/Vejibug 17d ago

I believe Ethernet can fallback to lower speeds if some of the wires are damaged.

IP allocation doesn't really happen based on the cable you're connected to. But it depends on the network. It's more of a nonsensical pun than anything.

1

u/ubergeek801 17d ago

Depends on which wire(s) are damaged, and the type of damage. 100Base-T only uses two of the pairs, while 1000Base-T uses all four. So theoretically if one of the conductors were severed by, say, a thumbtack pushed through the cable, you might still get a 100Mbps connection, as long as it wasn't one of the "wrong" conductors that was cut.

1

u/GuyWithTheDragonTat 17d ago

Not necessarily, if the internal wires are fine then they just affected the shielding, which is what I thought the joke was, the reply then confuses me

2

u/Lard_Denning 17d ago

there's probably no shielding anyway and it's just relying on the twisted pair to cancel out interference. if the pin isn't going directly through a pair, it's likely alright

1

u/dragostego 3d ago

Cat6 and cat5 are 8 bundles of wire. One can carefully skewer without piercing any of the twists. It's a tube that holds tubes.

32

u/Some_Useless_Person 17d ago

Not even 5 mins since I saw this same exact picture. How bad is the reposting situation here really?

45

u/overdosingOnPie1313 17d ago • Bravo

Not even 5 mins since I saw this same exact picture. How bad is the reposting situation here really?

5

u/Some_Useless_Person 17d ago

...quite the creative demonstration. Unfortunately, don't have any good awards on me rn

9

u/SeriousPlankton2000 17d ago

https://www.rfc-editor.org/info/rfc2322/

This is how you do it correctly.

5

u/Sibula97 17d ago

Nooo, they've updated the RFC website ;__; it looks all modern and shit.

0

u/ClearOptics 16d ago

Awww boo hoo

0

u/SarahAlicia 14d ago

I’m not reading all that

20

u/Random_shit_finder 17d ago

bro pinned the ip

3

u/3dGrabber 17d ago

Pull all the pins of the NIC to ground.

2

u/cheezballs 16d ago

Is the joke that its nailed down so it cant be plugged into another port? is that the joke? Or is the joke that he has a pin through his cable? Neither is programmer humor, right?

1

u/GodOf_Evil 17d ago

Wrong..it will now give two ip versions..v4 and v6..

1

u/ubergeek801 17d ago

I've heard of NAT hairpinning, but thumbtacking is not a configuration I'm familiar with.

1

u/KevlarToiletPaper 17d ago

"bro..." shut the fuck up

1

u/Dry_Investigator36 17d ago

IPin-address

1

u/Majik_Sheff 15d ago

That's route pinning.

1

u/Grtz78 15d ago

Reminds me of our analog DHCP service.
We had the IPs on clothes pegs on a washing line in the IT office. Whoever needed an IP got one of the pegs and attached it to his end of the cable ...

1

u/szab999 12d ago

Always 127.0.0.1

0

u/Ok_Tea_7319 16d ago

Ah, now I know who held the "IP addresses should just be hashed GPS coordinates" talk.

1

u/Legal-Software 16d ago

The person who came up with this was probably an accident resulting from one of their dipshit parents using a condom they had affixed to a board with a thumbtack.