Linux command
ipcalc 命令
网络
复制后可按需替换文件名、目录或参数。
常用示例
Calculate network info
ipcalc [192.168.1.0/24]
Show with netmask
ipcalc [192.168.1.0] [255.255.255.0]
Split network into subnets
ipcalc [192.168.0.0/16] -s [256] [256] [256]
Check if IP is in network
ipcalc -c [192.168.1.100] [192.168.1.0/24]
Show binary representation
ipcalc -b [192.168.1.0/24]
说明
ipcalc calculates IP network information. It shows network address, broadcast address, host range, and other details from an IP address and netmask or CIDR notation. The tool is essential for network planning, subnetting, and troubleshooting IP configuration issues.
参数
- -b, --broadcast
- Show broadcast address.
- -n, --network
- Show network address.
- -h, --hostname
- Show hostname.
- -s _size_...
- Split into subnets of size.
- -c, --check
- Validate address.
- --class
- Show address class (A, B, C, D, or E).
- --minaddr
- Show minimum host address.
- --maxaddr
- Show maximum host address.
- -4, -6
- Force IPv4/IPv6.
- -r, --random-private
- Generate a random private address for given prefix length.
- --no-decorate
- Print output without decoration (suitable for scripting).
FAQ
What is the ipcalc command used for?
ipcalc calculates IP network information. It shows network address, broadcast address, host range, and other details from an IP address and netmask or CIDR notation. The tool is essential for network planning, subnetting, and troubleshooting IP configuration issues.
How do I run a basic ipcalc example?
Run `ipcalc [192.168.1.0/24]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -b, --broadcast do in ipcalc?
Show broadcast address.