CN105357330B - A kind of system and method for the IP address conflict for preventing the network equipment - Google Patents

A kind of system and method for the IP address conflict for preventing the network equipment Download PDF

Info

Publication number
CN105357330B
CN105357330B CN201510695285.XA CN201510695285A CN105357330B CN 105357330 B CN105357330 B CN 105357330B CN 201510695285 A CN201510695285 A CN 201510695285A CN 105357330 B CN105357330 B CN 105357330B
Authority
CN
China
Prior art keywords
address
conflict
value
variable
judge
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
CN201510695285.XA
Other languages
Chinese (zh)
Other versions
CN105357330A (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.)
Huzhou YingLie Intellectual Property Operation Co.,Ltd.
Original Assignee
Shanghai Feixun Data Communication Technology 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201510695285.XA priority Critical patent/CN105357330B/en
Publication of CN105357330A publication Critical patent/CN105357330A/en
Application granted granted Critical
Publication of CN105357330B publication Critical patent/CN105357330B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses
    • 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
    • H04L61/2521Translation architectures other than single NAT servers
    • H04L61/2535Multiple local networks, e.g. resolving potential IP address conflicts

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a kind of system and method for the IP address conflict for preventing the network equipment, the system for preventing the IP address conflict of the network equipment, applied in the network equipment, including:Judging unit connects the Wide Area Network interface and the lan interfaces respectively, conflicts to judge that first address whether there is with second address, and provides a mark in there are the conflict is represented during the conflict;Processing unit, connect the judging unit and the allocation unit, when first address and second address conflict, the processing unit is discharging first address, and second address is changed with pre-defined rule, the allocation unit is controlled to distribute IP address according to client of second address after change again to be connected with the lan interfaces and generate conflicting information and router reboot event prompting according to the mark.When a conflict exists, LAN mouthfuls of IP address can be changed by allocation unit to be solved.

Description

