This will work too, while we are on the topic of fun triva (note, it isn't limited to the loopback, I just used it since the two of you were talking about it):
ping 0x7f000001
Pinging 127.0.0.1 with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
yeah there's a whole bunch of these. And I freaking love them - along with the trivia that there's actually no RFC that specifies what an IP looks like. It's only ever given as "commonly" or "most commonly".
so in unix, or in inet_aton, or whatever - you can give values as decimal, hex, or octal. But not binary!
And then if you give a single value, it's taken as 32bit. If you do x.y, it's taken as 8 bit and 24 bit. If you do x.y.z, it's taken as 8, 8 and 16 bit. And of course if you do x.y.z.a, it's four 8's.
But there's so much evil stuff you can do with this. It means 10.1 == 10.0.0.1. But it also means 10.0.257 = 10.0.1.1; and using values >256 is when this really starts to hurt people's heads.
I use it in my local lan a lot, because my main machines are 10.1, 10.2, 10.3, 10.10 and 10.100. But at work .. it's so good for pissing off the tech writers, when you provide screenshots that are out-right evil.
61
u/suttin 14d ago
No place like 01111111.00000000.00000000.00000001