No subject


Thu Apr 25 10:42:02 EDT 2019


169.x address comes before the 192.168:

     # Test for a globally usable IPv4 address now
                # test 0.0.0.0/8
                /bin/ipcalc --network $testipv4addr_globalusable 255.0.0.0   
| LC_ALL=C grep -q "NETWORK=0\.0\.0\.0"     && return 10
                # test 10.0.0.0/8     (RFC 1918 / private)
                /bin/ipcalc --network $testipv4addr_globalusable 255.0.0.0   
| LC_ALL=C grep -q "NETWORK=10\.0\.0\.0"    && return 10
                # test 127.0.0.0/8    (loopback)
                /bin/ipcalc --network $testipv4addr_globalusable 255.0.0.0   
| LC_ALL=C grep -q "NETWORK=127\.0\.0\.0"   && return 10
                # test 169.254.0.0/16 (APIPA / DHCP link local)
               /bin/ipcalc --network $testipv4addr_globalusable 
255.255.0.0 | LC_ALL=C grep -q "NETWORK=169\.254\.0\.0" && return 10
                # test 172.16.0.0/12  (RFC 1918 / private)
                /bin/ipcalc --network $testipv4addr_globalusable 
255.240.0.0 | LC_ALL=C grep -q "NETWORK=172\.16\.0\.0"  && return 10
                # test 192.168.0.0/16 (RFC 1918 / private)
                /bin/ipcalc --network $testipv4addr_globalusable 
255.255.0.0 | LC_ALL=C grep -q "NETWORK=192\.168\.0\.0" && return 10
                # test 224.0.0.0/3    (multicast and reserved, broadcast)
                /bin/ipcalc --network $testipv4addr_globalusable 224.0.0.0   
| LC_ALL=C grep -q "NETWORK=224\.0\.0\.0"   && return 10
                                                                                
        return 0
}


Duane




More information about the Discuss mailing list