A kind of system and method for the IP address conflict for preventing the network equipment
Technical field
The present invention relates to technical field of network communication more particularly to a kind of systems for the IP address conflict for preventing the network equipment And method.
Background technology
Existing router largely considers wide area network (WAN, Wide Area Network)/LAN (Local Area Network, LAN) IP address conflict when, it is only for when WEB page configures LAN mouthfuls of IP address not with WAN mouthfuls For IP address in the same network segment, some routers can support active detecting WAN/LAN with the presence or absence of conflict, not consider when WAN mouthfuls By the IP address that DHCP is got and client by the IP address of LAN mouthfuls of acquisitions it is identical when, at this moment user cannot be introduced into road The problem of being modified by the WEB page of device to the IP address of conflict.The method for detecting conflict simultaneously is only to detect whether The same network segment does not judge whether in consolidated network, and in case of detected collisions, there is no give any prompting of user Information, but directly give way and opened by thinking highly of, it will usually user is allowed to take for router failure.
The content of the invention
For the above problem existing for existing router, a kind of WAN mouths acquisition aimed at when router is now provided When the IP address arrived conflicts with the IP address presence of LAN, the IP for preventing the network equipment of LAN mouthfuls of IP address can be changed The system and method for location conflict.
Specific technical solution is as follows:
A kind of system for the IP address conflict for preventing the network equipment, applied in router, including:
Wide Area Network interface, to provide one first address for the router;
Lan interfaces connect at least one client, and the second address for being associated with a LAN according to one, in described It works in LAN;
Allocation unit connects the lan interfaces, to distribute IP according to second address for the client Location;
It further includes:
Judging unit connects the Wide Area Network interface and the lan interfaces respectively, to judge first address It whether there is with second address and conflict, and provide a mark in there are the conflict is represented during the conflict;
Processing unit connects the judging unit and the allocation unit, when first address and second address During conflict, the processing unit changes second address to discharge first address with pre-defined rule, described in control Allocation unit distributes IP address according to client of second address after change again to be connected with the lan interfaces, And conflicting information and router reboot event prompting are generated according to the mark.
Preferably, further include:
Display unit connects the processing unit, to show that the conflicting information and the router restart prompting thing Part.
Preferably, the judging unit includes:
First judgment module, to judge whether first address and second address are identical;
Second judgment module connects first judgment module, to judge first address and second address Whether the same network segment is in;
3rd judgment module connects second judgment module, judging in first address of different segment and Whether second address is in consolidated network.
Preferably, the detailed process of the second judgment module judgement is:
When first address and second address differ, obtain subnet corresponding with first address and cover First address conversion is the value of integer type, and the value of acquisition is assigned to the first variable by code, and the subnet mask is turned The value of integer type is changed, and the value of acquisition is assigned to the second variable;
Subnet mask corresponding with second address is obtained, by the value that second address conversion is integer type, and will The value of acquisition is assigned to ternary, and the subnet mask is converted to the value of integer type, and the value of acquisition is assigned to the 4th Variable;
Judge the first variable and the second variable carried out with the value that computing obtains with ternary and the 4th variable and fortune Whether equal calculate the value obtained.
Preferably, the detailed process of the 3rd judgment module judgement is:
By the second variable and the 4th variable carries out and computing, and the value for making acquisition is the 5th variable;
Judge the first variable and the 5th variable carried out with the value that computing obtains with ternary and the 5th variable and fortune Whether equal calculate the value obtained.
Preferably, the pre-defined rule includes, when first address and second address conflict, and the IP to conflict Location be the c classes net IP address when, by second address be revised as a class nets IP address and/or
When first address and second address conflict, and during IP address that the IP address to conflict is a classes net, By second address be revised as b class nets IP address and/or
When first address and second address conflict, and during IP address that the IP address to conflict is the b classes net, Second address is revised as to the IP address of c class nets.
Preferably, the pre-defined rule is further included when first address and second address conflict, and the IP to conflict When address is not admitted to a classes net, the b classes net and the c classes net, second address is revised as to the IP of c class nets Location.
A kind of method for the IP address conflict for preventing the network equipment, using the IP address for preventing the network equipment as described above The system of conflict, comprises the following steps:
S1. first address and second address are judged with the presence or absence of conflict, are identified if so, providing one in depositing The conflict is represented in the conflict, performs step S2;If it is not, then terminate;
S2. when first address and second address conflict, first address is discharged, and is changed with pre-defined rule Become second address, distributed according to client of second address after change again to be connected with the lan interfaces It IP address and conflicting information and the router reboot event is generated according to the mark prompts;
S3. restart prompting event to the conflicting information and the router to show.
Preferably, the step S1 includes:
S11. judge whether first address and second address are identical, if so, providing a mark to represent Conflict is stated, performs the step S2;If it is not, perform step S12;
S12. judge whether first address is in the same network segment with second address, if it is not, performing step S13; If so, providing a mark to represent the conflict, the step S2 is performed;
S13. whether judge in first address of different segment and second address in consolidated network, if so, A mark is then provided to represent the conflict, the step S2 is performed, if it is not, then terminating.
Preferably, the specific deterministic process of the step S12 is:
Subnet mask corresponding with first address is obtained, by the value that first address conversion is integer type, and will The value of acquisition is assigned to the first variable, and the second change is assigned to by the value of the subnet mask convert integer type, and by the value of acquisition Amount;
Subnet mask corresponding with second address is obtained, by the value that second address conversion is integer type, and will The value of acquisition is assigned to ternary, and the subnet mask is converted to the value of integer type, and the value of acquisition is assigned to the 4th Variable;
Judge the first variable and the second variable carried out with the value that computing obtains with ternary and the 4th variable and fortune Whether equal the value obtained is calculated, if it is not, performing the step S13;If so, providing a mark to represent the conflict, perform The step S2.
Preferably, the specific deterministic process of the step S13 is:
By the second variable and the 4th variable carries out and computing, and the value for making acquisition is the 5th variable;
Judge the first variable and the 5th variable carried out with the value that computing obtains with ternary and the 5th variable and fortune It whether equal calculates the value obtained, if so, providing a mark to represent the conflict, the step S2 is performed, if it is not, then tying Beam.
Preferably, the pre-defined rule includes, when first address and second address conflict, and the IP to conflict Location be the c classes net IP address when, by second address be revised as a class nets IP address and/or
When first address and second address conflict, and during IP address that the IP address to conflict is a classes net, By second address be revised as b class nets IP address and/or
When first address and second address conflict, and during IP address that the IP address to conflict is the b classes net, Second address is revised as to the IP address of c class nets.
Preferably, the pre-defined rule is further included when first address and second address conflict, and the IP to conflict When address is not admitted to a classes net, the b classes net and the c classes net, second address is revised as to the IP of c class nets Location.
The advantageous effect of above-mentioned technical proposal:
In the technical program, WAN/ can determine whether by judging unit in the system for preventing the IP address conflict of the network equipment LAN when a conflict exists, can change the IP address of LAN mouthfuls of clients to be solved with the presence or absence of conflict by allocation unit. It, can be by discharging the first ground with WAN mouthfuls in the method for preventing the IP address conflict of the network equipment when WAN/LAN conflicts Location, to avoid cannot be introduced into the problem of WEB page just changes IP address.
Description of the drawings
Fig. 1 is a kind of module map of embodiment of the system of the IP address conflict of the present invention for preventing the network equipment;
Fig. 2 is a kind of method flow of embodiment of the method for the IP address conflict of the present invention for preventing the network equipment Figure;
Fig. 3 is the method stream of another embodiment of the method for the IP address conflict of the present invention for preventing the network equipment Cheng Tu.
Specific embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art obtained on the premise of creative work is not made it is all its His embodiment, belongs to the scope of protection of the invention.
It should be noted that in the case where there is no conflict, the feature in embodiment and embodiment in the present invention can phase Mutually combination.
The invention will be further described in the following with reference to the drawings and specific embodiments, but not as limiting to the invention.
As shown in Figure 1, a kind of system for the IP address conflict for preventing the network equipment, applied in router, including:
Wide Area Network interface 1, to provide one first address for router;
Lan interfaces 3 connect at least one client, and the second address for being associated with a LAN according to one, in office It works in the net of domain;
Allocation unit 4 connects lan interfaces 3, to distribute IP address according to the second address for client;
It further includes:
Judging unit 2, difference connecting wan interface 1 and lan interfaces 3, to judge the first address and the second address With the presence or absence of conflict, and a mark is provided in there are conflict is represented during the conflict;
Processing unit 5, connection judgment unit 2 and allocation unit 4, when the first address and the second address conflict, processing is single Member 5 changes second address to discharge the first address with pre-defined rule, and control allocation unit 4 is according to the institute after change The client that the second address is stated again to be connected with lan interfaces 3 distributes IP address and according to the mark generation conflict Information and the prompting of router reboot event.
In the present embodiment, router supports DHCP (Dynamic Host Configuration Protocol, dynamic Host configuration) function.It can determine whether that WAN/LAN with the presence or absence of conflict, when a conflict exists, can lead to by judging unit 2 The release of processing unit 5 and the first address of WAN mouths are crossed, avoids the problem that cannot be introduced into WEB page just changes IP address, can lead to It crosses allocation unit 4 and changes the IP address of LAN mouthfuls of clients to be solved.
In a preferred embodiment, may also include:
Display unit 6, connection processing unit 5, to show that conflicting information and router restart prompting event.
In the present embodiment, when a conflict exists, the conflict page can be shown by display unit 6, and promotes user's routing Think highly of the new IP address that in opening and LAN mouthfuls are not replaced, user is facilitated to understand the current operating status of router.
In a preferred embodiment, judging unit 2 may include:
First judgment module 21, to judge whether the first address is identical with the second address;
Second judgment module 22 connects the first judgment module 21, to judge whether the first address is in the second address The same network segment;
3rd judgment module 23 connects the second judgment module 22, to judge in the first address of different segment and second Whether address is in consolidated network.
In the present embodiment, WAN/LAN mouthfuls of conflict may include that three classes are respectively:The production identical with the second address of first address Raw conflict, the first address and the second address be in the generation of the same network segment conflict and the first address with the second address in same The conflict that network generates.
In a preferred embodiment, the detailed process of the second judgment module 22 judgement is:
When the first address and the second address differ, subnet mask corresponding with the first address is obtained, by the first address The value of integer type is converted to, and the value of acquisition is assigned to the first variable, by the value of subnet mask convert integer type, and will be obtained Value be assigned to the second variable;
Corresponding with the second address subnet mask is obtained, by the value that the second address conversion is integer type, and by the value of acquisition Ternary is assigned to, subnet mask is converted to the value of integer type, and the value of acquisition is assigned to the 4th variable;
Judge the first variable and the second variable carried out with the value that computing obtains with ternary and the 4th variable and fortune Whether equal calculate the value obtained.
In the present embodiment, during the normal electrifying startup of router, WAN mouthfuls of access cables, client enters the WEB of router The page configures the mode of WAN mouthfuls of acquisition IP address in WEB page and obtains (i.e. DHCP) mode to be automatic, and normally gets IP address.
After router gets WAN mouthfuls of IP address, judge whether the IP address got and LAN mouthfuls of IP address deposit Conflicting.The value that WAN mouthfuls of the first address (IP address) is converted into integer type by the second judgment module 22 is assigned to first Variable WANIP, the value that WAN mouthfuls of subnet mask is converted into integer type are assigned to the second variable WANMASK;By LAN mouthfuls of IP The value of address conversion into integer type is assigned to ternary LANIP, and LAN mouthfuls of subnet mask is converted into the value assignment of integer type To the 4th variables L ANMASK, judge that WANIP and WANMASK carries out the progress with the value that computing obtains and LANIP and LANMASK It is whether equal with the computing value obtained, if equal, then it represents that WAN/LAN is in the same network segment, there is conflict, and provides a mark To represent conflict.
In a preferred embodiment, the detailed process of the 3rd judgment module 23 judgement is:
By the second variable and the 4th variable carries out and computing, and the value for making acquisition is the 5th variable;
Judge the first variable and the 5th variable carried out with the value that computing obtains with ternary and the 5th variable and fortune Whether equal calculate the value obtained.
In the present embodiment, when WANIP and WANMASK carries out the progress with the value that computing obtains and LANIP and LANMASK When the value obtained with computing is unequal, WANMASK and LANMASK are carried out with computing and will obtained using the 3rd judgment module 23 The value that takes assigns the 5th variable ENMASK, judge WANIP and ENMASK carry out with the value that computing obtains and LANIP and ENMASK into Whether row and the computing value obtained are equal, if equal, then it represents that WAN/LAN is in consolidated network, there is conflict, and provides a mark Know to represent to conflict.
In a preferred embodiment, the pre-defined rule includes, when first address and second address conflict, and When the IP address of conflict is the IP address of the c classes net, second address is revised as to the IP address of a class nets.
Wherein, a classes net IP address is:10.0.0.0 the address of~10.255.255.255, c class net IP address are: 192.168.0.0~192.168.255.255.
In the present embodiment, after conflict is detected, current WAN/ can be represented by setting variable conflict_flag LAN exist conflict, when WAN mouthful obtain IP address it is identical with the IP address that LAN mouthfuls of clients obtain, since router default is straight Connect away WAN mouthfuls, so as to cause client can not access router WEB page, therefore after detecting conflict, pass through processing unit 5 The IP address of WAN mouthfuls of release.When client user asks WEB page, judge to be by this variable of conflict_flag It is no to there is conflict, if it is present directly showing the conflict page to user, and customer router is prompted to restart and match again LAN mouth IP address afterwards.The rule change of wherein LAN mouthfuls of IP address is, if detecting LAN mouthfuls of IP address 192.168.2.1 When conflicting with WAN mouthfuls, LAN mouthfuls of IP address are changed to 10.10.10.1.
In a preferred embodiment, the pre-defined rule includes, when first address and second address conflict, and When the IP address of conflict is the IP address of a classes net, second address is revised as to the IP address of b class nets.
Wherein, b classes net IP address is:172.16.0.0~172.31.255.255.
In the present embodiment, if detect that LAN mouthfuls of IP address 10.10.10.1 conflict with WAN mouthfuls, by LAN mouthfuls of IP Location is changed to 172.16.10.1.
In a preferred embodiment, the pre-defined rule includes, when first address and second address conflict, and When the IP address of conflict is the IP address of the b classes net, second address is revised as to the IP address of c class nets.
In the present embodiment, if detect that LAN mouthfuls of IP address 172.16.10.1 conflict with WAN mouthfuls, by LAN mouthfuls of IP Address is changed to 192.168.2.1.
In a preferred embodiment, the pre-defined rule is further included when first address and second address conflict, And c is revised as when being not admitted to a classes net, the b classes net and the c classes net in second address by the IP address of conflict The IP address of class net.
As shown in Fig. 2, a kind of method for the IP address conflict for preventing the network equipment, applied to the IP for preventing the network equipment The system of location conflict, comprises the following steps:
S1. judge that the first address, with the presence or absence of conflicting, is identified if so, providing one in there are the punchings with the second address The conflict is represented when prominent, performs step S2;If it is not, then terminate;
S2. when first address and second address conflict, first address is discharged, and is changed with pre-defined rule Become second address, distributed according to client of second address after change again to be connected with the lan interfaces It IP address and conflicting information and the router reboot event is generated according to the mark prompts;
S3. restart prompting event to conflicting information and router to show.
In the present embodiment, by judging that WAN/LAN with the presence or absence of conflict, when a conflict exists, can pass through release and WAN Mouthful the first address, avoids the problem that cannot be introduced into WEB page just changes IP address, can be by changing LAN mouthfuls of clients IP address is solved, while the conflict page can be shown by a display unit, and promoted during customer router is restarted and The LAN mouthfuls of new IP address do not replaced facilitate user to understand the current operating status of router.
As shown in figure 3, in a preferred embodiment, step S1 includes:
S11. judge whether the first address is identical with the second address, if so, providing a mark in there are the conflicts When represent the conflict, perform step S2;If it is not, perform step S12;
S12. judge whether the first address is in the same network segment with the second address, if it is not, performing step S13;If so, it carries For a mark in there are the conflict, execution step S2 are represented during the conflict;
S13. whether judge in the first address of different segment and the second address in consolidated network, if so, providing one Mark is in there are the conflict, execution step S2, if it is not, then terminating are represented during the conflict.
In the present embodiment, WAN/LAN mouthfuls of conflict may include that three classes are respectively:The production identical with the second address of first address Raw conflict, the first address and the second address be in the generation of the same network segment conflict and the first address with the second address in same The conflict that network generates.
In a preferred embodiment, the specific deterministic process of step S12 is:
Corresponding with the first address subnet mask is obtained, by the value that the first address conversion is integer type, and by the value of acquisition The first variable is assigned to, the second variable is assigned to by the value of subnet mask convert integer type, and by the value of acquisition;
Corresponding with the second address subnet mask is obtained, by the value that the second address conversion is integer type, and by the value of acquisition Ternary is assigned to, subnet mask is converted to the value of integer type, and the value of acquisition is assigned to the 4th variable;
Judge the first variable and the second variable carried out with the value that computing obtains with ternary and the 4th variable and fortune Whether equal the value obtained is calculated, if it is not, performing step S13;If so, a mark is provided in there are institute is represented during the conflict Conflict is stated, performs step S2.
In the present embodiment, during the normal electrifying startup of router, WAN mouthfuls of access cables, client enters the WEB of router The page configures the mode of WAN mouthfuls of acquisition IP address in WEB page and obtains (i.e. DHCP) mode to be automatic, and normally gets IP address.
After router gets WAN mouthfuls of IP address, judge whether the IP address got and LAN mouthfuls of IP address deposit Conflicting.First variable WANIP is assigned to by the value that WAN mouthfuls of the first address (IP address) is converted into integer type, by WAN The value that the subnet mask of mouth is converted into integer type is assigned to the second variable WANMASK;By LAN mouthfuls of IP address conversion into integer type Value be assigned to ternary LANIP, the value that LAN mouthfuls of subnet mask is converted into integer type is assigned to the 4th variable LANMASK judges that WANIP and WANMASK obtained with the value that computing obtains and the progress of LANIP and LANMASK with computing Value it is whether equal, if equal, then it represents that WAN/LAN is in the same network segment, there is conflict, and provides a mark to represent to rush It is prominent, step S2 is performed, if unequal, performs step S13.
In a preferred embodiment, the specific deterministic process of step S13 is:
By the second variable and the 4th variable carries out and computing, and the value for making acquisition is the 5th variable;
Judge the first variable and the 5th variable carried out with the value that computing obtains with ternary and the 5th variable and fortune Whether equal the value obtained is calculated, if so, providing a mark in there are the conflict is represented during the conflict, to perform step S2, if it is not, then terminating.
In the present embodiment, when WANIP and WANMASK carries out the progress with the value that computing obtains and LANIP and LANMASK When the value obtained with computing is unequal, WANMASK and LANMASK are carried out to assign the 5th variable with computing and by acquired value ENMASK judges that WANIP and ENMASK carry out with LANIP and ENMASK with the value that computing obtains being with the value that computing obtains It is no equal, if equal, then it represents that WAN/LAN is in consolidated network, there is conflict, and provides a mark to represent to conflict, and performs Step S2.
In a preferred embodiment, the pre-defined rule includes, when first address and second address conflict, and When the IP address of conflict is the IP address of the c classes net, second address is revised as to the IP address of a class nets.
Wherein, a classes net IP address is:10.0.0.0 the address of~10.255.255.255, c class net IP address are: 192.168.0.0~192.168.255.255.
In the present embodiment, after conflict is detected, current WAN/ can be represented by setting variable conflict_flag LAN exist conflict, when WAN mouthful obtain IP address it is identical with the IP address that LAN mouthfuls of clients obtain, since router default is straight Connect away WAN mouthfuls, so as to cause client can not access router WEB page, therefore after detecting conflict, by discharging WAN mouthfuls IP address.When client user asks WEB page, by this variable of conflict_flag to determine whether there is punching It is prominent, if it is present directly show the conflict page to user, and the LAN after customer router is prompted to restart and match again Mouth IP address.The rule change of wherein LAN mouthfuls of IP address is, if detecting LAN mouthfuls of IP address 192.168.2.1 and WAN mouthfuls During conflict, LAN mouthfuls of IP address are changed to 10.10.10.1.
In a preferred embodiment, the pre-defined rule includes, when first address and second address conflict, and When the IP address of conflict is the IP address of a classes net, second address is revised as to the IP address of b class nets.
Wherein, b classes net IP address is:172.16.0.0~172.31.255.255.
In the present embodiment, if detect that LAN mouthfuls of IP address 10.10.10.1 conflict with WAN mouthfuls, by LAN mouthfuls of IP Location is changed to 172.16.10.1.
In a preferred embodiment, the pre-defined rule includes, when first address and second address conflict, and When the IP address of conflict is the IP address of the b classes net, second address is revised as to the IP address of c class nets.
In the present embodiment, if detect that LAN mouthfuls of IP address 172.16.10.1 conflict with WAN mouthfuls, by LAN mouthfuls of IP Address is changed to 192.168.2.1.
In a preferred embodiment, the pre-defined rule is further included when first address and second address conflict, And c is revised as when being not admitted to a classes net, the b classes net and the c classes net in second address by the IP address of conflict The IP address of class net.
The present invention can not only judge whether, in the same network segment, to can determine whether simultaneously in WAN/LAN collision detection is carried out In consolidated network.After conflict is detected, can WAN mouthfuls be discharged and be passed through variable is set to determine whether in conflict shape State.User can directly pop up the page of WAN/LAN conflicts, and prompt customer router weight by the WEB page of access router In opening and the LAN mouth IP address redistributed.
The foregoing is merely preferred embodiments of the present invention, not thereby limit embodiments of the present invention and protection model It encloses, to those skilled in the art, should can appreciate that all with made by description of the invention and diagramatic content Equivalent substitution and obviously change obtained scheme, should all include within the scope of the present invention.

