基础网路-ipv4地址

ipv4地址

00000000   1 
00000010   2
00000100   4
00001000 8
00010000 16
00100000 32
01000000  64
10000000    128

A:01
B:10
C:110 

公式:
网络网段数量=2^可变网络id位数
一个网络的主机数量=2^主机id位数-2

A类地址:
基础网路-ipv4地址

B类地址:
基础网路-ipv4地址

C类地址:
基础网路-ipv4地址

基础网路-ipv4地址

ipv4 公网地址:

基础网路-ipv4地址

ipv4私网地址

基础网路-ipv4地址

子网掩码:
基础网路-ipv4地址

```          
172.20.0.123 网络id 位数是22位,netmast ?

255.255.252.0 172.20.0.123/22


在线子网掩码计算器https://www.sojson.com/convert/subnetmask.html

200.222.123.23/26
netmask? 255.255.255.192
主机数? 2^6-2=62

2^(32-网络id位数) -2 =2
主机id位数=2

公式: 
网络id位数=ip与子网掩码netmask  
#1
192.168.1.100
255.255.255.0
网络id==网段:192.168.1.0
#2
A 172.20.222.123/20 网络id:172.20.208.0
B 172.20.230.100/20 网络id:172.20.224.0

172.20. 1101 1110.
255.255.1111 0000.0

172.20. 1110 0110.0
255.255.1111

#3
A192.168.1.100/16
B192.168.2.100/24

A ->B
1) 192.168.0.0
2) 192.168.2.100 与16 =192.168.0
3) 同一网段

b->a
1)192.168.2.0
2)192.168.1.100 与24=192.168.1.0
3)不同网段

192.168.199.111/21
网络id 192.168.192.0
netmask 255.255.248.0
主机数 2^11-2
min ip,max ip 192.168.1100 0 000.0,192.168.1100 0 111.1

192.168. 1100 0111
255.255. 1111 1000

192.168.1100 0 000.0 >> 192.168.192.1/21
192.168.1100 0 111.1 >> 192.168.199.254 /21

222.111.188.123 netmask:255.255.255.192
网络id 222.111.188.64
cidr 222.111.188.123/26
主机数:2^6-2=62
min ip,max ip 222.111.188.65/26 222.111.188.126/26

222.111.188. 0111 1011
255.255.255. 1100 0000

222.111.188.01 00 0000 >>222.111.188.01 00 0001
222.111.188.01 11 1111  >> 222.111.188.01 11 1110

10.0.0.0/8
分2个小网络:
10.0 000 0000.0.0 .>> 10.0.0.0/9
min:10.0.0.1/9
max:10.0 111 1111 .255.254 >> 10.127.255.254 10.127.255.255

10.1 000 0000.0.0 >> 10.127.0.0/9
min: 10.128.0.1 10.128.0.0
max: 10.255.255.254

划分四个网络:
2^2=4

10.00 10.0.0.0/10
10.01 10.64.0.0/10
10.10 10.128.0.0/10
10.11 10.192.0.0/10

     
划分子网:
![](https://s4.51cto.com/images/blog/202101/31/c60cc493e5a4ee25a106ab2a0825c15f.png)

10.0.0.0/8 划分32个子网
新的子网netmask  10.248.0.0
min: netid ,max :netid 10.0.0.0/13 10.248.0.0/13
主机数:
max netid ip:min ip ,max ip

10.0000 0 000.0.0
网络id :10.0.0.0/13
10.1111 1 000.0.0 >> 10.248.0.0/13

ip:
10.0000 0 000.0.0 >> 10.0.0.1 /13

10.248.0.1/13
10.1111 1 000.0.0 >> 10. 1111 1 111 .255.255.254/13

河南省:
10.248.0.0/13 ,划分17个
10.11111 000 .00 00 0000.0
1.新的子网netmask  >> 255.255.192.0
2.新的子网:min netid,max netid  :
3.新的子网存放最多的主机数
主机位数:2^14
10.11111 000 .00 .0/18  > 10.248.0.0/18
10.11111 100  00.0    >        10.252.0.0/18
10.11111 111.  11        >         10.255.192.0/18
10.11111 100  00.0    >        10.252.0.0/18​  
10.11111 100 0.1 > 10.252.0.1/18
10.11111 100 00 11 1111.254    255.254  >10.252.63.254/18

基础网路-ipv4地址

基础网路-ipv4地址

基础网路-ipv4地址