WO2018072701A1 - 一种网关地址冲突的处理方法、装置及路由器 - Google Patents

一种网关地址冲突的处理方法、装置及路由器 Download PDF

Info

Publication number
WO2018072701A1
WO2018072701A1 PCT/CN2017/106643 CN2017106643W WO2018072701A1 WO 2018072701 A1 WO2018072701 A1 WO 2018072701A1 CN 2017106643 W CN2017106643 W CN 2017106643W WO 2018072701 A1 WO2018072701 A1 WO 2018072701A1
Authority
WO
WIPO (PCT)
Prior art keywords
router
gateway address
routing device
network card
address
Prior art date
Application number
PCT/CN2017/106643
Other languages
English (en)
French (fr)
Inventor
高飞
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2018072701A1 publication Critical patent/WO2018072701A1/zh

Links

Images

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
    • 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/5007Internet protocol [IP] addresses
    • 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/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]

Definitions

  • the present invention relates to the field of communications, and in particular, to a method, an apparatus, and a router for processing a gateway address conflict.
  • routers are widely used as a relatively portable communication terminal, and they can connect to upstream routing devices themselves.
  • an uplink path device an access network service is provided for a client that accesses the router.
  • the user usually connects the router in the home to the upstream routing device through the network cable, and applies the protocol (IP, Internet Protocol) address of the network to the upstream routing device through the Dynamic Host Configuration Protocol (DHCP). use.
  • IP Internet Protocol
  • DHCP Dynamic Host Configuration Protocol
  • the gateway address of the router in the user's hand may be in conflict with the gateway address of the upstream routing device (for example, in the same network segment, etc.), and the Internet access may not be obtained even if the upstream routing device is accessed.
  • the user can manually modify the gateway address of the router in the home to eliminate the conflict with the gateway address of the upstream routing device, and then restart the router to obtain the IP address to solve the problem, but the process is normal. Users are too professional and too complicated, and the user experience is not good.
  • the purpose of the embodiments of the present invention is to provide a method, a device, and a router for processing a gateway address conflict, which can automatically cancel the gateway address of the router and the gateway address of the uplink routing device when the gateway address of the router conflicts with the gateway address of the upstream routing device.
  • the conflict between the users allows the user to go online and improve the user experience.
  • an embodiment of the present invention provides a gateway address conflict processing.
  • the method is applied to a router, and the method includes:
  • the router is eliminated.
  • the steps of performing a conflict elimination operation on the router include:
  • the method further includes:
  • the steps of configuring the network side network card of the router and the user side network card of the router under the same bridge include:
  • the method also includes:
  • the steps of performing a recovery operation on the router include:
  • the method further includes:
  • the step of detecting whether the gateway address of the router conflicts with the gateway address of the uplink routing device includes:
  • gateway address of the router is in the same network segment as the gateway address of the upstream routing device, it is determined that the gateway address of the router conflicts with the gateway address of the upstream routing device.
  • the embodiment of the present invention further provides a processing device for processing a gateway address conflict, which is applied to a router, and the device includes:
  • the first detecting module is configured to detect, when the network side IP address allocated by the uplink routing device is obtained, whether the gateway address of the router conflicts with the gateway address of the uplink routing device, and if the gateway address of the router conflicts with the gateway address of the upstream routing device , triggering the elimination module;
  • the elimination module is configured to perform a collision elimination operation on the router according to the trigger of the first detection module.
  • the elimination module includes:
  • the first eliminating unit is configured to configure the network side network card of the router and the user side network card of the router under the same bridge.
  • the elimination module further includes:
  • the second elimination unit is configured to close the dynamic host configuration protocol DHCP server inside the router, and perform power-off and power-on operation on the user side network card;
  • the third elimination unit is configured to delete a firewall rule in the router for performing source IP address translation.
  • the first eliminating unit is specifically configured to configure the network side network card of the router under the bridge of the user side network card of the router.
  • the device further comprises:
  • the second detecting module is configured to detect whether the connection between the router and the uplink routing device is disconnected, and if the connection between the router and the uplink routing device is disconnected, triggering the recovery module;
  • the recovery module is configured to perform a recovery operation on the router according to the trigger of the second detection module.
  • the recovery module includes:
  • the first recovery unit is configured to uninstall the network side network card of the router from the bridge of the user side network card of the router.
  • the recovery module further includes:
  • the second recovery unit is configured to start a DHCP server inside the router, and power off and then power on the user side network card;
  • the third recovery unit is configured to add a firewall rule for performing source IP address translation in the router.
  • the first detection module includes:
  • the first detecting unit is configured to detect whether the gateway address of the router is in the same network segment as the gateway address of the uplink routing device, and if the gateway address of the router is in the same network segment as the gateway address of the uplink routing device, triggering the second detection unit;
  • the second detecting unit is configured to determine that the gateway address of the router conflicts with the gateway address of the uplink routing device according to the trigger of the first detecting unit.
  • Embodiments of the present invention also provide a router, including the above-described processing device for gateway address conflict.
  • a storage medium comprising a stored program, wherein the program is executed to perform the method of any of the above.
  • a processor for running a program wherein the program is executed to perform the method of any of the above.
  • the router when the router obtains the network side IP address allocated by the uplink routing device, it detects whether the gateway address of the router conflicts with the gateway address of the uplink routing device, and if the gateway address of the router and the upstream routing device If the gateway address conflicts, the router performs a collision elimination operation, so that the client device connected to the user side of the router directly goes up.
  • the IP address is applied to the device, the conflict between the gateway address of the router and the gateway address of the upstream routing device is resolved. It is difficult for the user to eliminate the conflict between the gateway address of the router and the gateway address of the upstream routing device. As a result, the user cannot access the Internet and affect the user experience.
  • the problem is that when the gateway address of the router conflicts with the gateway address of the upstream routing device, the conflict between the gateway address of the router and the gateway address of the upstream routing device can be automatically eliminated, so that the user can access the network normally and improve the user experience. .
  • FIG. 1 is a flowchart of a method for processing a gateway address conflict in the first embodiment of the present invention
  • FIG. 2 is a flowchart of a specific implementation manner of step 102 in FIG. 1 in the first embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a bridge structure of a router in a specific example of the first embodiment of the present invention
  • FIG. 4 is a second schematic diagram of a bridge structure of a router in a specific example of the first embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a device for processing a gateway address conflict in a second embodiment of the present invention.
  • a first embodiment of the present invention provides a method for processing a gateway address conflict, which is applied to a router, and the method includes:
  • Step 101 When obtaining the network side IP address allocated by the uplink routing device, detecting whether the gateway address of the router conflicts with the gateway address of the uplink routing device.
  • the Internet access is normal.
  • the router after connecting to the upstream routing device through a network cable or Wireless Fidelity (WIFI), it will apply for the network side IP to the upstream routing device for normal Internet access.
  • the uplink routing device may be an uplink DHCP server, that is, a higher-level DHCP server of the router.
  • the specific implementation manner of the foregoing step 101 may be: detecting whether the gateway address of the router is in the same network segment as the gateway address of the uplink routing device, and if the gateway address of the router and the uplink routing device If the gateway address is in the same network segment, it is determined that the gateway address of the router conflicts with the gateway address of the upstream routing device. Of course, if the gateway address of the router is not in the same network segment as the gateway address of the upstream routing device, the gateway address of the router is determined. The gateway address of the upstream routing device does not conflict.
  • Step 102 If the gateway address of the router conflicts with the gateway address of the uplink routing device, perform a conflict elimination operation on the router.
  • the client device connected to the user side of the router can directly apply for an IP address to the upstream routing device.
  • the specific implementation of the foregoing step 102 includes the following steps:
  • Step 201 Configure the network side network card of the router and the user side network card of the router under the same bridge.
  • the specific implementation of the step 201 may be: configuring the network side network card of the router under the bridge of the user side network card of the router.
  • step 202 the dynamic host configuration protocol server inside the router is shut down, and the user side network card is powered off and then powered on.
  • the router since the network side network card of the router is configured under the bridge of the user side network card of the router, the router at this time only functions as a channel, and no longer bears the responsibility.
  • a client device such as a smart phone, etc.
  • a client device connected to the router side allocates an IP address, and in order to enable the client device connected to the router to apply for an IP address to the upstream routing device, the internal dynamics of the router need to be turned off.
  • Host Configuration Protocol (DHCP) server and power off and then power on the user side network card.
  • DHCP Host Configuration Protocol
  • the power-off and power-on operation of the user-side network card is performed to enable the client device connected to the router to re-apply for an IP address to the router, and since the DHCP server inside the router is turned off, the router is connected to the router.
  • the client device on the user side can directly apply for an IP address to the upstream routing device.
  • Step 203 Delete a firewall rule in the router for performing source IP address translation.
  • the network side network card of the router since the network side network card of the router is configured under the bridge of the user side network card of the router, the source IP address of the data packet sent by the client device connected to the user side of the router is not required.
  • the conversion, so the firewall rules for source IP address translation in the router need to be deleted to ensure that the client device connected to the router side of the router can directly apply for an IP address to the routing device.
  • the step of configuring the network side network card of the router under the bridge of the user side network card of the router is illustrated by a specific example.
  • the gateway address of the router is 192.168.0.1 subnet mask 255.255.255.0
  • the gateway address of the upstream routing device is 192.168.0.1 subnet mask 255.255.255.0, which can be seen that the gateway address of the router and the upstream routing device
  • the gateway address conflicts, and the client device connected to the user side of the router cannot access the Internet.
  • the bridge structure of the router is as shown in FIG.
  • wan1 represents the network side network card of the router, which is connected with the upstream routing device
  • br2 represents the user side bridge of the router
  • eth3 and wifi4 respectively represent the user side network card of a router.
  • the bridge structure of the router can be changed to the bridge structure as shown in FIG. 4, that is, wan1 is configured under br2.
  • step 201 only performing step 201 can achieve the purpose of performing a collision elimination operation on the router.
  • the method further includes the steps of: detecting whether the connection between the router and the upstream routing device is disconnected, and performing a disconnection on the router if the connection between the router and the upstream routing device is disconnected.
  • the recovery operation causes the client device connected to the router side to apply for an IP address from the router, thereby restoring the router to a normal state (that is, a state before the conflict elimination operation is performed on the router). It should be noted that after the router that is restored to the normal state is connected to the upstream routing device, the upstream routing device requests the network side IP address, and performs the above step 101.
  • the method for detecting whether the connection between the router and the uplink routing device is disconnected may be: detecting whether the router restarts, or detecting whether the router cancels the connection with the uplink routing device (for example, for the uplink routing device). Whether the connected network cable is unplugged).
  • the specific implementation manner of performing a recovery operation on the router includes the following steps:
  • the network side network card of the router is uninstalled from the bridge of the user side network card of the router.
  • the bridge structure of the router can be restored to the bridge structure before the collision elimination operation of the router.
  • the DHCP server inside the router is started, and the user side network card is powered off and then powered on.
  • the router since the connection between the router and the upstream routing device is disconnected, the router acts as a DHCP server connected to the client device of the user side of the router at this time, and therefore needs to restart the DHCP server inside the router.
  • the user side network card is powered off and then powered on, so that the client device connected to the router side of the router applies for an IP address to the router.
  • a firewall rule for source IP address translation is added to the router.
  • the bridge structure of the router can be restored to the bridge structure before the collision elimination operation on the router, it is necessary to source the data packet sent from the client device connected to the user side of the router.
  • IP address translation so you need to add a firewall rule for source IP address translation in the router to ensure that the client device connected to the router side of the router applies for an IP address from the router.
  • the router when the router obtains the network side IP address allocated by the uplink routing device, it detects whether the gateway address of the router conflicts with the gateway address of the uplink routing device, and if the gateway address of the router is If the gateway address of the upstream routing device conflicts, the router performs the conflict elimination operation, so that the client device connected to the router directly requests the IP address from the routing device, and solves the gateway address of the router and the gateway address of the upstream routing device.
  • the conflict between the gateway address of the router and the gateway address of the upstream routing device can be automatically eliminated, so that the user can access the Internet normally and improve the user experience.
  • a second embodiment of the present invention provides a device for processing a gateway address conflict, which is applied to a router, and the device includes:
  • the first detecting module 501 is configured to detect, when the network side IP address allocated by the uplink routing device is obtained, whether the gateway address of the router conflicts with the gateway address of the uplink routing device, and if the gateway address of the router and the gateway address of the uplink routing device Conflict, triggering the elimination module 502;
  • the elimination module 502 is configured to perform a collision elimination operation on the router according to the triggering of the first detection module 501.
  • the elimination module 502 includes:
  • the first eliminating unit is configured to configure the network side network card of the router and the user side network card of the router under the same bridge.
  • the elimination module 502 further includes:
  • the second elimination unit is configured to close the dynamic host configuration protocol DHCP server inside the router, and perform power-off and power-on operation on the user side network card;
  • the third elimination unit is configured to delete a firewall rule in the router for performing source IP address translation.
  • the first eliminating unit is specifically configured to configure the network side network card of the router under the bridge of the user side network card of the router.
  • the device further comprises:
  • the second detecting module is configured to detect whether the connection between the router and the uplink routing device is disconnected, and if the connection between the router and the uplink routing device is disconnected, triggering the recovery module;
  • the recovery module is configured to perform a recovery operation on the router according to the trigger of the second detection module.
  • the recovery module includes:
  • the first recovery unit is configured to uninstall the network side network card of the router from the bridge of the user side network card of the router.
  • the recovery module further includes:
  • the second recovery unit is configured to start a DHCP server inside the router, and power off and then power on the user side network card;
  • the third recovery unit is configured to add a firewall rule for performing source IP address translation in the router.
  • the first detecting module 501 includes:
  • the first detecting unit is configured to detect whether the gateway address of the router is in the same network segment as the gateway address of the uplink routing device, and if the gateway address of the router is in the same network segment as the gateway address of the uplink routing device, triggering the second detection unit;
  • the second detecting unit is configured to determine that the gateway address of the router conflicts with the gateway address of the uplink routing device according to the trigger of the first detecting unit.
  • the processing device of the gateway address conflict detects whether the gateway address of the router conflicts with the gateway address of the uplink routing device by acquiring the network side IP address allocated by the uplink routing device, and if the router If the gateway address conflicts with the gateway address of the upstream routing device, the router performs a collision elimination operation to connect the user side connected to the router.
  • the client device directly requests the IP address from the routing device to solve the conflict between the gateway address of the router and the gateway address of the upstream routing device.
  • the user is difficult to eliminate the conflict between the gateway address of the router and the gateway address of the upstream routing device.
  • the problem of the user experience is not met.
  • the conflict between the gateway address of the router and the gateway address of the upstream routing device can be automatically eliminated, so that the user can access the network normally. To enhance the user experience.
  • the processing device for the gateway address conflict provided by the second embodiment of the present invention is a device that applies the foregoing method for processing a gateway address conflict, that is, all the embodiments of the foregoing method are applicable to the device, and both can achieve the same or Similar benefits.
  • a third embodiment of the present invention provides a router including the above-described processing device for gateway address conflict.
  • the router provided by the third embodiment of the present invention is a router including the foregoing processing device for conflicting gateway addresses, that is, all the embodiments of the foregoing processing apparatus for conflicting gateway addresses are applicable to the router, and both can achieve the same or Similar benefits.
  • Embodiments of the present invention also provide a storage medium including a stored program, wherein the program described above executes the method of any of the above.
  • the foregoing storage medium may include, but is not limited to, a USB flash drive, a Read-Only Memory (ROM), and a Random Access Memory (RAM).
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • Embodiments of the present invention also provide a processor for running a program, wherein the program is executed to perform the steps of any of the above methods.
  • the method, device, and router for processing gateway address conflicts provided by the embodiments of the present invention have the following beneficial effects: when the gateway address of the router conflicts with the gateway address of the upstream routing device, it is difficult for the user to eliminate the gateway of the router.
  • the conflict between the address and the gateway address of the upstream routing device causes the user to be unable to access the Internet and affect the user experience.
  • the gateway address of the router conflicts with the gateway address of the upstream routing device, the gateway address and uplink of the router can be automatically eliminated.
  • the conflict between the gateway addresses of the routing devices enables users to access the Internet and improve the user experience.