Claims (9)

1. a kind of system for the IP address conflict for preventing the network equipment, applied in router, including:
Wide Area Network interface, to provide one first address for the router;
Lan interfaces connect at least one client, and the second address for being associated with a LAN according to one, in the local It works in net;
Allocation unit connects the lan interfaces, to distribute IP address according to second address for the client;
It is characterized in that, it further includes:
Judging unit connects the Wide Area Network interface and the lan interfaces respectively, to judge first address and institute The second address is stated with the presence or absence of conflict, and provides a mark in there are the conflict is represented during the conflict;
Processing unit connects the judging unit and the allocation unit, when first address and second address conflict When, the processing unit changes second address to discharge first address with pre-defined rule, controls the distribution Unit according to second address after change again for be connected with the lan interfaces client distribution IP address and Conflicting information and router reboot event prompting are generated according to the mark;
The judging unit includes:
First judgment module, to judge whether first address and second address are identical;
Second judgment module connects first judgment module, to judge whether are first address and second address In the same network segment;
3rd judgment module connects second judgment module, judging in first address of different segment and
Whether second address is in consolidated network;
The detailed process that second judgment module judges is:
When first address and second address differ, subnet mask corresponding with first address is obtained, it will First address conversion is the value of integer type, and the value of acquisition is assigned to the first variable, the subnet mask is converted whole The value of number type, and the value of acquisition is assigned to the second variable;
Subnet mask corresponding with second address is obtained, by the value that second address conversion is integer type, and will be obtained Value be assigned to ternary, the subnet mask is converted to the value of integer type, and the value of acquisition is assigned to the 4th variable;
Judge that the first variable and the second variable carry out with the value that computing obtains and ternary and the 4th variable obtain with computing Whether the value obtained is equal.
2. the system as claimed in claim 1, which is characterized in that further include:
Display unit connects the processing unit, to show that the conflicting information and the router restart prompting event.
3. the system as claimed in claim 1, which is characterized in that the detailed process that the 3rd judgment module judges is:By Two variables and the progress of the 4th variable and computing, the value for making acquisition are the 5th variable;
Judge that the first variable and the 5th variable carry out with the value that computing obtains and ternary and the 5th variable obtain with computing Whether the value obtained is equal.
4. the system as claimed in claim 1, which is characterized in that the pre-defined rule includes, when first address with it is described Second address conflict, and conflict IP address be c class nets IP address when, second address is revised as to the IP of a class nets Location and/or
When first address and second address conflict, and during IP address that the IP address to conflict is a classes net, by institute State the second address be revised as b class nets IP address and/or
When first address and second address conflict, and during IP address that the IP address to conflict is the b classes net, by institute State the IP address that c class nets are revised as in the second address.
5. system as claimed in claim 4, which is characterized in that the pre-defined rule further include when first address with it is described Second address conflict, and the IP address to conflict is when being not admitted to a classes net, the b classes net and the c classes net, by described the Double-address is revised as the IP address of c class nets.
6. a kind of method for the IP address conflict for preventing the network equipment, using preventing the network equipment as described in claim 1 The system of IP address conflict, which is characterized in that comprise the following steps:
S1. judge that first address, with the presence or absence of conflicting, is identified if so, providing one in there are institutes with second address The conflict is represented when stating conflict, performs step S2;If it is not, then terminate;
S2. when first address and second address conflict, first address is discharged, and institute is changed with pre-defined rule The second address is stated, according to client of second address after change again to be connected with the lan interfaces with distributing IP It location and conflicting information and the router reboot event is generated according to the mark prompts;
S3. restart prompting event to the conflicting information and the router to show;
The step S1 includes:
S11. judge whether first address and second address are identical, if so, providing a mark in described in presence The conflict is represented during conflict, performs the step S2;If it is not, perform step S12;
S12. judge whether first address is in the same network segment with second address, if it is not, performing step S13;If so, A mark is then provided in there are the conflict is represented during the conflict, to perform the step S2;
S13. whether judge in first address of different segment and second address in consolidated network, if so, carrying It identifies, in there are the conflict is represented during the conflict, the step S2 to be performed, if it is not, then terminating for one;
The specific deterministic process of the step S12 is:
Subnet mask corresponding with first address is obtained, by the value that first address conversion is integer type, and will be obtained Value be assigned to the first variable, be assigned to the second variable by the value of the subnet mask convert integer type, and by the value of acquisition;
Subnet mask corresponding with second address is obtained, by the value that second address conversion is integer type, and will be obtained Value be assigned to ternary, the subnet mask is converted to the value of integer type, and the value of acquisition is assigned to the 4th variable;
Judge that the first variable and the second variable carry out with the value that computing obtains and ternary and the 4th variable obtain with computing Whether the value obtained is equal, if it is not, performing the step S13;If so, a mark is provided in there are institute is represented during the conflict Conflict is stated, performs the step S2.
7. method as claimed in claim 6, which is characterized in that the specific deterministic process of the step S13 is:Judge the first change Amount and the 5th variable carry out the value obtained with computing and ternary and whether the value of the progress of the 5th variable and computing acquisition is equal, If so, a mark is provided in there are the conflict is represented during the conflict, the step S2 is performed, if it is not, then terminating.
8. method as claimed in claim 6, which is characterized in that the pre-defined rule includes, when first address with it is described Second address conflict, and conflict IP address be c class nets IP address when, second address is revised as to the IP of a class nets Location and/or
When first address and second address conflict, and during IP address that the IP address to conflict is a classes net, by institute State the second address be revised as b class nets IP address and/or
When first address and second address conflict, and during IP address that the IP address to conflict is the b classes net, by institute State the IP address that c class nets are revised as in the second address.
9. method as claimed in claim 8, which is characterized in that the pre-defined rule further include when first address with it is described Second address conflict, and the IP address to conflict is when being not admitted to a classes net, the b classes net and the c classes net, by described the Double-address is revised as the IP address of c class nets.
CN201510695285.XA 2015-10-22 2015-10-22 A kind of system and method for the IP address conflict for preventing the network equipment Active CN105357330B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510695285.XA CN105357330B (en) 2015-10-22 2015-10-22 A kind of system and method for the IP address conflict for preventing the network equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510695285.XA CN105357330B (en) 2015-10-22 2015-10-22 A kind of system and method for the IP address conflict for preventing the network equipment

