You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
970 B

5 years ago
# ipcalc
7 years ago
6 years ago
## 说明
7 years ago
5 years ago
**ipcalc命令** 是一个简单的ip地址计算器可以完成简单的IP地址计算任务
7 years ago
5 years ago
## 选项
7 years ago
5 years ago
```markdown
-c, --check Validate IP address for specified address family
-4, --ipv4 IPv4 address family (default)
-6, --ipv6 IPv6 address family
-b, --broadcast Display calculated broadcast address
-h, --hostname Show hostname determined via DNS
-m, --netmask Display default netmask for IP (class A, B, or C)
-n, --network Display network address
-p, --prefix Display network prefix
-s, --silent Don't ever display error messages
7 years ago
```
5 years ago
## 实例
7 years ago
5 years ago
```bash
ipcalc -p 192.168.2.1 255.255.255.0 # 输出PREFIX=24
ipcalc -n 192.168.2.1 255.255.255.0 # 输出NETWORK=192.168.2.0
ipcalc -h 127.0.0.1 # 输出hostname=localhost.localdomain
ipcalc -m 192.168.2.1 # 输出NETMASK=255.255.255.0
ipcalc -pnbm 192.168.2.1 255.255.255.0 # 输出以上四个选项所有
7 years ago
```