netcalc-test - evaluate two addresses
netcalc test [OPTIONS] <address> <operator> <address>
netcalc-test [OPTIONS] <address> <operator> <address>
netcalctest [OPTIONS] <address> <operator> <address>
netest [OPTIONS] <address> <operator> <address>
The netcalc test widget evaluates two addresses according to the specified operator.
|
-4, --ipv4 |
The input address uses the format for the IPv4 address family. This option can be combined with --ipv6, --eui48, and --eui64. Addresses of other address families will generate an error. | ||
|
-6, --ipv6 |
The input address uses the format for the IPv6 address family. This option can be combined with --ipv4, --eui48, and --eui64. Addresses of other address families will generate an error. | ||
|
-C af, --family af |
Convert input addresses to address family af. Where af may be ipv4, ipv6, eui48, or eui64. The prefix ::ffff:0:0 will be used when converting from IPv4 addresses to IPv6 addresses. The prefix fe80:: will be used when converting from EUI-48 and EUI-64 addresses to IPv6 addresses. | ||
|
-E, --eui64 |
The input address uses the format for the EUI-64 address family. This option can be combined with --ipv4, --ipv6, and --eui48. Addresses of other address families will generate an error. | ||
|
-e, --eui48, --mac |
The input address uses the format for MAC addresses or EUI-48 address family. This option can be combined with --ipv4, --ipv6, and --eui64. Addresses of other address families will generate an error. | ||
|
-h, --help |
Print usage information and exit | ||
|
-p net, --prefix net |
Similar to the -C option, but the address family is determined by the address net |
When converting to an IPv6 address from an IPv4 address, the first 96 bits of net will be used as the prefix for the resulting IPv6 address and the CIDR will be set to the CIDR which is the larger of the source and net addresses.
When converting to an IPv6 address from an EUI-48 address, the source address is converted to a modified EUI-64 address and treated as an EUI-64 address.
When converting to an IPv6 address from an EUI-64 address, the first 64 bits of net will be used as the prefix for the resulting IPv6 address and the CIDR from the net address will be used as the CIDR of the resulting address.
|
-q, --quiet, --silent |
Suppress warnings and excess messages | ||
|
-V, --version |
Print version number and exit | ||
|
-v, --verbose |
Print additional information about the addresses and the supernet of all the provided addresses. |
|
< |
is less than |
|||
|
<= |
is less than or equal |
|||
|
= |
equals |
|||
|
>= |
is greater than or equal |
|||
|
> |
is greater than |
|||
|
<> |
is not equal |
|||
|
<< |
is contained within |
|||
|
<<= |
is contained within or equals |
|||
|
=>> |
contains or equals |
|||
|
>> |
contains |
|||
|
-lt |
is less than |
|||
|
-le |
is less than or equal |
|||
|
-eq |
equals |
|||
|
-ge |
is greater than or equal |
|||
|
-gt |
is greater than |
|||
|
-ne |
is not equal |
|||
|
-llt |
is contained within |
|||
|
-lle |
is contained within or equals |
|||
|
-gge |
contains or equals |
|||
|
-ggt |
contains |
The following example tests if the first network is contained within the second network:
netcalc test --
209.193.4.7 ’<<’ 209.193.4.0/30; echo $?
2
netcalc test --
209.193.4.7 -llt 209.193.4.0/30; echo $?
2
netcalc test --
209.193.4.7 ’<<’ 209.193.4.4/30; echo $?
0
netcalc test --
209.193.4.7 -llt 209.193.4.4/30; echo $?
0
The following example tests if the first network is the same as the second network:
netcalc test --
\
2001:db8:f:300::cb00:712a = 2001:db8:f:300::203.0.113.42; \
echo $?;
0
netcalc test --
\
2001:db8:f:300::cb00:712a -eq 2001:db8:f:300::203.0.113.42;
\
echo $?;
0
netcalc test --
\
2001:db8:f:300::cb00:712a = 2001:db8:f:300::203.0.113.43; \
echo $?;
2
netcalc test --
\
2001:db8:f:300::cb00:712a -eq 2001:db8:f:300::203.0.113.43;
\
echo $?;
2
netcalc(1), netcalc-info(1), libnetcalc(3), netcalc_cmp(3), netcalc-syntaxes(5)
David M. Syzdek <david@syzdek.net>
Network Calculations Library is developed and maintained by David M. Syzdek <david@syzdek.net>.