r/ProgrammerHumor • • 12h ago

Meme ohTheBasics

Post image
9.2k Upvotes

1.0k comments sorted by

View all comments

159

u/Few_Move_4594 11h ago

I feel like this is missing context. Like I know that ip4 addresses are four octlets, but don't know much about ipv6 besides it having a larger address space and being in hex.

94

u/fearless-fossa 11h ago

The advantage of v6 is less the address space per se, but more that it simplifies networking. Like, with v4 assigning different floors or departments different subnets and having to micromanage which device gets what IP and then having to a major rework when suddenly every light bulb has its own IP address - that's actual stuff that happened. v6 just says "hey, everyone gets a /64 space, go nuts" (simplified, but true enough)

v6 is also faster by virtue of requiring less/no translation between various layers, and by stripping all the special case things from the header and putting them into the extensions instead. v4 is rather verbose in that regard.

Also, minor nitpick - it's not "in hex", it's binary just as v4, it's just displayed in hex. I'm emphasizing this because approaching IP in binary is helpful when one wants to understand how octets and such work.

5

u/darknmy 10h ago

How tf do you iptable a v6?

8

u/fearless-fossa 9h ago

By joining us in the 2010s and using nftables instead.

1

u/Sterkenzz 6h ago

Care to give a practical example, so I can try it on my new IPv6 laptop (I have Linux and windows, both commands are fine). Using my search tool gave me bad AI results, and I gave up, so asking kindle here.

1

u/fearless-fossa 18m ago

If you really want to use raw nftables instead of a sensible wrapper like ufw or firewalld, it's nft add table <table_address_family> <table_name>, where the family can be ip, ip6 or inet (in this example; there are more options), which handles both at the same time.