Landscapes

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

Abstract

本发明的实施例提供了一种网关地址冲突的处理方法、装置及路由器,其中该方法包括:在获取到上行路由设备分配的网络侧IP地址时,检测路由器的网关地址与上行路由设备的网关地址是否冲突;若路由器的网关地址与上行路由设备的网关地址冲突,则对路由器进行冲突消除操作。本发明的实施例能在路由器的网关地址与上行路由设备的网关地址冲突时,自动消除路由器的网关地址与上行路由设备的网关地址之间的冲突,使用户可正常上网,提升用户体验。

Description

一种网关地址冲突的处理方法、装置及路由器 技术领域
本发明涉及通信领域,特别涉及一种网关地址冲突的处理方法、装置及路由器。
背景技术
随着互联网的快速发展,尤其是第四代移动通信技术(4G)、固网等业务的快速发展与普及,路由器作为一种较为便携式的通讯终端得到广泛应用,其自身可以通过连接上行路由设备作为上行通路设备为接入到路由器的客户端提供接入上网服务。
用户通常将家中的路由器通过网线连接到上行路由设备,通过动态主机配置协议(DHCP,Dynamic Host Configuration Protocol)方式向上行路由设备申请网络之间互连的协议(IP,Internet Protocol)地址以供上网使用。但在使用中有时会遇到用户手中的路由器的网关地址与上行路由设备的网关地址冲突(例如相同、在同一网段内等)的情况,导致即使接入了上行路由设备也无法上网。
目前在路由器遇到这种情况时,只能通过用户手动修改家中路由器的网关地址来消除其与上行路由设备的网关地址的冲突,然后重启路由器重新获得IP地址来解决,但这一过程对于普通用户来说过于专业也过于复杂,用户体验不好。
发明内容
本发明实施例的目的在于提供一种网关地址冲突的处理方法、装置及路由器,能在路由器的网关地址与上行路由设备的网关地址冲突时,自动消除路由器的网关地址与上行路由设备的网关地址之间的冲突,使用户可正常上网,提升用户体验。
为了达到上述目的,本发明的实施例提供了一种网关地址冲突的处理 方法,应用于路由器,该方法包括:
在获取到上行路由设备分配的网络侧IP地址时,检测路由器的网关地址与上行路由设备的网关地址是否冲突;
若路由器的网关地址与上行路由设备的网关地址冲突,则对路由器进行冲突消除操作。
其中,对路由器进行冲突消除操作的步骤,包括:
将路由器的网络侧网卡与路由器的用户侧网卡配置于同一网桥下。
其中,在将路由器的网络侧网卡与路由器的用户侧网卡配置于同一网桥下的步骤之后,方法还包括:
关闭路由器内部的动态主机配置协议DHCP服务器,并对用户侧网卡进行断电再上电操作;
删除路由器中用于进行源IP地址转换的防火墙规则。
其中,将路由器的网络侧网卡与路由器的用户侧网卡配置于同一网桥下的步骤,包括:
将路由器的网络侧网卡配置于路由器的用户侧网卡的网桥下。
其中,方法还包括:
检测路由器与上行路由设备之间的连接是否断开;
若路由器与上行路由设备之间的连接断开,则对路由器执行恢复操作。
其中,对路由器执行恢复操作的步骤,包括:
将路由器的网络侧网卡从路由器的用户侧网卡的网桥下卸载。
其中,在将路由器的网络侧网卡从路由器的用户侧网卡的网桥下卸载的步骤之后,方法还包括:
启动路由器内部的DHCP服务器,并对用户侧网卡进行断电再上电操作;
在路由器中添加用于进行源IP地址转换的防火墙规则。
其中,检测路由器的网关地址与上行路由设备的网关地址是否冲突的步骤,包括:
检测路由器的网关地址是否与上行路由设备的网关地址在同一网段内;
若路由器的网关地址与上行路由设备的网关地址在同一网段内,则确定路由器的网关地址与上行路由设备的网关地址冲突。
本发明的实施例还提供了一种网关地址冲突的处理装置,应用于路由器,该装置包括:
第一检测模块,设置为在获取到上行路由设备分配的网络侧IP地址时,检测路由器的网关地址与上行路由设备的网关地址是否冲突,并若路由器的网关地址与上行路由设备的网关地址冲突,则触发消除模块;
消除模块,设置为根据第一检测模块的触发,对路由器进行冲突消除操作。
其中,消除模块包括:
第一消除单元,设置为将路由器的网络侧网卡与路由器的用户侧网卡配置于同一网桥下。
其中,消除模块还包括:
第二消除单元,设置为关闭路由器内部的动态主机配置协议DHCP服务器,并对用户侧网卡进行断电再上电操作;
第三消除单元,设置为删除路由器中用于进行源IP地址转换的防火墙规则。
其中,第一消除单元,具体设置为将路由器的网络侧网卡配置于路由器的用户侧网卡的网桥下。
其中,装置还包括:
第二检测模块,设置为检测路由器与上行路由设备之间的连接是否断开,并若路由器与上行路由设备之间的连接断开,则触发恢复模块;
恢复模块,设置为根据第二检测模块的触发,对路由器执行恢复操作。
其中,恢复模块包括:
第一恢复单元,设置为将路由器的网络侧网卡从路由器的用户侧网卡的网桥下卸载。
其中,恢复模块还包括:
第二恢复单元,设置为启动路由器内部的DHCP服务器,并对用户侧网卡进行断电再上电操作;
第三恢复单元,设置为在路由器中添加用于进行源IP地址转换的防火墙规则。
其中,第一检测模块包括:
第一检测单元,设置为检测路由器的网关地址是否与上行路由设备的网关地址在同一网段内,并若路由器的网关地址与上行路由设备的网关地址在同一网段内,则触发第二检测单元;
第二检测单元,设置为根据第一检测单元的触发,确定路由器的网关地址与上行路由设备的网关地址冲突。
本发明的实施例还提供了一种路由器,包括上述的网关地址冲突的处理装置。
根据本发明的又一个实施例,还提供了一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行时执行上述任一项所述的方法。
根据本发明的又一个实施例,还提供了一种处理器,所述处理器用于运行程序,其中,所述程序运行时执行上述任一项所述的方法。
本发明的上述方案至少包括以下有益效果:
在本发明的实施例中,路由器通过在获取到上行路由设备分配的网络侧IP地址时,检测路由器的网关地址与上行路由设备的网关地址是否冲突,并若路由器的网关地址与上行路由设备的网关地址冲突,则对路由器进行冲突消除操作,使连接到路由器的用户侧的客户端设备直接向上行路 由设备申请IP地址,解决了在路由器的网关地址与上行路由设备的网关地址冲突时,用户难以消除路由器的网关地址与上行路由设备的网关地址之间的冲突,导致用户无法上网,影响用户体验的问题,达到了在路由器的网关地址与上行路由设备的网关地址冲突时,能自动消除路由器的网关地址与上行路由设备的网关地址之间的冲突,使用户可正常上网,提升用户体验的效果。
附图说明
图1为本发明第一实施例中网关地址冲突的处理方法的流程图;
图2为本发明第一实施例中图1中步骤102的具体实现方式的流程图;
图3为本发明第一实施例的一具体实例中的路由器的网桥结构示意图之一;
图4为本发明第一实施例的一具体实例中的路由器的网桥结构示意图之二;
图5为本发明第二实施例中网关地址冲突的处理装置的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
第一实施例
如图1所示,本发明的第一实施例提供了一种网关地址冲突的处理方法,应用于路由器,该方法包括:
步骤101,在获取到上行路由设备分配的网络侧IP地址时,检测路由器的网关地址与上行路由设备的网关地址是否冲突。
其中,若路由器的网关地址与上行路由设备的网关地址不冲突,则正常上网。
在本发明的第一实施例中,对于一路由器而言,其在通过网线或者无线保真(WIFI,Wireless Fidelity)连接上行路由设备后,为能正常上网其会向上行路由设备申请网络侧IP地址,且若通过一次申请未获取到网络侧IP地址,路由器会一直向上行路由设备申请网络侧IP地址直至获取到上行路由设备分配的网络侧IP地址。其中,上述上行路由设备可以为上行DHCP服务器,即路由器的上一级DHCP服务器。
且在本发明的第一实施例中,上述步骤101的具体实现方式可以为:检测路由器的网关地址是否与上行路由设备的网关地址在同一网段内,并若路由器的网关地址与上行路由设备的网关地址在同一网段内,则确定路由器的网关地址与上行路由设备的网关地址冲突,当然若路由器的网关地址与上行路由设备的网关地址不在同一网段内,则确定路由器的网关地址与上行路由设备的网关地址不冲突。
步骤102,若路由器的网关地址与上行路由设备的网关地址冲突,则对路由器进行冲突消除操作。
其中,在本发明的第一实施例中,对路由器进行冲突消除操作之后,便可使连接到路由器的用户侧的客户端设备直接向上行路由设备申请IP地址。且如图2所示,上述步骤102的具体实现方式包括如下步骤:
步骤201,将路由器的网络侧网卡与路由器的用户侧网卡配置于同一网桥下。
在本发明的第一实施例中,步骤201的具体实现方式可以为:将路由器的网络侧网卡配置于路由器的用户侧网卡的网桥下。
步骤202,关闭路由器内部的动态主机配置协议服务器,并对用户侧网卡进行断电再上电操作。
在本发明的第一实施例中,由于路由器的网络侧网卡配置于路由器的用户侧网卡的网桥下,此时的路由器仅起到一个通道的作用,不再承担给 连接到路由器的用户侧的客户端设备(例如智能手机等)分配IP地址的作用,而为使连接到路由器的用户侧的客户端设备能够向上行路由设备申请IP地址,需要关闭路由器内部的动态主机配置协议(DHCP)服务器,并对用户侧网卡进行断电再上电操作。其中,对用户侧网卡进行断电再上电操作是为了使连接到路由器的用户侧的客户端设备重新向路由器申请IP地址,而由于此时路由器内部的DHCP服务器被关闭,使得连接到路由器的用户侧的客户端设备能够直接向上行路由设备申请IP地址。
步骤203,删除路由器中用于进行源IP地址转换的防火墙规则。
在本发明的第一实施例中,由于路由器的网络侧网卡配置于路由器的用户侧网卡的网桥下,因此不需要对连接到路由器的用户侧的客户端设备发出的数据包做源IP地址转换,因此需要删除路由器中用于进行源IP地址转换的防火墙规则,以确保连接到路由器的用户侧的客户端设备能够直接向上行路由设备申请IP地址。
在本发明的第一实施例中,以一具体实例阐述上述将路由器的网络侧网卡配置于路由器的用户侧网卡的网桥下的步骤。在该实例中,假设路由器的网关地址为192.168.0.1子网掩码255.255.255.0,上行路由设备的网关地址为192.168.0.1子网掩码255.255.255.0,可见路由器的网关地址与上行路由设备的网关地址冲突,连接到路由器的用户侧的客户端设备无法正常上网。此时路由器的网桥结构如图3所示,其中,wan1表示路由器的网络侧网卡,其与上行路由设备连接,br2表示路由器的用户侧网桥,eth3与wifi4分别表示一路由器的用户侧网卡。而为使连接到路由器的用户侧的客户端设备能正常上网,可将路由器的网桥结构更改为如图4所示的网桥结构,即,将wan1配置于br2下。
需要说明的是,针对于上述步骤102的具体实现方式而言,在某些特殊的应用场景下,只执行步骤201也能达到对路由器进行冲突消除操作的目的。
其中,在本发明的第一实施例中,由于路由器存在重启或者取消与上 行路由设备之间的连接的可能,因此上述方法还包括如下步骤:检测路由器与上行路由设备之间的连接是否断开,并若路由器与上行路由设备之间的连接断开,则对路由器执行恢复操作,使连接到路由器的用户侧的客户端设备向路由器申请IP地址,从而使路由器恢复到正常状态(即,对路由器进行冲突消除操作之前的状态)。需要说明的是,恢复到正常状态的路由器在与上行路由设备连接之后,向上行路由设备申请网络侧IP地址,并执行上述步骤101。
其中,上述检测路由器与上行路由设备之间的连接是否断开的方式可以为:检测路由器是否发生重启现象,或者,检测路由器是否取消与上行路由设备之间的连接(例如用于与上行路由设备连接的网线是否被拔出)。相应的,对路由器执行恢复操作的具体实现方式包括如下步骤:
第一步,将路由器的网络侧网卡从路由器的用户侧网卡的网桥下卸载。
其中,经过上述第一步处理之后,路由器的网桥结构可恢复至对路由器进行冲突消除操作之前的网桥结构。
第二步,启动路由器内部的DHCP服务器,并对用户侧网卡进行断电再上电操作。
在本发明的第一实施例中,由于路由器与上行路由设备之间的连接断开,此时路由器充当连接到路由器的用户侧的客户端设备的DHCP服务器,因此需要重启路由器内部的DHCP服务器,并对用户侧网卡进行断电再上电操作,使连接到路由器的用户侧的客户端设备向路由器申请IP地址。
第三步,在路由器中添加用于进行源IP地址转换的防火墙规则。
在本发明的第一实施例中,由于路由器的网桥结构可恢复至对路由器进行冲突消除操作之前的网桥结构,因此需要对连接到路由器的用户侧的客户端设备发出的数据包做源IP地址转换,因此需要在路由器中添加用于进行源IP地址转换的防火墙规则,以确保连接到路由器的用户侧的客户端设备向路由器申请IP地址。
需要说明的是,针对于上述对路由器执行恢复操作的具体实现方式而 言,在某些特殊的应用场景下,只执行第一步也能达到对路由器执行恢复操作的目的。
可见,在本发明的第一实施例中,路由器通过在获取到上行路由设备分配的网络侧IP地址时,检测路由器的网关地址与上行路由设备的网关地址是否冲突,并若路由器的网关地址与上行路由设备的网关地址冲突,则对路由器进行冲突消除操作,使连接到路由器的用户侧的客户端设备直接向上行路由设备申请IP地址,解决了在路由器的网关地址与上行路由设备的网关地址冲突时,用户难以消除路由器的网关地址与上行路由设备的网关地址之间的冲突,导致用户无法上网,影响用户体验的问题,达到了在路由器的网关地址与上行路由设备的网关地址冲突时,能自动消除路由器的网关地址与上行路由设备的网关地址之间的冲突,使用户可正常上网,提升用户体验的效果。
第二实施例
如图5所示,本发明的第二实施例提供了一种网关地址冲突的处理装置,应用于路由器,该装置包括:
第一检测模块501,设置为在获取到上行路由设备分配的网络侧IP地址时,检测路由器的网关地址与上行路由设备的网关地址是否冲突,并若路由器的网关地址与上行路由设备的网关地址冲突,则触发消除模块502;
消除模块502,设置为根据第一检测模块501的触发,对路由器进行冲突消除操作。
其中,消除模块502包括:
第一消除单元,设置为将路由器的网络侧网卡与路由器的用户侧网卡配置于同一网桥下。
其中,消除模块502还包括:
第二消除单元,设置为关闭路由器内部的动态主机配置协议DHCP服务器,并对用户侧网卡进行断电再上电操作;
第三消除单元,设置为删除路由器中用于进行源IP地址转换的防火墙规则。
其中,第一消除单元,具体设置为将路由器的网络侧网卡配置于路由器的用户侧网卡的网桥下。
其中,装置还包括:
第二检测模块,设置为检测路由器与上行路由设备之间的连接是否断开,并若路由器与上行路由设备之间的连接断开,则触发恢复模块;
恢复模块,设置为根据第二检测模块的触发,对路由器执行恢复操作。
其中,恢复模块包括:
第一恢复单元,设置为将路由器的网络侧网卡从路由器的用户侧网卡的网桥下卸载。
其中,恢复模块还包括:
第二恢复单元,设置为启动路由器内部的DHCP服务器,并对用户侧网卡进行断电再上电操作;
第三恢复单元,设置为在路由器中添加用于进行源IP地址转换的防火墙规则。
其中,第一检测模块501包括:
第一检测单元,设置为检测路由器的网关地址是否与上行路由设备的网关地址在同一网段内,并若路由器的网关地址与上行路由设备的网关地址在同一网段内,则触发第二检测单元;
第二检测单元,设置为根据第一检测单元的触发,确定路由器的网关地址与上行路由设备的网关地址冲突。
在本发明的第二实施例中,网关地址冲突的处理装置通过在获取到上行路由设备分配的网络侧IP地址时,检测路由器的网关地址与上行路由设备的网关地址是否冲突,并若路由器的网关地址与上行路由设备的网关地址冲突,则对路由器进行冲突消除操作,使连接到路由器的用户侧的客 户端设备直接向上行路由设备申请IP地址,解决了在路由器的网关地址与上行路由设备的网关地址冲突时,用户难以消除路由器的网关地址与上行路由设备的网关地址之间的冲突,导致用户无法上网,影响用户体验的问题,达到了在路由器的网关地址与上行路由设备的网关地址冲突时,能自动消除路由器的网关地址与上行路由设备的网关地址之间的冲突,使用户可正常上网,提升用户体验的效果。
需要说明的是,本发明第二实施例提供的网关地址冲突的处理装置是应用上述网关地址冲突的处理方法的装置,即上述方法的所有实施例均适用于该装置,且均能达到相同或相似的有益效果。
第三实施例
本发明的第三实施例提供了一种路由器,包括上述的网关地址冲突的处理装置。
需要说明的是,本发明第三实施例提供的路由器是包括上述网关地址冲突的处理装置的路由器,即上述网关地址冲突的处理装置的所有实施例均适用于该路由器,且均能达到相同或相似的有益效果。
本发明的实施例还提供了一种存储介质,该存储介质包括存储的程序,其中,上述程序运行时执行上述任一项所述的方法。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
本发明的实施例还提供了一种处理器,该处理器用于运行程序,其中,该程序运行时执行上述任一项方法中的步骤。
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。
工业实用性
如上所述,本发明实施例提供的一种网关地址冲突的处理方法、装置及路由器具有以下有益效果:解决了在路由器的网关地址与上行路由设备的网关地址冲突时,用户难以消除路由器的网关地址与上行路由设备的网关地址之间的冲突,导致用户无法上网,影响用户体验的问题,达到了在路由器的网关地址与上行路由设备的网关地址冲突时,能自动消除路由器的网关地址与上行路由设备的网关地址之间的冲突,使用户可正常上网,提升用户体验的效果。

