ipcalc命令是一个简单的ip地址计算器,可以完成简单的IP地址计算任务。
参数:
- -b:由给定的IP地址和网络掩码计算出广播地址;
- -4:ipv4;
- -6:ipv6;
- -h:显示给定IP地址所对应的主机名;
- -m:由给定的IP地址计算器网络掩码;
- -p:显示给定的掩码或IP地址的前缀;
- -n:由给定的IP地址和网络掩码计算网络地址;
- -s:安静模式;
- --help:显示帮助信息。
[root@Node3 ~]# ipcalc -p 10.0.32.6 255.255.255.224
PREFIX=27
[root@Node3 ~]# ipcalc -n 10.0.32.6 255.255.255.224
NETWORK=10.0.32.0
[root@Node3 ~]# ipcalc -h 172.17.21.208
HOSTNAME=node3.contoso.com
[root@Node3 ~]# ipcalc -m 172.17.21.208
NETMASK=255.255.0.0
[root@Node3 ~]# ipcalc -pnbm 172.17.21.208 255.255.255.0
NETMASK=255.255.255.0
PREFIX=24
BROADCAST=172.17.21.255
NETWORK=172.17.21.0