Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to resolve IP address and MAC address

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to resolve IP address and MAC address, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

One: brief introduction

In linux systems, you usually use ifconfig or ip addr to view the IP address of the server. Ifconfig is an obsolete command in net-tools, and the package net-tools is not installed by default in centos7. Now you are using the iproute2 package, and the ip command belongs to this package.

Ip addr

Two: IP address

1.IP address is the communication address of a network card in the network world, which is equivalent to the house number of our real world.

The IP address is made up of 32 bits, which can be divided into five categories: Ameme, Breco, C, and D, E. The category C is mainly divided into two parts for A ~ (th) B ~ (th). The first part is the network number, and the second part is the host number. The following table:

It shows in detail the number of hosts contained in the three types of addresses:

There is an embarrassing thing here, that is, the number of hosts contained in Class C addresses is too small, only 254, while Class B addresses can contain too many hosts. More than 60,000 machines are placed under one network. Ordinary enterprises can hardly reach this scale.

two。 Untyped inter-domain routing (CIDR)

This approach breaks the practice of several types of addresses originally designed, dividing the 32-bit IP address into two, with the network number at the front and the host number 10.100.122. 2. 2 at the back of the IP address, there is a slash and a number 24. This form of address representation is called CIDR. The last 24 means that among the 32 bits, the first 24 bits are the network number and the last 8 bits are the host number. With the existence of CIDR, one is the broadcast address 10.100.122.255. If you send this address, all machines in the 10.100.122 network can receive it. The other is the subnet mask 255.255.255.0. Calculate the AND by bitwise with the subnet mask and IP address to get the network number.

Broadcast address: the host number is all the IP address of "1".

Subnet mask: addresses with network numbers all 1 and host numbers all 0

3. Public IP address and private IP address

The public address (Public address, also known as the public network address) is the responsibility of Internet NIC (Internet Network Information Center Internet Information Center). These IP addresses are assigned to organizations that register and apply to Internet NIC. Through its direct access to the Internet, it is within the scope of the wide area network.

Private address (Private address, also known as private network address) is an unregistered address, which is specially used within the organization. It is within the scope of the local area network. Private IP is prohibited in Internet. Where ISP (telecom operator) connects users, all traffic from private IP will be blocked and lost.

To set up an enterprise network, you need to apply to the "telecom operator ISP" for a broadband access to Internet. At the same time, ISP will also assign us one or more IP addresses, these IP addresses can be used for our internal Internet access. The IP assigned to us by these ISP is the public IP.

Range of public IP addresses:

Public IP of class A:

1.0.0.0 9.255.255.255

11.0.0.05126.255.255.255

Public IP of class B:

128.0.0.05172.15.255.255

172.32.0.05191.255.255.255

Public IP of class C:

192.0.0.05192.168.255.255

192.169.0.00223.255.255.255

4.scope

As far as the eth0 network card is concerned, it is global, which means that this network card can be external and can pick up and transport packets from various places. For lo, it is host, which means that this network card can only provide local communication with each other.

Lo, whose full name is loopback, also known as loopback interface, is often assigned to the address 127.0.0.1. This address is used for native communication, is directly returned after kernel processing, and does not appear in any network.

Three: MAC address

The top line of the IP address is link/ether 00:16:3e:08:97:07 brd ff:ff:ff:ff:ff:ff, which is called the MAC address, which is the physical address of a network card, represented by hexadecimal, six byte.

The MAC address is more like an ID card, a unique identity. Its uniqueness is designed for networking, when different network cards are placed in the same network, you don't have to worry about conflicts. From the hardware point of view, make sure that different network cards have different identities.

If a network packet is to be transmitted from one place to another, it needs not only a definite address, but also a location function. The IP address with the attribute of house number has the function of remote location. MAC address has a certain location function, but the range is very large.

Limited, the communication range of the MAC address is relatively small, limited to a subnet, once across the subnet, the MAC address is not good, the IP address is needed to work.

IV: status identification of network devices (net_device_flags)

UP: indicates that the network card is in the starting state

BROADCAST: indicates that this Nic has a broadcast address and can send broadcast packets

MULTICASE: indicates that the Nic can send multicast packets

LOWER_UP: indicates that L1 is started, that is, the network cable is plugged in there.

MTU 65536: maximum transmission unit

Five: qdisc pfifo_fast

The full name of qdisc is queueing discipline, a queuing rule. If the kernel needs to send packets through a network interface, it needs to queue the packets according to the qdisc (queuing rules) configured for that interface.

The simplest qdisc is pfifo, which does not do any processing to incoming packets, and packets pass through the queue on a first-in-first-out basis. Pfifo_fast is a little more complex, and its queue consists of three bands. In each band

Inside, use first-in, first-out rules.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report