Finding the Subnet Mask on AIX

You may also like...

2 Responses

  1. Chris says:

    Very nice, thanks! On AIX, you could also user the lsattr command to view the subnet mask of a given network interface e.g.

    $ lsattr -El en0 -a netmask
    netmask 255.255.255.224 Subnet Mask True

  2. jgutie says:

    If you are on AIX the fastet way to see the netmask in regular notation is using smitty mktcpip and navigate tot the interface in question, granted that not being root would not allow you to change it, but it will show the current values, and netmask for smitty is show as 4 octects dot separated.

    The reality is that netmask are bits, AIX does it
    differently than others on the ifconfig, but it is naive to think the netmask can only be presented in 4 octects.
    There is a common notation that uses the sum of the enabled bits on the netmask, thus 255.255.255 or ffffff00 is actually /24
    a quick way to convert them is understanding that each octect is a byte (the reason no IPv4 address can not have any number higher to 255 on their octets)

    A byte in hex is represented by two digits, thus 255 equals ff (or 8 bits on) so fc is 255 -3 ( the 3 comes from counting the letter needed to move from c to f)

Leave a Reply

Your email address will not be published. Required fields are marked *