CCNP(ISCW)實驗:配置GRE隧道

CCNP(ISCW)實驗:配置GRE隧道
預配置

各路由器上的配置
R1(config)#int lo0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#int s2/1
R1(config-if)#ip add 192.168.0.1 255.255.255.0
R1(config-if)#no sh




R2(config)#int s2/1
R2(config-if)#ip add 192.168.0.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int s2/2
R2(config-if)#ip add 172.16.0.2 255.255.255.0
R2(config-if)#no sh




R3(config)#int s2/1
R3(config-if)#ip add 172.16.0.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int lo0
R3(config-if)#ip add 3.3.3.3 255.255.255.0



實驗過程
第一步:配置各路由器使用協議
R1(config)#router ei 11
R1(config-router)#no au
R1(config-router)#net 192.168.0.0



R2(config)#router ei 11
R2(config-router)#no au
R2(config-router)#net 192.168.0.0
R2(config-router)#net 172.16.0.0


R3(config)#router ei 11
R3(config-router)#net 172.16.0.0
R3(config-router)#no au

第二步:檢查R1、R3是否學習到路由
R1#sh ip rout
…………
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
172.16.0.0/24 is subnetted, 1 subnets
D 172.16.0.0 [90/2681856] via 192.168.0.2, 00:01:06, Serial2/1
C 192.168.0.0/24 is directly connected, Serial2/1






R3#sh ip rout
…………
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, Serial2/1
D 192.168.0.0/24 [90/2681856] via 172.16.0.2, 00:01:07, Serial2/1





第三步:在R1、R3上創建GRE隧道
R1(config)#int tunnel 0
R1(config-if)#tunnel source s2/1
//這裏的源地址可以爲接口,也可以爲此接口的ip地址。
R1(config-if)#tunnel destination 172.16.0.3
//這裏的目標,只能寫ip地址。
R1(config-if)#ip add 10.0.0.1 255.255.255.0





R3(config)#int tunnel 0
R3(config-if)#tunnel source s2/1
R3(config-if)#tunnel destination 192.168.0.1
R3(config-if)#ip add 10.0.0.3 255.255.255.0


第四步:在R1上ping R3的10.0.0.3 接口進行測試
R1#debug ip pack detail
IP packet debugging is on (detailed)
R1#ping 10.0.0.3


Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/93/140 ms
R1#
Jan 6 22:10:06.315: IP: s=192.168.0.2 (Serial2/1), d=224.0.0.10, len 60, rcvd 2, proto=88
Jan 6 22:10:06.667: IP: tableid=0, s=10.0.0.1 (local), d=10.0.0.3 (Tunnel0), routed via FIB
Jan 6 22:10:06.671: IP: s=10.0.0.1 (local), d=10.0.0.3 (Tunnel0), len 100, sending
Jan 6 22:10:06.675: ICMP type=8, code=0
*Jan 6 22:10:06.675: IP: s=192.168.0.1 (Tunnel0), d=172.16.0.3 (Serial2/1), len 124, sending, proto=47






第五步:配置eigrp as 22 通過tunnel 0 建立鄰接關係
R3(config)#router ei 22
R3(config-router)#net 10.0.0.0
//運行路由協議的目的爲,可以使它們的流量能通過隧道。
R1(config)#router ei 22
R1(config-router)#net 10.0.0.0




第六步:在R1上查看eigrp鄰接關係
R1#sh ip ei nei 22
IP-EIGRP neighbors for process 22
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec) (ms) Cnt Num
0 10.0.0.3 Tu0 12 00:00:54 1 4500 0 1
//通過tunnel 0 已經與R3建立了鄰接關係





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章