Claims (18)

  1. 一种网关地址冲突的处理方法,应用于路由器,所述方法包括:
    在获取到上行路由设备分配的网络侧IP地址时,检测所述路由器的网关地址与所述上行路由设备的网关地址是否冲突;
    若所述路由器的网关地址与所述上行路由设备的网关地址冲突,则对所述路由器进行冲突消除操作。
  2. 根据权利要求1所述的方法,其中,所述对所述路由器进行冲突消除操作的步骤,包括:
    将所述路由器的网络侧网卡与所述路由器的用户侧网卡配置于同一网桥下。
  3. 根据权利要求2所述的方法,其中,在所述将所述路由器的网络侧网卡与所述路由器的用户侧网卡配置于同一网桥下的步骤之后,所述方法还包括:
    关闭所述路由器内部的动态主机配置协议DHCP服务器,并对所述用户侧网卡进行断电再上电操作;
    删除所述路由器中用于进行源IP地址转换的防火墙规则。
  4. 根据权利要求2所述的方法,其中,所述将所述路由器的网络侧网卡与所述路由器的用户侧网卡配置于同一网桥下的步骤,包括:
    将所述路由器的网络侧网卡配置于所述路由器的用户侧网卡的网桥下。
  5. 根据权利要求1所述的方法,其中,所述方法还包括:
    检测所述路由器与所述上行路由设备之间的连接是否断开;
    若所述路由器与所述上行路由设备之间的连接断开,则对所述路由器执行恢复操作。
  6. 根据权利要求5所述的方法,其中,所述对所述路由器执行恢复操作的步骤,包括:
    将所述路由器的网络侧网卡从所述路由器的用户侧网卡的网桥下卸载。
  7. 根据权利要求6所述的方法,其中,在所述将所述路由器的网络侧网卡从所述路由器的用户侧网卡的网桥下卸载的步骤之后,所述方法还包括:
    启动所述路由器内部的DHCP服务器,并对所述用户侧网卡进行断电再上电操作;
    在所述路由器中添加用于进行源IP地址转换的防火墙规则。
  8. 根据权利要求1所述的方法,其中,所述检测所述路由器的网关地址与所述上行路由设备的网关地址是否冲突的步骤,包括:
    检测所述路由器的网关地址是否与所述上行路由设备的网关地址在同一网段内;
    若所述路由器的网关地址与所述上行路由设备的网关地址在同一网段内,则确定所述路由器的网关地址与所述上行路由设备的网关地址冲突。
  9. 一种网关地址冲突的处理装置,应用于路由器,所述装置包括:
    第一检测模块,设置为在获取到上行路由设备分配的网络侧IP地址时,检测所述路由器的网关地址与所述上行路由设备的网关地址 是否冲突,并若所述路由器的网关地址与所述上行路由设备的网关地址冲突,则触发消除模块;
    消除模块,设置为根据所述第一检测模块的触发,对所述路由器进行冲突消除操作。
  10. 根据权利要求9所述的装置,其中,所述消除模块包括:
    第一消除单元,设置为将所述路由器的网络侧网卡与所述路由器的用户侧网卡配置于同一网桥下。
  11. 根据权利要求10所述的装置,其中,所述消除模块还包括:
    第二消除单元,设置为关闭所述路由器内部的动态主机配置协议DHCP服务器,并对所述用户侧网卡进行断电再上电操作;
    第三消除单元,设置为删除所述路由器中用于进行源IP地址转换的防火墙规则。
  12. 根据权利要求10所述的装置,其中,所述第一消除单元,具体设置为将所述路由器的网络侧网卡配置于所述路由器的用户侧网卡的网桥下。
  13. 根据权利要求9所述的装置,其中,所述装置还包括:
    第二检测模块,设置为检测所述路由器与所述上行路由设备之间的连接是否断开,并若所述路由器与所述上行路由设备之间的连接断开,则触发恢复模块;
    恢复模块,设置为根据所述第二检测模块的触发,对所述路由器执行恢复操作。
  14. 根据权利要求13所述的装置,其中,所述恢复模块包括:
    第一恢复单元,设置为将所述路由器的网络侧网卡从所述路由器的用户侧网卡的网桥下卸载。
  15. 根据权利要求14所述的装置,其中,所述恢复模块还包括:
    第二恢复单元,设置为启动所述路由器内部的DHCP服务器,并对所述用户侧网卡进行断电再上电操作;
    第三恢复单元,设置为在所述路由器中添加用于进行源IP地址转换的防火墙规则。
  16. 根据权利要求9所述的装置,其中,所述第一检测模块包括:
    第一检测单元,设置为检测所述路由器的网关地址是否与所述上行路由设备的网关地址在同一网段内,并若所述路由器的网关地址与所述上行路由设备的网关地址在同一网段内,则触发第二检测单元;
    第二检测单元,设置为根据所述第一检测单元的触发,确定所述路由器的网关地址与所述上行路由设备的网关地址冲突。
  17. 一种路由器,包括如权利要求9~16任一项所述的网关地址冲突的处理装置。
  18. 一种存储介质,所述存储介质包括存储的程序,其中,所述程序运行时执行权利要求1至8中任一项所述的方法。
