What does “192.168.1.1/21” mean?

后端 未结 2 2063
名媛妹妹
名媛妹妹 2021-01-31 15:44

When they write a slash followed by a number after an IP address, what does that mean?

2条回答
  •  情深已故
    2021-01-31 16:43

    The part after the slash is how many subnet mask bits to use. Since the use of classless routing you use slash instead of saying class A or B whatever. Example:

    192.168.1.1/24 is 192.168.1.1 255.255.255.0
    

    255.255.255.0 is using 24 of the 32 bits to create the subnet.

    in binary it looks like this:

    11111111.11111111.11111111.00000000
    

    so a /30 would look like:

    255.255.255.252 or in binary 
    11111111.11111111.11111111.11111100
    

    the remaing 00 is for hosts; the 1's are the network.

提交回复
热议问题