CN100518126C - Method for configuring GRE tunnel and router - Google Patents
Method for configuring GRE tunnel and router Download PDFInfo
- Publication number
- CN100518126C CN100518126C CNB2007101202640A CN200710120264A CN100518126C CN 100518126 C CN100518126 C CN 100518126C CN B2007101202640 A CNB2007101202640 A CN B2007101202640A CN 200710120264 A CN200710120264 A CN 200710120264A CN 100518126 C CN100518126 C CN 100518126C
- Authority
- CN
- China
- Prior art keywords
- address
- interface
- gre
- router
- message
- 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
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention provides a method and a router for collocating GRE tunnels. The IP address is distributed for an interface of a first router through a second router and the distributed IP address is arranged at a corresponding interface as the IP address of the remote end of a tunnel. With the method and router for collocating GRE tunnel of the present invention, the GRE protocol can also be started on the condition that the interface address of the router is dynamically distributed.
Description
Technical field
The present invention relates to generic route encapsulation (GRE, the Generic RoutingEncapsulation) technology in the data communication technology field, be specifically related to a kind of method and router of configuring GRE tunnel.
Background technology
The GRE agreement is that the message to some network layer protocol (as Internet protocol IP and packet switching protocol IPX) encapsulates, and these packed messages can be transmitted in another network layer protocol (as IP).The GRE agreement is the layer 3 Tunnel protocol of Virtual Private Network (VPN, Virtual Private Network), has adopted a kind of technology that is referred to as tunnel (Tunnel) between protocol layer.The tunnel is a virtual point-to-point connection, can regard the virtual interface of supporting point-to-point connection in practice as, this interface provides a path that the message of encapsulation can be transmitted on this path, and respectively message is encapsulated and decapsulation at the two ends in a tunnel.
The most frequently used a kind of application scenarios of GRE is at present: two local networks of multi-protocols will transmit by the backbone network of single-protocol.As shown in Figure 1, local network 1 and local network 2 are local networks of operation Novell Internetwork Packet Exchange, and local network 3 and local network 4 are local networks of operation IP agreement.By between the interface B of the interface A of router-A and router B, adopting the GRE agreement to set up gre tunneling, just can communicate between local network 1 and local network 2, local network 3 and the local network 4 by the internet that moves the IP agreement.
Regulation is enabled the IP address that GRE must specify the two ends, tunnel before earlier in the GRE agreement.Therefore, in the application scenarios shown in Figure 1, before setting up gre tunneling, needing to determine in advance the IP address at two ends, tunnel, that is to say, will be fixed up before configuring GRE tunnel in interface A among Fig. 1 on two routers and the IP address of interface B.
The existence of above-mentioned restriction brings many problems for the practical application of GRE.A lot of situations in the practical application all are that the IP address of the end in the two ends, tunnel is manual appointment (determining in advance), and the IP address of an other end obtains automatically.For example, the interface that inserts (branch) router generally all is by DHCP (DHCP, Dynamic Host Configuration Protocol) mode obtains the IP address from center router, therefore, according to the present requirement of setting up gre tunneling, before configuring GRE tunnel, need to know the IP address of opposite end, tunnel, otherwise between couple in router and center router, can't enable the GRE agreement, set up gre tunneling.
Summary of the invention
Technical problem to be solved by this invention provides a kind of method and router of configuring GRE tunnel, and the interface IP address of a router in two routers is under the situation of dynamic assignment, still can set up gre tunneling between two routers.
For solving the problems of the technologies described above, it is as follows to the invention provides scheme:
A kind of method of configure generic routed encapsulation gre tunneling is used for configuring GRE tunnel between second interface of first interface of the first router and the second router, comprises step:
A, the first router enables the GRE agreement on described first interface, be the IP address of described second interface with the IP address configuration of the gre tunneling far-end of this first interface correspondence, and send the message that enables the GRE agreement to described second interface by described first interface;
B, the second router enables the GRE agreement according to the described message that enables the GRE agreement on described second interface, and when being the described first interface assignment IP address, according to institute's IP address allocated, disposes the IP address of the gre tunneling far-end of the described second interface correspondence; The first router is set the IP address of described first interface according to institute's IP address allocated.
Method of the present invention wherein, also comprises step after the described step B:
C, when the second router is the new IP of described first interface assignment address, the second router reconfigures the IP address of the gre tunneling far-end of the second interface correspondence further according to this new IP address, and it is the IP address of the gre tunneling far-end of second interface configuration that described new IP address is different from current.
Method of the present invention wherein, in the described steps A, further comprises the information of the first interface requests distributing IP address in the message of the described GRE of enabling agreement;
Among the described step B, the second router is the described first interface assignment IP address further according to the described message that enables the GRE agreement.
Method of the present invention, wherein, in the described steps A, the message of the described GRE of enabling agreement is the dynamic host configuration protocol DHCP request message, and the Optional Field in the described DHCP request message is a predetermined value.
Method of the present invention, wherein, among the described step B, described is that the first interface assignment IP address comprises:
The described DHCP request message that the second router will receive is forwarded to Dynamic Host Configuration Protocol server;
Dynamic Host Configuration Protocol server is the described first interface assignment IP address, and by the DHCP acknowledge message institute's IP address allocated is sent to the second router;
The second router is forwarded to the first router by described second interface with described DHCP acknowledge message.
Method of the present invention, wherein, described Dynamic Host Configuration Protocol server is arranged in the second router, or in the network that described Dynamic Host Configuration Protocol server is arranged on the second router is connected.
Method of the present invention, wherein, among the described step B, described is that the first interface assignment IP address comprises: the second router is the first interface assignment IP address of the first router by carrying out the peer-peer protocol ppp negotiation with the first router.
A kind of router wherein, comprising:
The GRE configuration module, the IP address that is used on the interface of this router, enabling the GRE agreement and disposes the gre tunneling far-end of this interface correspondence;
GRE enable messages sending module is used for sending the message that enables the GRE agreement to the tunnel far-end that the GRE configuration module is disposed;
The interface IP address acquisition module is used for the message of basis from the distributing IP address of tunnel far-end, obtains and set the IP address of this router interface.
Router of the present invention, wherein, the message of the described GRE of enabling agreement also comprises the information of the first interface requests distributing IP address.
A kind of router comprises:
GRE enable messages receiver module is used to receive the message that enables the GRE agreement from the tunnel far-end;
The interface IP address distribution module is used for the message according to the described GRE of enabling agreement, is remote allocation IP address, described tunnel, and the interface of the message by receiving the described GRE of enabling agreement sends the message of distributing IP address;
The GRE configuration module is used for enabling the GRE agreement on the interface of the message that receives the described GRE of enabling agreement, and according to described interface IP address distribution module institute IP address allocated, the IP address that disposes the gre tunneling far-end of this interface correspondence.
Router of the present invention, wherein, described GRE configuration module, be further used for the new IP address distributed according to described interface IP address distribution module, reconfigure the IP address of the gre tunneling far-end of described interface correspondence, the IP address of the gre tunneling far-end that it is described interface configuration that described new IP address is different from current described GRE configuration module.
Router of the present invention, wherein, described interface IP address distribution module is a Dynamic Host Configuration Protocol server.
Router of the present invention, wherein, described interface IP address distribution module is further used for being remote allocation IP address, tunnel by carrying out ppp negotiation with the tunnel far-end.
From the above as can be seen, the method of configuring GRE tunnel provided by the invention and router, by the second router is the interface assignment IP address of the first router, and according to institute's IP address allocated, the IP address of configuring GRE tunnel far-end, thereby the interface IP address in the first router is under the situation of dynamic assignment, still can enable the GRE agreement, sets up gre tunneling.And when changing in the interface IP address of being distributed, the present invention can upgrade the configuration of gre tunneling automatically, has improved the reliability of gre tunneling, has alleviated keeper's workload.
Description of drawings
Fig. 1 is the applied environment schematic diagram of gre tunneling of the prior art;
Fig. 2 is the applied environment schematic diagram of the method for the described configuring GRE tunnel of the embodiment of the invention;
Fig. 3 is the flow chart of the method for the described configuring GRE tunnel of the embodiment of the invention;
Fig. 4 is the structural representation of the described router of the embodiment of the invention.
Embodiment
The invention provides a kind of method and router of configuring GRE tunnel, the IP address of a router interface in two routers is under the situation of dynamic assignment, still can between two routers, set up gre tunneling, and, when the interface IP address of router changes, the present invention can upgrade the configuration of gre tunneling automatically, the artificial change of Unsupervised member.The present invention is described in detail by specific embodiment below in conjunction with accompanying drawing.
Figure 2 shows that the applied environment of the method for the described configuring GRE tunnel of the embodiment of the invention.Comprise two router devices among Fig. 2: the first router and the second router wherein connect by network between second interface of first interface of the first router and the second router.The method of the described configuring GRE tunnel of the embodiment of the invention, configuring GRE tunnel between first interface of the first router in Fig. 2 and second interface of the second router, as shown in Figure 3, this method may further comprise the steps:
Here, the IP address of second interface of the second router is prior appointment (the manual appointment), and the IP address of first interface of the first router is a dynamic assignment.In actual environment, the first router can be the branch node router, and the second router can be the Centroid router.Here, when configuring GRE tunnel, need on first interface, enable the GRE agreement, enable GRE, and be the IP address of this interface configuration tunnel far-end, be i.e. the IP address of second interface of the second router.
Here, the first router sends the described message that enables the GRE agreement by its first interface, can also include the information of the first interface requests distributing IP address in this message.At the first router interface IP address is when obtaining by DHCP dynamic assignment mode, the message of the described GRE of enabling agreement can be utilized the DHCP request message, optional Options field in the DHCP request message is set to a predetermined value, be used for sign and enable the GRE agreement, thereby receiving terminal can be discerned this message according to this predetermined value.
Here, the second router is after the message that receives the described GRE of the enabling agreement that the first router sends, receiving the interface of this message, promptly enable the GRE agreement on second interface, be the described first interface assignment IP address, and the gre tunneling far-end IP address that disposes the second interface correspondence is the IP address of described first interface.
Here, the IP address of described first interface is that the second router is distributed, and the concrete method of salary distribution comprises DHCP dynamic assignment and peer-peer protocol (PPP, Point to Point Protocol) negotiation mode automatically, is respectively described below:
For DHCP dynamic assignment mode, need the DHCP function will be increased in the second router, the second router is configured to Dynamic Host Configuration Protocol server, Dynamic Host Configuration Protocol server promptly is set in the second router, perhaps with network that the second router is connected in a Dynamic Host Configuration Protocol server is set.At first, the first router sends the DHCP request message to the second router, and request is the first interface assignment IP address, and this message can be the DHCP request message that an option field is described predetermined value; The second router is forwarded to Dynamic Host Configuration Protocol server with the DHCP request message that receives; Dynamic Host Configuration Protocol server is the first interface assignment IP address, and by the DHCP acknowledge message institute's IP address allocated is sent to the second router; The second router is forwarded to the first router by second interface with described DHCP acknowledge message, and last, the first router can be obtained the IP address of first interface according to this acknowledge message.Said process is suitable equally when router is opened DHCP Relay function.
For the automatic negotiation mode of PPP, the second router is after the message that receives the described GRE of enabling agreement, by carrying out ppp negotiation, be the first interface assignment IP address of the first router, and IP address allocated is sent to the first router by second interface with the first router.
Here, (for example the first router is restarted) in some cases, the second router can be the first interface assignment IP address of the first router again.When the second router is IP address of the new distribution of described first interface by modes such as DHCP or PPP, institute's IP address allocated before this IP address is different from, promptly being different from current is the IP address of the gre tunneling far-end of second interface configuration, at this moment, the second router needs the corresponding configuration of upgrading second interface, this newly assigned IP address is reconfigured for the IP address of the gre tunneling far-end of the second interface correspondence.
According to the method described above, the present invention is under the situation of dynamic assignment in the interface IP address of router, still can be between two routers configuring GRE tunnel, enable the GRE agreement.And when changing in the interface IP address of being distributed, the present invention can also upgrade the configuration of gre tunneling accordingly, has guaranteed the reliability of gre tunneling, has alleviated keeper's workload.
Based on the method for above-mentioned configuring GRE tunnel, present embodiment also provides corresponding router, as shown in Figure 4, and wherein,
The first router 41 includes:
GRE enable messages sending module 412 is used for sending the message that enables the GRE agreement to the tunnel far-end that GRE configuration module 411 is disposed.The message of the described GRE of enabling agreement also comprises the information of the first interface requests distributing IP address.
Interface IP address acquisition module 413 is used for the message of basis from the distributing IP address of tunnel far-end, the IP address that obtains this router interface.
The second router 42 includes:
GRE enable messages receiver module 421 is used to receive the message that enables the GRE agreement from the tunnel far-end.
Interface IP address distribution module 422, the message that enables the GRE agreement that the tunnel far-end that is used for receiving according to GRE enable messages receiver module 421 sends, be remote allocation IP address, described tunnel, and the interface of the message by receiving the described GRE of enabling agreement, send the message of distributing IP address to described tunnel far-end.Here, described interface IP address distribution module 422 can be a Dynamic Host Configuration Protocol server, is remote allocation IP address, tunnel by the DHCP mode.Described interface IP address distribution module 422 can also be remote allocation IP address, tunnel by carrying out ppp negotiation with the tunnel far-end.
In sum, according to the method and the router of the described configuring GRE tunnel of the embodiment of the invention, be under the situation of dynamic assignment in the interface IP address of a router, still can configuring GRE tunnel, enable the GRE agreement.And when changing in the interface IP address of being distributed, the present invention can upgrade the configuration of gre tunneling automatically, has improved the reliability of gre tunneling, has alleviated keeper's workload.
The method of configuring GRE tunnel of the present invention and router, be not restricted to listed utilization in specification and the execution mode, it can be applied to various suitable the present invention's field fully, for those skilled in the art, can easily realize additional advantage and make amendment, therefore under the situation of the spirit and scope of the universal that does not deviate from claim and equivalency range and limited, the examples shown that the present invention is not limited to specific details, representational equipment and illustrates here and describe.
Claims (13)
1. the method for a configure generic routed encapsulation gre tunneling is used for configuring GRE tunnel between second interface of first interface of the first router and the second router, it is characterized in that, comprises step:
A, the first router enables the GRE agreement on described first interface, be the IP address of described second interface with the IP address configuration of the gre tunneling far-end of this first interface correspondence, and send the message that enables the GRE agreement to described second interface by described first interface;
B, the second router enables the GRE agreement according to the described message that enables the GRE agreement on described second interface, and when being the described first interface assignment IP address, according to institute's IP address allocated, disposes the IP address of the gre tunneling far-end of the described second interface correspondence; The first router is set the IP address of described first interface according to institute's IP address allocated.
2. the method for claim 1 is characterized in that, also comprises step after the described step B:
C, when the second router is the new IP of described first interface assignment address, the second router reconfigures the IP address of the gre tunneling far-end of the second interface correspondence further according to this new IP address, and it is the IP address of the gre tunneling far-end of second interface configuration that described new IP address is different from current.
3. method as claimed in claim 1 or 2 is characterized in that, in the described steps A, further comprises the information of the first interface requests distributing IP address in the message of the described GRE of enabling agreement;
Among the described step B, the second router is the described first interface assignment IP address further according to the described message that enables the GRE agreement.
4. method as claimed in claim 3 is characterized in that, in the described steps A, the message of the described GRE of enabling agreement is the dynamic host configuration protocol DHCP request message, and the Optional Field in the described DHCP request message is a predetermined value.
5. method as claimed in claim 4 is characterized in that, among the described step B, described is that the first interface assignment IP address comprises:
The described DHCP request message that the second router will receive is forwarded to Dynamic Host Configuration Protocol server;
Dynamic Host Configuration Protocol server is the described first interface assignment IP address, and by the DHCP acknowledge message institute's IP address allocated is sent to the second router;
The second router is forwarded to the first router by described second interface with described DHCP acknowledge message.
6. method as claimed in claim 5 is characterized in that described Dynamic Host Configuration Protocol server is arranged in the second router, or in the network that described Dynamic Host Configuration Protocol server is arranged on the second router is connected.
7. method as claimed in claim 3 is characterized in that, among the described step B, described is that the first interface assignment IP address comprises: the second router is the first interface assignment IP address of the first router by carrying out the peer-peer protocol ppp negotiation with the first router.
8. a router is characterized in that, comprising:
The GRE configuration module, the IP address that is used on the interface of this router, enabling the GRE agreement and disposes the gre tunneling far-end of this interface correspondence;
GRE enable messages sending module is used for sending the message that enables the GRE agreement to the tunnel far-end that the GRE configuration module is disposed;
The interface IP address acquisition module is used for the message of basis from the distributing IP address of tunnel far-end, obtains and set the IP address of this router interface.
9. router as claimed in claim 8 is characterized in that, the message of the described GRE of enabling agreement also comprises the information of the first interface requests distributing IP address.
10. a router is characterized in that, comprising:
GRE enable messages receiver module is used to receive the message that enables the GRE agreement from the tunnel far-end;
The interface IP address distribution module is used for the message according to the described GRE of enabling agreement, is remote allocation IP address, described tunnel, and the interface of the message by receiving the described GRE of enabling agreement sends the message of distributing IP address;
The GRE configuration module is used for enabling the GRE agreement on the interface of the message that receives the described GRE of enabling agreement, and according to described interface IP address distribution module institute IP address allocated, the IP address that disposes the gre tunneling far-end of this interface correspondence.
11. router as claimed in claim 10, it is characterized in that, described GRE configuration module, be further used for the new IP address distributed according to described interface IP address distribution module, reconfigure the IP address of the gre tunneling far-end of described interface correspondence, the IP address of the gre tunneling far-end that it is described interface configuration that described new IP address is different from current described GRE configuration module.
12. router as claimed in claim 10 is characterized in that, described interface IP address distribution module is a Dynamic Host Configuration Protocol server.
13. router as claimed in claim 10 is characterized in that, described interface IP address distribution module is further used for being remote allocation IP address, tunnel by carrying out ppp negotiation with the tunnel far-end.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007101202640A CN100518126C (en) | 2007-08-14 | 2007-08-14 | Method for configuring GRE tunnel and router |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007101202640A CN100518126C (en) | 2007-08-14 | 2007-08-14 | Method for configuring GRE tunnel and router |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101119272A CN101119272A (en) | 2008-02-06 |
CN100518126C true CN100518126C (en) | 2009-07-22 |
Family
ID=39055217
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2007101202640A Active CN100518126C (en) | 2007-08-14 | 2007-08-14 | Method for configuring GRE tunnel and router |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100518126C (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101488904B (en) * | 2009-02-27 | 2011-08-03 | 杭州华三通信技术有限公司 | Method for GRE tunnel crossing network address translation apparatus and network address translation apparatus |
CN101572664B (en) * | 2009-05-27 | 2011-11-09 | 杭州华三通信技术有限公司 | GRE tunnel collocation method and router thereof |
CN103973555A (en) * | 2013-01-29 | 2014-08-06 | 华为技术有限公司 | GRE protocol tunnel building method, communication device and communication system |
EP3758307A1 (en) | 2013-07-10 | 2020-12-30 | Huawei Technologies Co., Ltd. | Method for implementing gre tunnel, access point and gateway |
CN106453027B (en) | 2013-07-12 | 2019-08-20 | 华为技术有限公司 | Gre tunneling implementation method, access device and aggregation gateway |
CN106559360B (en) * | 2015-09-24 | 2019-08-27 | 成都鼎桥通信技术有限公司 | The realization method and system of LTE broadband cluster system GRE cascade network |
-
2007
- 2007-08-14 CN CNB2007101202640A patent/CN100518126C/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN101119272A (en) | 2008-02-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11824685B2 (en) | Method for implementing GRE tunnel, access point and gateway | |
CN112165725A (en) | Message processing method and device | |
CN100518126C (en) | Method for configuring GRE tunnel and router | |
JP2020511083A (en) | Service quality control method and device, SMF, UPF, UE, PCF and AN | |
CN109156046B (en) | Home gateway and method for forwarding service thereof | |
CN109412922B (en) | Method, forwarding device, controller and system for transmitting message | |
KR20120113713A (en) | Broadband network system and implementation method thereof | |
US11917523B2 (en) | Polymorphic network control system and method supporting mobile access of terminal | |
WO2015051703A1 (en) | Method for orderly managing multi-path apn concurrent networking data transmission channel | |
CN113825251A (en) | Session establishing method, device, system and computer storage medium | |
JP7426513B2 (en) | Multi-PDN implementation method and storage medium between indoor unit and outdoor unit | |
KR102366156B1 (en) | Network relay system and data transmission method for narrowband wireless communication system | |
CN104104749A (en) | Method and device for allocating tunnel IP addresses | |
JP2020522202A (en) | Layer 3 communication implementation | |
WO2015123947A1 (en) | Method and apparatus for delivering local area network information | |
KR102560548B1 (en) | Access point, home gateway and home network system, and method for performing ip communication on the home network system | |
WO2008000387A1 (en) | A personal network comprising a plurality of clusters | |
CN113163276A (en) | Method, device and system for issuing routing information | |
CN109587749A (en) | Data transmission method for uplink and system | |
CN115080080A (en) | Device, system and method for firmware upgrading of multi-path CANopen network | |
CN112543386B (en) | Address acquisition method and related equipment | |
WO2015096043A1 (en) | Method, network device and value-added service device for deploying value-added service | |
CN109548177B (en) | Large-scale WiFi network management system and method | |
CN113411802A (en) | Dialing message processing method, network element, system and network equipment | |
TWI483605B (en) | Deployment method and computer system for network system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No. Patentee after: Xinhua three Technology Co., Ltd. Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base Patentee before: Huasan Communication Technology Co., Ltd. |