In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to check the IP address of this machine, the article is very detailed, has a certain reference value, interested friends must read it!
How to check the IP address of this machine? I think this problem must not be difficult for programmers. You must know that if it is a windows system, then in the cmd window, type ipconfig, for more details, type ipconfig / all.
If it is a linux system, if you already have net-tools installed, you can use the ifconfig command to check it. But if you don't have the toolkit installed, you can also check it through ip addr.
Let's take a look at the information displayed by entering ip addr on a host.
# ip addr1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever2: eth0: mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 00:16:3e:14:a2:5b brd ff:ff:ff:ff:ff:ff inet 172.16.1. 196/20 brd 172.16.15.255 scope global dynamic eth0 valid_lft 291113559sec preferred_lft 291113559sec
This command displays all the network card information on the host. As you can see, there are two network cards on the host, lo and eth0.
IP address
172.16.1.196 is the ip address of the eth0 network card. It consists of four parts, each of which occupies 8 bits (1 byte), a total of 32 bits. IP address is the communication address of a network card in the network world, which is equivalent to our real-world house number. Since it is the house number, then everyone is different, if there is the same, there will be IP address conflicts and lead to the situation that can not be connected to the Internet.
Classification of IP addresses
In theory, the maximum number of ip addresses is 2 to the 32th power, that is, 4294967296. In fact, there are far fewer than that. IP addresses are divided into five categories, and the ones that can actually be used are the first three categories of A/B/C.
The following table shows in detail the number of hosts that can be contained in category A, B, and C addresses.
Category
IP address range
Private network IP address range
Subnet mask
Number of network
Maximum number of hosts in network segment
A
1.0.0.1-127.255.255.254
10.0.0.0-10.255.255.255
255.0.0.0
126 (2 ^ 7-2)
16777214 (2 ^ 24-2)
B
128.0.0.1-191.255.255.254
172.16.0.0-172.31.255.255
255.255.0.0
16383 (2 ^ 14-1)
65534 (2 ^ 16-2)
C
192.0.0.1-223.255.255.254
192.168.0.0-192.168.255.255
255.255.255.0
2097152 (2 ^ 21-1)
254 (2 ^ 8-2)
Untyped inter-domain routing (CIDR)
If you look at the table above, you will find that the number of hosts that can be contained in Class C addresses is too small, only 254, which is not enough for a larger enterprise. And there are so many B types that there are few such large units. So, there is a compromise, CIDR.
CIDR divides the ip address into two by a subnet mask, with the network number in the front and the host number in the back. Here is an example to see how the subnet mask divides the network number and the host number:
172.16.1.196/20
The address representation is CIDR. The 20 after the slash is the subnet mask, which consists of the previous 20 consecutive 1s, that is, 11111111.111111111110000.00000000. Indicates that the first 20 digits are the network number and the last 12 digits are the host number. So the number of available hosts in the network is 2 to the power of 12 minus 2 (one network address, one broadcast address).
Calculate the subnet mask and IP address by bit AND to get the network number. Let's calculate the network number and the first available address and the last available address.
* ..00000001.copyright .11110000.copyright 172.16.0.0
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.