PCT/CN2017/106643 2016-10-19 2017-10-18 一种网关地址冲突的处理方法、装置及路由器 WO2018072701A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610911954.7A CN107968844B (zh) 2016-10-19 2016-10-19 一种网关地址冲突的处理方法、装置及路由器
CN201610911954.7 2016-10-19

Publications (1)

Publication Number Publication Date
WO2018072701A1 true WO2018072701A1 (zh) 2018-04-26

Family

ID=61997074

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/106643 WO2018072701A1 (zh) 2016-10-19 2017-10-18 一种网关地址冲突的处理方法、装置及路由器

Country Status (2)

Country Link
CN (1) CN107968844B (zh)
WO (1) WO2018072701A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060221955A1 (en) * 2005-04-05 2006-10-05 Mark Enright IP addressing in joined private networks
CN1845554A (zh) * 2005-12-06 2006-10-11 华为技术有限公司 一种在3g网络中动态分配ip地址的控制方法
CN101674338A (zh) * 2009-10-16 2010-03-17 福建星网锐捷网络有限公司 Ip地址回收方法及dhcp服务器
CN102014044A (zh) * 2009-09-04 2011-04-13 技嘉科技股份有限公司 一种网域冲突避免方法及运用该方法的路由器
CN105610996A (zh) * 2016-01-29 2016-05-25 深圳市磊科实业有限公司 一种应用于交换机的dhcp冲突检测方法和装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1313265A1 (en) * 2001-11-19 2003-05-21 Thomson Licensing S.A. Method and device for address allocation for transmitting packets over a transparent bridge
WO2012163000A1 (zh) * 2011-10-11 2012-12-06 华为技术有限公司 一种报文转发的方法、设备及系统
CN102651707B (zh) * 2012-04-16 2015-04-08 深圳市共进电子股份有限公司 一种无线网桥的自动配置方法
CN103716245B (zh) * 2012-09-29 2017-02-08 上海贝尔股份有限公司 基于虚拟专用局域网服务的边缘路由器
CN103227844B (zh) * 2013-04-19 2016-04-20 深圳市吉祥腾达科技有限公司 Dhcp中二级路由ip冲突自动解决方法及装置
CN105357330B (zh) * 2015-10-22 2018-05-18 上海斐讯数据通信技术有限公司 一种防止网络设备的ip地址冲突的系统及方法
CN105577853A (zh) * 2016-03-09 2016-05-11 上海斐讯数据通信技术有限公司 一种ip网段冲突自动解决方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060221955A1 (en) * 2005-04-05 2006-10-05 Mark Enright IP addressing in joined private networks
CN1845554A (zh) * 2005-12-06 2006-10-11 华为技术有限公司 一种在3g网络中动态分配ip地址的控制方法
CN102014044A (zh) * 2009-09-04 2011-04-13 技嘉科技股份有限公司 一种网域冲突避免方法及运用该方法的路由器
CN101674338A (zh) * 2009-10-16 2010-03-17 福建星网锐捷网络有限公司 Ip地址回收方法及dhcp服务器
CN105610996A (zh) * 2016-01-29 2016-05-25 深圳市磊科实业有限公司 一种应用于交换机的dhcp冲突检测方法和装置