Publications (2)

Publication Number Publication Date
CN105357330A CN105357330A (en) 2016-02-24
CN105357330B true CN105357330B (en) 2018-05-18

Family

ID=55333189

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510695285.XA Active CN105357330B (en) 2015-10-22 2015-10-22 A kind of system and method for the IP address conflict for preventing the network equipment

Country Status (1)

Country Link
CN (1) CN105357330B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105744012A (en) * 2016-03-09 2016-07-06 上海斐讯数据通信技术有限公司 Automatic solving method and device for IP (Internet Protocol) network segment conflicts of multiple WAN (wide area network) and LAN (local area network)
CN105577853A (en) * 2016-03-09 2016-05-11 上海斐讯数据通信技术有限公司 Method and device for automatically solving IP network segment conflict
CN105933465B (en) * 2016-04-20 2019-04-30 北京小米移动软件有限公司 Access the method and device of wireless network
CN107968844B (en) * 2016-10-19 2022-01-11 中兴通讯股份有限公司 Method and device for processing gateway address conflict and router
CN106936944A (en) * 2017-03-31 2017-07-07 苏州科达科技股份有限公司 A kind of method and device for detecting and processing network address collision
CN107734528B (en) * 2017-11-03 2021-01-15 Oppo广东移动通信有限公司 Wireless network detection method, device, storage medium and terminal
CN108234687B (en) * 2017-12-29 2021-03-19 深圳华望技术有限公司 Intelligent IP address configuration method and device and terminal equipment
CN108921369A (en) * 2018-05-08 2018-11-30 阿里巴巴集团控股有限公司 Conflict rule generation method and device and electronic equipment
CN108848033B (en) * 2018-06-26 2021-11-09 深圳创维数字技术有限公司 Method, device and storage medium for avoiding route conflict
CN114401251A (en) * 2022-03-25 2022-04-26 中科云策(深圳)科技成果转化信息技术有限公司 Internet-based IP address database processing system and method thereof
WO2024065789A1 (en) * 2022-09-30 2024-04-04 Siemens Aktiengesellschaft Routing device for accessing network device by terminal device, and network connection method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006060072A1 (en) * 2004-11-30 2006-06-08 General Instrument Corporation Device, system and method for automatically determining an appropriate lan ip address range in a multi-router network environment
CN102014044A (en) * 2009-09-04 2011-04-13 技嘉科技股份有限公司 Domain collision avoidance method and router using same
CN103227844A (en) * 2013-04-19 2013-07-31 深圳市吉祥腾达科技有限公司 Method and device for automatically solving secondary route IP conflict in DHCP

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006060072A1 (en) * 2004-11-30 2006-06-08 General Instrument Corporation Device, system and method for automatically determining an appropriate lan ip address range in a multi-router network environment
CN102014044A (en) * 2009-09-04 2011-04-13 技嘉科技股份有限公司 Domain collision avoidance method and router using same
CN103227844A (en) * 2013-04-19 2013-07-31 深圳市吉祥腾达科技有限公司 Method and device for automatically solving secondary route IP conflict in DHCP

