- 論壇徽章:
- 0
|
此 script 可根據(jù)每個(gè)子網(wǎng)中 hosts 的個(gè)數(shù)及子網(wǎng)數(shù)目劃分子網(wǎng)。并列出
相應(yīng)的 prefix, netmask, total subnet number, hosts per subnet.
運(yùn)行:
- $ ./1 192.9.200.0 4 30
- Network prefix: 27
- Network mask: 255.255.255.224
- Total subnets: 8
- Hosts per subnet: 30
- list 4 out of 8 subnets::
- Network number: 192.9.200.0 Broadcast address: 192.9.200.31
- Network number: 192.9.200.64 Broadcast address: 192.9.200.95
- Network number: 192.9.200.32 Broadcast address: 192.9.200.63
- Network number: 192.9.200.96 Broadcast address: 192.9.200.127
- $
- $ ./1 192.9.200.0 4 80
- Too many subnets or hosts in your configuration
- $
- $ ./1 168.153.0.0 4 80
- Network prefix: 25
- Network mask: 255.255.255.128
- Total subnets: 512
- Hosts per subnet: 126
- list 4 out of 512 subnets::
- Network number: 168.153.0.0 Broadcast address: 168.153.0.127
- Network number: 168.153.1.0 Broadcast address: 168.153.1.127
- Network number: 168.153.0.128 Broadcast address: 168.153.0.255
- Network number: 168.153.1.128 Broadcast address: 168.153.1.255
- $
- $ ./1 10.0.0.0 4 80
- Network prefix: 25
- Network mask: 255.255.255.128
- Total subnets: 131072
- Hosts per subnet: 126
- list 4 out of 131072 subnets::
- Network number: 10.0.0.0 Broadcast address: 10.0.0.127
- Network number: 10.0.1.0 Broadcast address: 10.0.1.127
- Network number: 10.0.0.128 Broadcast address: 10.0.0.255
- Network number: 10.0.1.128 Broadcast address: 10.0.1.255
- $ ./1 250.0.0.0 4 80
- The network you input is a multicast address.
- $
- $ ./1 260.0.0.0 4 80
- Invalid network class.
- $
- $ d 200.0.0 4 80
- Invalid network format
-
復(fù)制代碼 |
|