Also Published As

Publication number Publication date
CN107968844A (zh) 2018-04-27
CN107968844B (zh) 2022-01-11

Similar Documents

Publication Publication Date Title
US9614810B2 (en) Address allocation processing method, apparatus and system
US8281363B1 (en) Methods and systems for enforcing network access control in a virtual environment
US9152195B2 (en) Wake on cloud
JP6582554B2 (ja) シンクライアントシステム、サーバ装置、ポリシー管理装置、制御方法及び制御プログラム
EP2330862B1 (en) Wireless data card and working method thereof
JP2006262141A (ja) Ipアドレス適用方法、vlan変更装置、vlan変更システム、および検疫処理システム
US20130117836A1 (en) Auto discovery of virtual machines
WO2017215492A1 (zh) 设备检测方法及装置
WO2017032058A1 (zh) 一种网络切换方法、装置和计算机可读存储介质
CN109495369B (zh) 一种报文转发方法及装置
US20120291098A1 (en) Multimode Authentication
CN101945053B (zh) 一种报文的发送方法和装置
JP4895793B2 (ja) ネットワーク監視装置及びネットワーク監視方法
US8266257B1 (en) Systems and methods for reducing the amount of time required to reconnect to a computing network
TW201417548A (zh) 確保用戶端連接雲端可靠性的方法和用戶端
CN106878485B (zh) 一种报文处理方法及装置
WO2018072701A1 (zh) 一种网关地址冲突的处理方法、装置及路由器
WO2016177185A1 (zh) 媒体访问控制mac地址的处理方法及装置
WO2017166038A1 (zh) 通信方法和终端
CN107911494B (zh) 接入IPv6网络的方法、装置、计算机设备以及存储介质
US9591025B2 (en) IP-free end-point management appliance
US10630684B2 (en) PPPoE packets transmitting method and PPPoE server thereof
CN108259420B (zh) 一种报文处理方法及装置
WO2016179960A1 (zh) 域名系统dns解析处理方法及装置
KR20140113276A (ko) 자기 구성 근거리 네트워크 보안

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17861260

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17861260

Country of ref document: EP

Kind code of ref document: A1