Also Published As

Publication number Publication date
CN105357330A (en) 2016-02-24

Similar Documents

Publication Publication Date Title
CN105357330B (en) A kind of system and method for the IP address conflict for preventing the network equipment
JP6194456B2 (en) Method for automatically deploying network device configurations
CN109462534B (en) Local interconnect controller, local interconnect control method, and computer storage medium
CN103703724B (en) Resource payment method
CN104737504B (en) The system and method for effectively using flow table space in a network environment
CN101800658B (en) Apparatus and method for managing subscription requests for a network interface component
CN106844000A (en) Using the method and apparatus of browser access linux container cluster under a kind of multi-user environment
CN104125110A (en) Monitoring method and device of network resource
CN108777640A (en) A kind of server detection method, device, system and storage medium
CN109937559A (en) The trimming based on group in software definition networked environment
CN102014044B (en) Domain collision avoidance method and router using same
CN110351135B (en) Network equipment configuration method and device in multiple DCs
CN106453124A (en) Traffic scheduling method and device
CN105306615B (en) The method for distributing network address for the network user
CN109379268B (en) Virtual private network creating method and device and server
CN102195803A (en) Data communication method and system
CN109240796A (en) Virtual machine information acquisition methods and device
CN105262753A (en) System and method for achieving security policy based on SDN virtual switch
CN105450540A (en) Load balancing method and device as well as DHCP (dynamic host configuration protocol) server
CN106059881A (en) SDN network and flow leading-in and leading-out method thereof
CN104426759B (en) Host routes acquisition methods, apparatus and system
CN103957124A (en) Distribution type collecting method and system of collection tasks
CN106878202B (en) Message processing method and device
CN106878075A (en) A kind of message processing method and device
CN108092869A (en) Virtual interface collocation method and communication equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201125

Address after: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Hangzhou Jiji Intellectual Property Operation Co., Ltd

Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666

Patentee before: Phicomm (Shanghai) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201214

Address after: 8319 Yanshan Road, Bengbu City, Anhui Province

Patentee after: Bengbu Lichao Information Technology Co.,Ltd.

Address before: Room 10242, No. 260, Jiangshu Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee before: Hangzhou Jiji Intellectual Property Operation Co., Ltd

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210308

Address after: 313000 room 1019, Xintiandi commercial office, Yishan street, Wuxing District, Huzhou, Zhejiang, China

Patentee after: Huzhou YingLie Intellectual Property Operation Co.,Ltd.

Address before: 8319 Yanshan Road, Bengbu City, Anhui Province

Patentee before: Bengbu Lichao Information Technology Co.,Ltd.