CN106534290B - Self-adaptive maintenance method and device for IP address of maintained equipment - Google Patents

Self-adaptive maintenance method and device for IP address of maintained equipment Download PDF

Info

Publication number
CN106534290B
CN106534290B CN201610962066.8A CN201610962066A CN106534290B CN 106534290 B CN106534290 B CN 106534290B CN 201610962066 A CN201610962066 A CN 201610962066A CN 106534290 B CN106534290 B CN 106534290B
Authority
CN
China
Prior art keywords
address
maintained
interface
equipment
data packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610962066.8A
Other languages
Chinese (zh)
Other versions
CN106534290A (en
Inventor
王军
韩建建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201610962066.8A priority Critical patent/CN106534290B/en
Publication of CN106534290A publication Critical patent/CN106534290A/en
Application granted granted Critical
Publication of CN106534290B publication Critical patent/CN106534290B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses

Abstract

The invention discloses a maintenance method and a device for self-adapting to an IP address of a maintained device, which automatically acquire the IP addresses of the maintained device and a management device, set the IP address of a first interface of a maintenance gateway as the IP address of the maintained device in the same network segment, and set the IP address of a second interface of the maintenance gateway as the IP address of the management device in the same network segment; after receiving a data packet sent by a management device, replacing a destination IP address of the data packet with an IP address of a device to be maintained, and after replacing a source IP address with an IP address of a first interface of a maintenance gateway, sending the IP address to the device to be maintained; and after receiving the data packet sent by the maintained equipment, replacing the destination IP address of the data packet with the IP address of the management equipment, and after replacing the source IP address with the IP address of the second interface of the maintenance gateway, sending the data packet to the management equipment. The invention is self-adaptive to the IP address of the maintained equipment, and can quickly and conveniently log in the maintained equipment for maintenance and management.

Description

Self-adaptive maintenance method and device for IP address of maintained equipment
Technical Field
The invention belongs to the field of data communication, and particularly relates to a method and a device for maintaining an IP address of self-adaptive maintained equipment.
Background
Many devices without display interfaces and serial ports, such as IPCs, wireless routers, etc., can only log in and perform maintenance and management through the management IP address of the device, and when a manager forgets the management IP address of the device, the manager cannot log in the device to perform maintenance and management, which causes much trouble and trouble to the maintenance and management of the device.
At present, there are two methods for solving the above problems:
1. and restoring the factory configuration through a reset key (reset) on the equipment, modifying the IP address of the management equipment machine into the IP address which is in the same network segment with the IP address of the default factory configuration of the equipment, and logging in the terminal equipment through the management equipment machine for maintenance and management.
Although the method can finally realize the maintenance and management of the device forgotten to manage the IP address, the method is very complicated, and the method can restore the default IP address of the device and also restore other configuration parameters to default configurations (such as image parameters of IPC, OSD and other related information), and then needs to be reconfigured. In addition, when the device does not have a reset key, the problem cannot be solved by this method.
2. The management equipment machine is connected with the equipment which forgets to manage the IP address through a network cable, the equipment which forgets to manage the IP address is subjected to packet grabbing through packet grabbing software (such as wireshark), the grabbed data packet is analyzed to obtain the management IP address, then the IP address of the management equipment machine is modified into the IP address which is in the same network segment with the IP address of the equipment, and the management equipment machine logs in the equipment to perform maintenance and management.
Although the method can maintain and manage all the equipment forgotten to manage the IP address, the method needs the maintenance personnel to have professional background knowledge, and at least needs to know how to use the packet capturing software and analyze the captured data packet. In addition, the method also involves cumbersome operations such as modifying the IP address of the management device.
Disclosure of Invention
The invention aims to provide a maintenance method and a maintenance device for self-adapting to the IP address of a maintained device, which can quickly and conveniently log in the device for maintenance and management under the condition of not knowing the IP address of the maintained device.
In order to achieve the purpose, the technical scheme of the invention is as follows:
a maintenance method of self-adapting IP address of maintained device is applied to a maintenance gateway, a first interface of the maintenance gateway is connected with the maintained device, a second interface of the maintenance gateway is connected with a management device, the maintenance method of self-adapting IP address of the maintained device comprises:
the method comprises the steps of obtaining an IP address of a device to be maintained and an IP address of a management device, setting the IP address of a first interface of a maintenance gateway to be other IP addresses in the same network segment with the IP address of the device to be maintained, and setting the IP address of a second interface of the maintenance gateway to be other IP addresses in the same network segment with the IP address of the management device;
after receiving a domain name resolution request message sent by the management equipment, feeding back an IP address of a second interface of the maintenance gateway to the management equipment;
after receiving a data packet which is sent by the management device and has a destination IP address which is the IP address of the second interface of the maintenance gateway, replacing the destination IP address of the data packet with the IP address of the device to be maintained, and replacing the source IP address of the data packet with the IP address of the first interface of the maintenance gateway, and sending the data packet to the device to be maintained;
and after receiving a data packet which is sent by the maintained equipment and has the destination IP address of the first interface of the maintenance gateway, replacing the destination IP address of the data packet with the IP address of the management equipment, replacing the source IP address of the data packet with the IP address of the second interface of the maintenance gateway, and sending the data packet to the management equipment.
Further, the acquiring the IP address of the maintained device includes:
monitoring a free ARP data packet sent by a maintained device at a first interface;
and obtaining the IP address of the maintained equipment from the source IP address field in the IP packet header of the gratuitous ARP data packet sent by the maintained equipment.
Further, the acquiring the IP address of the management device includes:
monitoring a free ARP data packet sent by the management equipment at a second interface;
and acquiring the IP address of the management equipment from a source IP address field in an IP packet header of a gratuitous ARP data packet sent by the management equipment.
Further, the setting of the IP address of the first interface of the maintenance gateway to be another IP address in the same network segment as the IP address of the device to be maintained includes:
calculating the minimum network segment of the IP address of the maintained equipment according to the IP address of the maintained equipment and the division rule of the IP address network segment;
and randomly selecting an IP address which is actually available for the equipment and is different from the IP address of the equipment to be maintained from the minimum network segment in which the IP address of the equipment to be maintained is positioned, and allocating the IP address to the first interface of the maintenance gateway.
Further, the setting of the IP address of the second interface of the maintenance gateway to another IP address in the same network segment as the IP address of the management device includes:
calculating the minimum network segment of the IP address of the management equipment according to the IP address of the management equipment and the division rule of the IP address network segment;
and randomly selecting an IP address which is actually available for the equipment and is different from the IP address of the management equipment from the minimum network segment in which the IP address of the management equipment is positioned, and allocating the IP address to a second interface of the maintenance gateway.
The invention also provides a maintenance device for self-adapting the IP address of the maintained equipment, which is applied to a maintenance gateway, wherein a first interface of the maintenance gateway is connected with the maintained equipment, and a second interface of the maintenance gateway is connected with a management device, and the maintenance device for self-adapting the IP address of the maintained equipment is characterized by comprising the following components:
the interface IP address setting module is used for acquiring the IP address of the maintained equipment and the IP address of the management equipment, setting the IP address of the first interface of the maintenance gateway as other IP addresses in the same network segment with the IP address of the maintained equipment, and setting the IP address of the second interface of the maintenance gateway as other IP addresses in the same network segment with the IP address of the management equipment;
the domain name resolution module is used for feeding back the IP address of the second interface of the maintenance gateway to the management equipment after receiving the domain name resolution request message sent by the management equipment;
the first data packet forwarding module is used for replacing the target IP address of the data packet with the IP address of the maintained device after receiving the data packet which is sent by the management device and has the target IP address of the second interface of the maintenance gateway, and sending the data packet to the maintained device after replacing the source IP address of the data packet with the IP address of the first interface of the maintenance gateway;
and the second data packet forwarding module is used for replacing the destination IP address of the data packet with the IP address of the management equipment after receiving the data packet which is sent by the maintained equipment and has the destination IP address as the IP address of the first interface of the maintenance gateway, and sending the data packet to the management equipment after replacing the source IP address of the data packet with the IP address of the second interface of the maintenance gateway.
Further, the interface IP address setting module obtains an IP address of the device to be maintained, and performs the following operations:
monitoring a free ARP data packet sent by a maintained device at a first interface;
and obtaining the IP address of the maintained equipment from the source IP address field in the IP packet header of the gratuitous ARP data packet sent by the maintained equipment.
Further, the interface IP address setting module obtains an IP address of the management device, and performs the following operations:
monitoring a free ARP data packet sent by the management equipment at a second interface;
and acquiring the IP address of the management equipment from a source IP address field in an IP packet header of a gratuitous ARP data packet sent by the management equipment.
Further, the interface IP address setting module sets the IP address of the first interface of the maintenance gateway to be another IP address in the same network segment as the IP address of the device to be maintained, and executes the following operations:
calculating the minimum network segment of the IP address of the maintained equipment according to the IP address of the maintained equipment and the division rule of the IP address network segment;
and randomly selecting an IP address which is actually available for the equipment and is different from the IP address of the equipment to be maintained from the minimum network segment in which the IP address of the equipment to be maintained is positioned, and allocating the IP address to the first interface of the maintenance gateway.
Further, the interface IP address setting module sets the IP address of the second interface of the maintenance gateway to another IP address in the same network segment as the IP address of the management device, and executes the following operations:
calculating the minimum network segment of the IP address of the management equipment according to the IP address of the management equipment and the division rule of the IP address network segment;
and randomly selecting an IP address which is actually available for the equipment and is different from the IP address of the management equipment from the minimum network segment in which the IP address of the management equipment is positioned, and allocating the IP address to a second interface of the maintenance gateway.
The invention provides a self-adaptive maintenance method and a self-adaptive maintenance device for an IP address of a maintained device, which can automatically detect the IP addresses of the maintained device and a management device through a maintenance gateway under the condition of not knowing the IP address of the maintained device, and enable a maintainer to log in the maintained device for maintenance and management only by inputting a preset domain name on a Web browser of the management device through domain name resolution and conversion of a destination IP address and a source IP address of a data packet. The invention does not need to adjust the maintained equipment and the management equipment, is self-adaptive to the IP address of the maintained equipment, has simple operation, is convenient and quick, and does not need the maintenance personnel to have professional background knowledge.
Drawings
FIG. 1 is a flow chart of a maintenance method for adapting an IP address of a maintained device according to the present invention;
fig. 2 is a schematic diagram of a network structure in which a management device of this embodiment is connected to a device to be maintained through a maintenance gateway;
fig. 3 is a schematic structural diagram of a maintenance apparatus for adapting to an IP address of a maintained device according to the present invention.
Detailed Description
The technical solutions of the present invention are further described in detail below with reference to the drawings and examples, which should not be construed as limiting the present invention.
In this embodiment, a method for maintaining an IP address of a self-adaptive device to be maintained is applied to a maintenance gateway, as shown in fig. 1, a first interface 1 of the maintenance gateway is connected to the device to be maintained, and a second interface 2 of the maintenance gateway is connected to a management device, where the maintenance method includes:
step S1, the IP address of the maintained device and the IP address of the management device are obtained, the IP address of the first interface of the maintenance gateway is set to be the other IP address in the same network segment with the IP address of the maintained device, and the IP address of the second interface of the maintenance gateway is set to be the other IP address in the same network segment with the IP address of the management device.
In this embodiment, when login and maintenance management are required for a device that does not have a display interface and a serial port and does not know a management IP address, a maintenance person only needs to connect the device to be maintained to the first interface of the maintenance gateway through a network cable and connect a management device (a maintenance management PC in the figure) to the second interface of the maintenance gateway through a network cable as shown in fig. 2, and power up and start all devices.
After the equipment for communication based on the IP network is electrified and started, a free ARP data packet is sent to publish the IP address of the equipment, after other equipment in the local IP network receives the free ARP data packet, whether the IP address is the same as the IP address of the equipment or not is detected, if the IP address is the same as the IP address of the equipment, a message of IP address conflict is fed back, and the mechanism is used for avoiding the IP address conflict in the IP network.
In this embodiment, the maintenance gateway monitors the gratuitous ARP packet sent by the maintained device at the first interface by using the above mechanism, and after obtaining the gratuitous ARP packet sent by the maintained device, obtains the IP address of the maintained device from the source IP address field in the IP packet header of the gratuitous ARP packet. The maintenance gateway monitors a gratuitous ARP data packet sent by the management equipment at the second interface, and after the gratuitous ARP data packet sent by the management equipment is obtained, the IP address of the management equipment is obtained from a source IP address field in an IP packet header of the gratuitous ARP data packet.
It should be noted that, after the maintained device and the management device are powered on and started, the maintained device and the management device also send an ARP data packet requesting the gateway, so the maintenance gateway in this embodiment may also obtain the IP addresses of the maintained device and the management device from the source IP address fields of the IP headers of the ARP data packets of the requested gateway sent by the maintained device and the management device by intercepting the ARP data packets of the requested gateway sent by the maintained device and the management device.
After the maintenance gateway acquires the IP address of the device to be maintained, the maintenance gateway needs to allocate another IP address in the same network segment as the IP address of the device to be maintained to the first interface of the maintenance gateway, so that the first interfaces of the device to be maintained and the maintenance gateway can communicate with each other through the respective IP addresses. Since the maintenance gateway only obtains the IP address of the device to be maintained and cannot obtain the subnet mask of the device to be maintained, the maintenance gateway first calculates the minimum network segment where the device to be maintained is located, and then allocates an IP address different from the IP address of the device to be maintained to the first interface of the maintenance gateway from the minimum network segment where the device to be maintained is located, so as to ensure that the IP address of the device to be maintained and the IP address of the first interface of the maintenance gateway are IP addresses in the same network segment.
According to the dividing method of the IP address network segments, a C-type address segment can be divided into 2 different network segments by adopting a subnet mask with the length of 25 bits: x.x.x.0-x.x.x.127, x.x.x.128-x.x.x.255; a class C address segment can be divided into 4 different segments using a subnet mask with a length of 26 bits: the situation that the class C address segment is divided into different sub-network segments by adopting other sub-network masks with different lengths can be obtained by sequentially analogizing x.x.0-x.x.63, x.x.x.64-x.x.127, x.x.x.128-x.x.191 and x.x.192-x.x.255 … …. In an actual IP network, the minimum divided network segment is a network segment with a subnet mask length of 30 bits, and the network segment includes 4 IP addresses, wherein the minimum IP address is a network address, the maximum IP address is a broadcast address, and the middle 2 IP addresses are IP addresses that can be actually used by the device. If the IP address of the equipment is the IP address which can be actually used by the equipment in a certain network segment with the subnet mask length of 30 bits, the minimum network segment where the equipment is located is the network segment with the subnet mask length of 30 bits; if the IP address of the device is the network address or broadcast address in a network segment with a subnet mask length of 30 bits and is the IP address actually available to the device in a network segment with a subnet mask length of 29 bits, the minimum network segment in which the device is located is the network segment with the subnet mask length of 29 bits. And the like until the minimum network segment where the device is located is found.
The following is illustrated by way of example:
for example, the IP address of a certain device is 192.168.1.5, if the class C address segment 192.168.1.0/24 is divided by a subnet mask with a length of 30 bits, the divided network segments are 192.168.1.0 to 192.168.1.3, 192.168.1.4 to 192.168.1.7,192.168.1.8 to 192.168.1.11 … …, and the IP address actually available to the device in the network segment with a length of 192.168.1.5 of 192.168.1.4 to 192.168.1.7 is obtained, so that the minimum network segment with the IP address of 192.168.1.5 is 192.168.1.4 to 192.168.1.7.
For another example, the IP address of a certain device is 172.16.104.11, if the class C address segment 172.16.104.0/24 is divided by a subnet mask with a length of 30 bits, the divided network segments are 172.16.104.0-172.16.104.3,172.16.104.4-172.16.104.7,172.16.104.8-172.16.104.11 … …, and a broadcast address with a 172.16.104.11 of 172.16.104.8-172.16.104.11 network segment is obtained; and the network segments obtained by dividing the C-type address segment 172.16.104.0/24 by subnet masks with the length of 29 bits are 172.16.104.0-172.16.104.7,172.16.104.8-172.16.104.15,172.16.104.16-172.16.104.23 … …, so that the IP address which can be actually used by equipment in the network segment with 172.16.104.11 being 172.16.104.8-172.16.104.15 is obtained, and therefore the minimum network segment with the obtained IP address 172.16.104.11 is 172.16.104.8-172.16.104.15.
Through the method, the maintenance gateway of the embodiment calculates the minimum network segment where the maintained device is located according to the IP address of the maintained device, and then randomly allocates an IP address which can be actually used by a device different from the IP address of the maintained device to the first interface of the maintenance gateway from the minimum network segment.
In this embodiment, the maintenance gateway calculates the minimum network segment where the management device is located according to the IP address of the management device by the same method, and then randomly allocates an IP address that can be actually used by a device different from the IP address of the management device to the second interface of the maintenance gateway from the minimum network segment.
In this embodiment, after the IP address of the device to be maintained is obtained, whether two adjacent IP addresses of the IP address of the device to be maintained are network addresses or broadcast addresses of a certain network segment may be determined according to a partition rule of an IP address network segment, if one of the two adjacent IP addresses of the IP address of the device to be maintained is a network address or a broadcast address of a certain network segment, the other adjacent IP address of the device to be maintained is allocated to the first interface of the maintenance gateway, and if neither of the two adjacent IP addresses of the IP address of the device to be maintained is a network address or a broadcast address of a certain network segment, any one of the two IP addresses is allocated to the first interface of the maintenance gateway. The method can also ensure that the IP address of the maintained equipment and the IP address of the first interface of the maintenance gateway are in the same network segment. The present embodiment may also assign an IP address to the second interface of the maintenance gateway in the same way.
After the maintenance gateway allocates the IP addresses to the first interface and the second interface of the device, the device to be maintained and the first interface of the maintenance gateway and the management device and the second interface of the maintenance gateway can communicate with each other through their respective IP addresses.
Step S2, after receiving the domain name resolution request message sent by the management device, feeding back the IP address of the second interface of the maintenance gateway to the management device.
In this embodiment, when a maintenance person needs to log in a device to be maintained, a fixed domain name is input on a Web browser (e.g., IE) of a management device, where the domain name is a domain name, such as www.helloip.com, pre-configured in a domain name resolution server of a maintenance gateway.
And the management equipment sends a domain name resolution request message to the maintenance gateway according to the input domain name. The domain name is pre-configured in the domain name resolution server of the maintenance gateway, and the maintenance gateway automatically binds the domain name with the IP address allocated by the second interface after allocating the IP address to the second interface, so that the maintenance gateway sends the IP address of the second interface to the management device through the domain name resolution feedback message after receiving the domain name resolution request message sent by the management device. And the management equipment takes the received IP address of the second interface of the maintenance gateway as a destination IP address and initiates Web access to the maintained equipment.
Step S3, after receiving the data packet sent by the management device and having the destination IP address as the IP address of the second interface of the maintenance gateway, replacing the destination IP address of the data packet with the IP address of the device to be maintained, and replacing the source IP address of the data packet with the IP address of the first interface of the maintenance gateway, and then sending the data packet to the device to be maintained.
In this embodiment, after receiving a Web access packet whose destination IP address sent by a management device is an IP address of a second interface of a maintenance gateway, the maintenance gateway replaces the destination IP address of the Web access packet with an IP address of a device to be maintained from an IP address of the second interface of the maintenance gateway according to a predetermined IP address conversion policy, replaces a source IP address of the Web access packet with an IP address of a first interface of the maintenance gateway from an IP address of the management device, and then sends the source IP address of the Web access packet to the device to be maintained through the first interface of the maintenance gateway.
It should be noted that, after the maintained device receives the Web access packet sent by the first interface of the maintenance gateway, when the feedback is performed to the Web access data packet, the source IP address in the data packet is used as the destination IP address of the feedback data packet, if the maintenance gateway does not replace the source IP address of the maintenance gateway with the IP address of the first interface of the maintenance gateway from the IP address of the management device after receiving the Web access data packet sent by the management device, the feedback packet may not be sent because there is no route in the maintained device to the IP address of the managing device, therefore, the maintenance gateway needs to replace the source IP address of the Web access packet sent by the management device from the IP address of the management device to the IP address of the first interface of the maintenance gateway, so that the feedback packet of the Web access packet by the maintained device can be sent to the maintenance gateway and forwarded to the management device through the maintenance gateway.
In this embodiment, after receiving a data packet whose destination IP address subsequently sent by the management device is the IP address of the second interface of the maintenance gateway, the maintenance gateway replaces the destination IP address and the source IP address of the data packet according to the same IP address conversion method, and sends the data packet to the device to be maintained.
The following describes, by way of example, the conversion of the destination IP address and the source IP address of a packet during the transmission of the packet from the management device to the device to be maintained. For example, the IP addresses of the device to be maintained and the maintenance management PC obtained by the maintenance gateway are 192.168.1.4 and 172.16.104.11, respectively, the IP address allocated to the first interface of the maintenance gateway is 192.168.1.5, and the IP address allocated to the second interface of the maintenance gateway is 172.16.104.12. The destination IP address of the data packet sent by the maintenance management PC is 172.16.104.12, the source IP address is 172.16.104.11, after the maintenance gateway receives the data packet sent by the maintenance management PC, the destination IP address of the data packet is replaced by 192.168.1.4 from 172.16.104.12, and the source IP address is replaced by 192.168.1.5 from 172.16.104.11, and then the data packet is sent to the maintenance management PC.
Step S4, after receiving the data packet sent by the device to be maintained and having the destination IP address as the IP address of the first interface of the maintenance gateway, replacing the destination IP address of the data packet with the IP address of the management device, and replacing the source IP address of the data packet with the IP address of the second interface of the maintenance gateway, and then sending the data packet to the management device.
After receiving the Web access packet forwarded by the maintenance gateway, the maintained device of this embodiment sends a feedback packet of the Web access packet. The destination IP address of the feedback data packet is the source IP address of the received Web access data packet (i.e., the IP address of the first interface of the maintenance gateway), and the source IP address of the feedback data packet is the IP address of the device to be maintained.
After receiving a feedback data packet which is sent by the maintained device and has a destination IP address as the IP address of the first interface of the maintaining gateway, the maintaining gateway replaces the destination IP address of the feedback data packet with the IP address of the managing device from the IP address of the first interface of the maintaining gateway according to a preset IP address conversion strategy, replaces the source IP address of the feedback data packet with the IP address of the second interface of the maintaining gateway from the IP address of the maintained device, and then sends the feedback data packet to the managing device through the second interface of the maintaining gateway.
In this embodiment, after receiving a data packet whose destination IP address subsequently sent by the device to be maintained is the IP address of the first interface of the maintenance gateway, the maintenance gateway replaces the destination IP address and the source IP address of the data packet according to the same IP address conversion method, and sends the data packet to the management device.
It should be noted that, in this embodiment, when performing IP address translation on a data packet sent by a management device or a device to be maintained, the maintenance gateway only translates a destination IP address and a source IP address of the data packet, and the TCP and UDP port numbers of the data packet remain unchanged, so that a TCP and UDP connection between the management device and the device to be maintained can be normally established, and the management device can log in the device to be maintained and perform maintenance management.
By the method, the embodiment realizes login and maintenance management of the maintained equipment without knowing the management IP address through the maintenance gateway and the management equipment without any adjustment on the maintained equipment and the management equipment, is simple to operate, is convenient and quick, and does not require maintenance personnel to have professional background knowledge.
The embodiment further provides a maintenance apparatus for adapting to an IP address of a device to be maintained, which corresponds to the foregoing method, and is applied to a maintenance gateway, as shown in fig. 3, where the maintenance apparatus includes:
the interface IP address setting module is used for acquiring the IP address of the maintained equipment and the IP address of the management equipment, setting the IP address of the first interface of the maintenance gateway as other IP addresses in the same network segment with the IP address of the maintained equipment, and setting the IP address of the second interface of the maintenance gateway as other IP addresses in the same network segment with the IP address of the management equipment;
the domain name resolution module is used for feeding back the IP address of the second interface of the maintenance gateway to the management equipment after receiving the domain name resolution request message sent by the management equipment;
the first data packet forwarding module is used for replacing the target IP address of the data packet with the IP address of the maintained device after receiving the data packet which is sent by the management device and has the target IP address of the second interface of the maintenance gateway, and sending the data packet to the maintained device after replacing the source IP address of the data packet with the IP address of the first interface of the maintenance gateway;
and the second data packet forwarding module is used for replacing the destination IP address of the data packet with the IP address of the management equipment after receiving the data packet which is sent by the maintained equipment and has the destination IP address as the IP address of the first interface of the maintenance gateway, and sending the data packet to the management equipment after replacing the source IP address of the data packet with the IP address of the second interface of the maintenance gateway.
The interface IP address setting module of this embodiment obtains the IP address of the device to be maintained, and executes the following operations:
monitoring a free ARP data packet sent by a maintained device at a first interface;
and obtaining the IP address of the maintained equipment from the source IP address field in the IP packet header of the gratuitous ARP data packet sent by the maintained equipment.
The interface IP address setting module of this embodiment obtains an IP address of the management device, and executes the following operations:
monitoring a free ARP data packet sent by the management equipment at a second interface;
and acquiring the IP address of the management equipment from a source IP address field in an IP packet header of a gratuitous ARP data packet sent by the management equipment.
The interface IP address setting module in this embodiment sets the IP address of the first interface of the maintenance gateway to be another IP address in the same network segment as the IP address of the device to be maintained, and executes the following operations:
calculating the minimum network segment of the IP address of the maintained equipment according to the IP address of the maintained equipment and the division rule of the IP address network segment;
and randomly selecting an IP address which is actually available for the equipment and is different from the IP address of the equipment to be maintained from the minimum network segment in which the IP address of the equipment to be maintained is positioned, and allocating the IP address to the first interface of the maintenance gateway.
The interface IP address setting module of this embodiment sets the IP address of the second interface of the maintenance gateway to another IP address in the same network segment as the IP address of the management device, and executes the following operations:
calculating the minimum network segment of the IP address of the management equipment according to the IP address of the management equipment and the division rule of the IP address network segment;
and randomly selecting an IP address which is actually available for the equipment and is different from the IP address of the management equipment from the minimum network segment in which the IP address of the management equipment is positioned, and allocating the IP address to a second interface of the maintenance gateway.
It should be noted that the maintenance gateway in this embodiment may be deployed alone as an independent hardware device, may be deployed in a device to be maintained, or may be deployed in an IP switch or a wireless router.
The above embodiments are only for illustrating the technical solution of the present invention and not for limiting the same, and those skilled in the art can make various corresponding changes and modifications according to the present invention without departing from the spirit and the essence of the present invention, but these corresponding changes and modifications should fall within the protection scope of the appended claims.

Claims (10)

1. A maintenance method of self-adapting maintained equipment IP address is applied to a maintenance gateway, a first interface of the maintenance gateway is connected with maintained equipment, a second interface of the maintenance gateway is connected with a management device, and the maintenance method of self-adapting maintained equipment IP address comprises the following steps:
the method comprises the steps that ARP data packets are intercepted on a first interface and a second interface to obtain an IP address of a maintained device and an IP address of a management device, the IP address of the first interface of a maintenance gateway is set to be other IP addresses in the same network segment with the IP address of the maintained device, and the IP address of the second interface of the maintenance gateway is set to be other IP addresses in the same network segment with the IP address of the management device;
after receiving a domain name resolution request message sent by the management equipment, feeding back an IP address of a second interface of the maintenance gateway to the management equipment;
after receiving a data packet which is sent by the management device and has a destination IP address which is the IP address of the second interface of the maintenance gateway, replacing the destination IP address of the data packet with the IP address of the device to be maintained, and replacing the source IP address of the data packet with the IP address of the first interface of the maintenance gateway, and sending the data packet to the device to be maintained;
and after receiving a data packet which is sent by the maintained equipment and has the destination IP address of the first interface of the maintenance gateway, replacing the destination IP address of the data packet with the IP address of the management equipment, replacing the source IP address of the data packet with the IP address of the second interface of the maintenance gateway, and sending the data packet to the management equipment.
2. The method for maintaining an adaptive maintained device IP address according to claim 1, wherein the obtaining the maintained device IP address comprises:
monitoring a free ARP data packet sent by a maintained device at a first interface;
and obtaining the IP address of the maintained equipment from the source IP address field in the IP packet header of the gratuitous ARP data packet sent by the maintained equipment.
3. The method for maintaining an adaptive IP address of a maintained device according to claim 1, wherein the obtaining an IP address of a management device comprises:
monitoring a free ARP data packet sent by the management equipment at a second interface;
and acquiring the IP address of the management equipment from a source IP address field in an IP packet header of a gratuitous ARP data packet sent by the management equipment.
4. The method of claim 1, wherein the setting the IP address of the first interface of the maintenance gateway to be another IP address in the same network segment as the IP address of the device to be maintained comprises:
calculating the minimum network segment of the IP address of the maintained equipment according to the IP address of the maintained equipment and the division rule of the IP address network segment;
and randomly selecting an IP address which is actually available for the equipment and is different from the IP address of the equipment to be maintained from the minimum network segment in which the IP address of the equipment to be maintained is positioned, and allocating the IP address to the first interface of the maintenance gateway.
5. The method for maintaining the IP address of the self-adaptive device to be maintained according to claim 1, wherein the setting the IP address of the second interface of the maintenance gateway to be another IP address in the same network segment as the IP address of the management device comprises:
calculating the minimum network segment of the IP address of the management equipment according to the IP address of the management equipment and the division rule of the IP address network segment;
and randomly selecting an IP address which is actually available for the equipment and is different from the IP address of the management equipment from the minimum network segment in which the IP address of the management equipment is positioned, and allocating the IP address to a second interface of the maintenance gateway.
6. A maintenance device for adapting to IP address of maintained device is applied to maintain gateway, the first interface of the maintenance gateway is connected with the maintained device, the second interface of the maintenance gateway is connected with management device, the maintenance device for adapting to IP address of maintained device includes:
the interface IP address setting module is used for intercepting the ARP data packet on the first interface and the second interface to obtain the IP address of the maintained equipment and the IP address of the management equipment, setting the IP address of the first interface of the maintenance gateway as other IP addresses in the same network segment with the IP address of the maintained equipment, and setting the IP address of the second interface of the maintenance gateway as other IP addresses in the same network segment with the IP address of the management equipment;
the domain name resolution module is used for feeding back the IP address of the second interface of the maintenance gateway to the management equipment after receiving the domain name resolution request message sent by the management equipment;
the first data packet forwarding module is used for replacing the target IP address of the data packet with the IP address of the maintained device after receiving the data packet which is sent by the management device and has the target IP address of the second interface of the maintenance gateway, and sending the data packet to the maintained device after replacing the source IP address of the data packet with the IP address of the first interface of the maintenance gateway;
and the second data packet forwarding module is used for replacing the destination IP address of the data packet with the IP address of the management equipment after receiving the data packet which is sent by the maintained equipment and has the destination IP address as the IP address of the first interface of the maintenance gateway, and sending the data packet to the management equipment after replacing the source IP address of the data packet with the IP address of the second interface of the maintenance gateway.
7. The apparatus for maintaining an adaptive IP address of a device to be maintained according to claim 6, wherein the interface IP address setting module obtains the IP address of the device to be maintained, and performs the following operations:
monitoring a free ARP data packet sent by a maintained device at a first interface;
and obtaining the IP address of the maintained equipment from the source IP address field in the IP packet header of the gratuitous ARP data packet sent by the maintained equipment.
8. The apparatus for maintaining an adaptive IP address of a maintained device according to claim 6, wherein the interface IP address setting module obtains an IP address of a management device, and performs the following operations:
monitoring a free ARP data packet sent by the management equipment at a second interface;
and acquiring the IP address of the management equipment from a source IP address field in an IP packet header of a gratuitous ARP data packet sent by the management equipment.
9. The apparatus for maintaining an adaptive IP address of a device to be maintained according to claim 6, wherein the interface IP address setting module sets the IP address of the first interface of the maintenance gateway to be another IP address in the same network segment as the IP address of the device to be maintained, and performs the following operations:
calculating the minimum network segment of the IP address of the maintained equipment according to the IP address of the maintained equipment and the division rule of the IP address network segment;
and randomly selecting an IP address which is actually available for the equipment and is different from the IP address of the equipment to be maintained from the minimum network segment in which the IP address of the equipment to be maintained is positioned, and allocating the IP address to the first interface of the maintenance gateway.
10. The apparatus for maintaining an adaptive IP address of a device to be maintained according to claim 6, wherein the interface IP address setting module sets the IP address of the second interface of the maintenance gateway to another IP address in the same network segment as the IP address of the management device, and performs the following operations:
calculating the minimum network segment of the IP address of the management equipment according to the IP address of the management equipment and the division rule of the IP address network segment;
and randomly selecting an IP address which is actually available for the equipment and is different from the IP address of the management equipment from the minimum network segment in which the IP address of the management equipment is positioned, and allocating the IP address to a second interface of the maintenance gateway.
CN201610962066.8A 2016-11-04 2016-11-04 Self-adaptive maintenance method and device for IP address of maintained equipment Active CN106534290B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610962066.8A CN106534290B (en) 2016-11-04 2016-11-04 Self-adaptive maintenance method and device for IP address of maintained equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610962066.8A CN106534290B (en) 2016-11-04 2016-11-04 Self-adaptive maintenance method and device for IP address of maintained equipment

Publications (2)

Publication Number Publication Date
CN106534290A CN106534290A (en) 2017-03-22
CN106534290B true CN106534290B (en) 2020-04-10

Family

ID=58326953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610962066.8A Active CN106534290B (en) 2016-11-04 2016-11-04 Self-adaptive maintenance method and device for IP address of maintained equipment

Country Status (1)

Country Link
CN (1) CN106534290B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111615132A (en) * 2020-05-22 2020-09-01 南京金税网安系统软件有限公司 Multi-class equipment normalization network maintenance method and maintenance system
CN111641733B (en) * 2020-06-07 2021-04-02 深圳市乙辰科技股份有限公司 Network bridge equipment management method and device and readable storage medium
CN112019653B (en) * 2020-09-09 2022-08-12 迈普通信技术股份有限公司 Access switch, IP address deployment method, device and readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006229550A (en) * 2005-02-17 2006-08-31 Hitachi Communication Technologies Ltd VoIP-GW APPARATUS
CN101582904A (en) * 2009-06-17 2009-11-18 杭州华三通信技术有限公司 Implementation method of symmetry of multi-line access flow rate of data center, device and system
CN101729606A (en) * 2008-10-22 2010-06-09 华为技术有限公司 Method and relevant equipment for realizing network address conversion
CN102055599A (en) * 2009-11-10 2011-05-11 唐方 Network management equipment for network management of computer
CN103944760A (en) * 2014-04-17 2014-07-23 杭州华三通信技术有限公司 NAT-traversal network managing method and device
CN104283783A (en) * 2014-10-11 2015-01-14 杭州华三通信技术有限公司 Gateway equipment message transmitting method and device in plug and play network
CN104618243A (en) * 2015-02-28 2015-05-13 华为技术有限公司 Routing method, device and system, and gateway scheduling method and device
CN105592175A (en) * 2014-10-24 2016-05-18 中兴通讯股份有限公司 Method and apparatus for redirection to web page

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101316682B1 (en) * 2009-12-15 2013-10-10 한국전자통신연구원 TNL Connection Setup Method and Apparatus for Base Station Using Downlink Receiver

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006229550A (en) * 2005-02-17 2006-08-31 Hitachi Communication Technologies Ltd VoIP-GW APPARATUS
CN101729606A (en) * 2008-10-22 2010-06-09 华为技术有限公司 Method and relevant equipment for realizing network address conversion
CN101582904A (en) * 2009-06-17 2009-11-18 杭州华三通信技术有限公司 Implementation method of symmetry of multi-line access flow rate of data center, device and system
CN102055599A (en) * 2009-11-10 2011-05-11 唐方 Network management equipment for network management of computer
CN103944760A (en) * 2014-04-17 2014-07-23 杭州华三通信技术有限公司 NAT-traversal network managing method and device
CN103944760B (en) * 2014-04-17 2017-07-04 新华三技术有限公司 The network management and device of a kind of passing through NAT
CN104283783A (en) * 2014-10-11 2015-01-14 杭州华三通信技术有限公司 Gateway equipment message transmitting method and device in plug and play network
CN105592175A (en) * 2014-10-24 2016-05-18 中兴通讯股份有限公司 Method and apparatus for redirection to web page
CN104618243A (en) * 2015-02-28 2015-05-13 华为技术有限公司 Routing method, device and system, and gateway scheduling method and device

Also Published As

Publication number Publication date
CN106534290A (en) 2017-03-22

Similar Documents

Publication Publication Date Title
US11075802B2 (en) Methods for dynamic router configuration in a mesh network
US10476843B2 (en) Firewall configured with dynamic membership sets representing machine attributes
US10122679B2 (en) Method, relay agent, and system for acquiring internet protocol address in network
JP4072536B2 (en) Network device dynamic port configuration
CN105933198B (en) Device for establishing direct connection VPN tunnel
US7590733B2 (en) Dynamic address assignment for access control on DHCP networks
US7836203B2 (en) Automatic route setup via snooping dynamic addresses
US7657011B1 (en) Lawful intercept trigger support within service provider networks
EP2882162B1 (en) Data stream security processing method and apparatus
US8898265B2 (en) Determining data flows in a network
US20170026462A1 (en) Load balancing method, apparatus and system
US20110141944A1 (en) Topology discovery of a private network
EP1013045A1 (en) Method and apparatus for dynamic packet filter assignment
DE112013002272T5 (en) Protect ARP / ND cache from denial-of-service attacks
KR101320962B1 (en) Management method and management device for network address translation
US20060161652A1 (en) Network system
CN106534290B (en) Self-adaptive maintenance method and device for IP address of maintained equipment
CN102984031B (en) Method and device for allowing encoding equipment to be safely accessed to monitoring and control network
CN105979202B (en) Data transmission method and device
US20170063635A1 (en) Apparatus and method for controlling network service in environment of interworking between software defined network and legacy network
JP2011015095A (en) Communication apparatus, address setting method, and address setting program
CN108353027B (en) Software defined network system and method for detecting port fault
US20150229520A1 (en) Network monitoring system, communication device, network management method
EP3011708B1 (en) System for the routing of data to computer networks
EP3029913A1 (en) Method for processing raw ip packet, and corresponding apparatus

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant