650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/044P51D2-0.png "title =" .png "/>
Basic configurations:
1) The loopback ports of R1 and R2 are 192.168.1.1/24 and 192.168.2.1/24, respectively.
2) the IP addresses at both ends of the link use the vro ID, for example, s0/0: 192.168.12.1 of R1.
Q1: What is tunnel?
Q2: How to Create tunnel in GRE?
Q3: tunnel details.
Answer1:
Tunnel is a virtual interface similar to the loopback interface and can be used to hide paths. For example, if you build a GRE channel on R1 and R4, R2 and R3 will be hidden. For details, see:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/044P554G-1.jpg "title =" 36020130912205327088.jpg"/>
(192.168.4.2 is the IP address of a tunnel port !) The result shows that R2 and R3 are hidden, that is, a tunnel directly connected to R4 is established.
Answer2:
Tunnel configuration steps:
Step 1: configure the ip address 192.168.4.1255.255.255.0 similar to the traditional interface configuration)
Step 2: Specify the tunnel source and destination
Tunnelsource s0/0
Tunnel destination 192.168.34.4
Tunnel mode gre ip this command is enabled by default)
Step 3: Use tunnel to use static routing to specify tunnel communication)
On R1: ip route 192.168.2.0 255.255.255.0 tunnel0 (equivalent configuration on R2)
Answer3:
1) if no static route is used, it indicates that tunnel is used, and the ring return port is declared to enter the ospf process and the dynamic routing protocol is used, the result of traceroute 192.168.2.1 on R1 is:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/044P5JI-2.jpg "title =" 36020130912210934059.jpg"/>
In this way, only the original path can be forwarded !!!
2) Can I assign IP addresses of different network segments to the tunne0 ports? Can I not assign an IP address for tunnel0?
Test 1: assign IP addresses of different network segments to the tunnel R1 tunnel0: 192.168.5.1 R2 tunnel0: 192.168.4.2)
The result is as follows:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/044P54E1-3.jpg "title =" 36020130912211530637.jpg"/>
Test 2: Do not assign an IP address for tunnel0
The result is as follows:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/044P551H-4.jpg "title =" 36020130912211735520.jpg"/>
Summary: The author believes that because the static route is configured on R1 and R4, tunnel0 is the outbound interface or next hop of the static route! The next hop of a static route must be reachable. Otherwise, the route cannot be added to the routing table!
Lab proof:
Tunnel0 interface of R1:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/044P56462-5.jpg "title =" 36020130912212314228.jpg" style = "float: none;"/>
Static Routing of R1:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/044P51327-6.jpg "title =" 360201309122122412.jpg"/>
Real-time route table of R1:
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/044P5C22-7.jpg "style =" float: none; "title =" 36020130912212253228.jpg"/>
It can be seen that the existence of tunnel0 IP address is a necessary condition for the existence of static routes.
This article is from the "Man Yu Tian" blog, please be sure to keep this source http://nanjingzhonglei.blog.51cto.com/5890022/1296224