Hacker News new | ask | show | jobs
by teddyh 1373 days ago

  $ man 3 inet_aton

  […]

   inet_aton() converts the Internet host address cp from the IPv4
   numbers-and-dots notation into binary form (in network byte order)
   and stores it in the structure that inp points to.  inet_aton()
   returns nonzero if the address is valid, zero if not.  The address
   supplied in cp can have one of the following forms:

   a.b.c.d   Each of the four numeric parts specifies a byte  of  the
             address;  the bytes are assigned in left-to-right order
             to produce the binary address.

   a.b.c     Parts a and b specify the first two bytes of the  binary
             address.   Part c is interpreted as a 16-bit value that
             defines the rightmost two bytes of the binary address.
             This notation is  suitable  for  specifying  (outmoded)
             Class B network addresses.

   a.b       Part a specifies the first byte of the binary address.
             Part b is interpreted as a 24-bit value that defines the
             rightmost three bytes of the binary address.  This
             notation is suitable for specifying (outmoded) Class A
             network addresses.

   a         The  value  a is interpreted as a 32-bit value that is
             stored directly into the binary address without any byte
             rearrangement.

   In all of the above forms, components of the dotted address can be
   specified in decimal, octal (with a leading 0), or hexadecimal,
   with a leading 0X).  Addresses in any of these forms are
   collectively termed IPV4 numbers-and-dots notation.  The form that
   uses exactly four decimal numbers is referred to as IPv4 dotted-
   decimal notation (or sometimes: IPv4 dotted-quad notation).
https://manpages.debian.org/stable/manpages-dev/inet_aton.3....
1 comments

This is just a convention from BSD, and is not even POSIX compliant. However, 'ping 1.1' is a convenient shortcut (actually pings 1.0.0.1). iproute2 and systemd do not use inet_aton and don't follow this BSD4.2 convention and instead parse it as '1.1.0.0' or not at all.
I saw someone ping 127.1 a while back and I was so surprised I didn't know about this even after a few years in networking in the past.
Someone once showed me telnet 0 80. Lots of things should resolve.
(Not to pick on your particular comment, but to highlight a broader issue.)

I feel like convenient shortcuts are becoming hugely inconvenient when a system has hundreds of them. The unlimited amount of unix non-orthogonal options made "for convenience" cannot scale mentally.

> However, 'ping 1.1' is a convenient shortcut (actually pings 1.0.0.1).

Convenient for who!? that one guy that put his home network in 10.0.0 class ?

1.0.0.1 is owned by Cloudflare and is used for their DNS offering. It's likely a reliable 'ping' candidate for checking that your machine has internet access

[0] https://1.0.0.1/

Hey now, what is wrong with 10. class at home ;-)?

I chose 10, for simpler segmentation in my head primarily as I have a lot of devices in my house (10.<grouping/VLAN>.<location>.n), less chance of conflict as devices come online (devices i connect often are coded to 192, VPNs, etc.), helps with my VPNs between my locations.

There is a good chance if you work for company that they will use 10.x for their server stuff.

For similar reason we also steered away from home router area of 192.168.X.X for our company network stuff.

The last shitshow I worked at insisted on 192.168.x.x for their corporate VPN. I'm not sure what they were smoking, but there was no way in hell I was going to reconfigure my entire home network so I could use their shitty VPN, so I just found another way in. Dumbasses.
I suppose you use 172.16/12? :P
We use 10/8 for servers, 172.16/12 for management, 192.168.x (where x is in double/triple digits) for users.