获取子网掩码和可用的IP地址

时间:2013-04-27 19:50:35

标签: networking ip ip-address

对于整个区域来说,我是相当新的二进制等领域。 有人可以向我提供下面的详细答案,因为我无法找到一个在线

鉴于IP地址192.168.1.0和子网掩码255.255.255.0,您被要求创建一个IP寻址方案,其中每个子网至少有18个IP地址。回答以下问题:

  1. 什么是新的子网掩码?
  2. 创建了多少个子网?
  3. 每个子网有多少可用的IP地址?
  4. 假设使用子网0第3个子网的可用IP地址范围是什么?

1 个答案:

答案 0 :(得分:3)

Linux / Unix上有一个名为ipcalc

的工具

这表明

ipcalc 192.168.1.0/255.255.255.0 0.0.0.31

WILDCARD
Address:   192.168.1.0          11000000.10101000.00000001. 00000000
Netmask:   255.255.255.0 = 24   11111111.11111111.11111111. 00000000
Wildcard:  0.0.0.255            00000000.00000000.00000000. 11111111
=>
Network:   192.168.1.0/24       11000000.10101000.00000001. 00000000
HostMin:   192.168.1.1          11000000.10101000.00000001. 00000001
HostMax:   192.168.1.254        11000000.10101000.00000001. 11111110
Broadcast: 192.168.1.255        11000000.10101000.00000001. 11111111
Hosts/Net: 254                   Class C, Private Internet

Subnets after transition from /24 to /27

Netmask:   255.255.255.224 = 27 11111111.11111111.11111111.111 00000
Wildcard:  0.0.0.31             00000000.00000000.00000000.000 11111

 1.
Network:   192.168.1.0/27       11000000.10101000.00000001.000 00000
HostMin:   192.168.1.1          11000000.10101000.00000001.000 00001
HostMax:   192.168.1.30         11000000.10101000.00000001.000 11110
Broadcast: 192.168.1.31         11000000.10101000.00000001.000 11111
Hosts/Net: 30                    Class C, Private Internet

 2.
Network:   192.168.1.32/27      11000000.10101000.00000001.001 00000
HostMin:   192.168.1.33         11000000.10101000.00000001.001 00001
HostMax:   192.168.1.62         11000000.10101000.00000001.001 11110
Broadcast: 192.168.1.63         11000000.10101000.00000001.001 11111
Hosts/Net: 30                    Class C, Private Internet

 3.
Network:   192.168.1.64/27      11000000.10101000.00000001.010 00000
HostMin:   192.168.1.65         11000000.10101000.00000001.010 00001
HostMax:   192.168.1.94         11000000.10101000.00000001.010 11110
Broadcast: 192.168.1.95         11000000.10101000.00000001.010 11111
Hosts/Net: 30                    Class C, Private Internet

 4.
Network:   192.168.1.96/27      11000000.10101000.00000001.011 00000
HostMin:   192.168.1.97         11000000.10101000.00000001.011 00001
HostMax:   192.168.1.126        11000000.10101000.00000001.011 11110
Broadcast: 192.168.1.127        11000000.10101000.00000001.011 11111
Hosts/Net: 30                    Class C, Private Internet

 5.
Network:   192.168.1.128/27     11000000.10101000.00000001.100 00000
HostMin:   192.168.1.129        11000000.10101000.00000001.100 00001
HostMax:   192.168.1.158        11000000.10101000.00000001.100 11110
Broadcast: 192.168.1.159        11000000.10101000.00000001.100 11111
Hosts/Net: 30                    Class C, Private Internet

 6.
Network:   192.168.1.160/27     11000000.10101000.00000001.101 00000
HostMin:   192.168.1.161        11000000.10101000.00000001.101 00001
HostMax:   192.168.1.190        11000000.10101000.00000001.101 11110
Broadcast: 192.168.1.191        11000000.10101000.00000001.101 11111
Hosts/Net: 30                    Class C, Private Internet

 7.
Network:   192.168.1.192/27     11000000.10101000.00000001.110 00000
HostMin:   192.168.1.193        11000000.10101000.00000001.110 00001
HostMax:   192.168.1.222        11000000.10101000.00000001.110 11110
Broadcast: 192.168.1.223        11000000.10101000.00000001.110 11111
Hosts/Net: 30                    Class C, Private Internet

 8.
Network:   192.168.1.224/27     11000000.10101000.00000001.111 00000
HostMin:   192.168.1.225        11000000.10101000.00000001.111 00001
HostMax:   192.168.1.254        11000000.10101000.00000001.111 11110
Broadcast: 192.168.1.255        11000000.10101000.00000001.111 11111
Hosts/Net: 30                    Class C, Private Internet


Subnets:   8
Hosts:     240

所以问题的答案是

  1. 255.255.255.224
  2. 8
  3. 30
  4. 192.168.1.65至192.168.1.94