GRE隧道配置

拓扑如下:

 

R1上的配置
Router>
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho R1
R1(config)#int lo 0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#int fastEthernet 0/0
R1(config-if)#ip add 12.0.0.1 255.255.255.0
R1(config-if)#no shu
R1(config-if)#exit
R1(config)#interface FastEthernet0/0
R1(config-if)#ip address 192.168.0.1 255.255.255.0
R1(config-if)#exit
R1(config)#router eigrp 100
R1(config-router)#network 192.168.0.0
R1(config-router)#exit
R1(config)#exit
查看R1的路由表
R1#sho ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     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/30720] via 192.168.0.2, 00:00:34, FastEthernet0/0
C    192.168.0.0/24 is directly connected, FastEthernet0/0
R1#
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface tunnel 0
R1(config-if)#tunnel source f0/0
R1(config-if)#tunnel destination 172.16.0.3
R1(config-if)#ip add 10.0.0.1 255.255.255.0
R1(config-if)#exit

 

 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho R2
R2(config)#int fastEthernet 0/1
R2(config-if)#ip add 192.168.0.2 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#int fastEthernet 0/0
R2(config-if)#ip add 172.16.0.2 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#
R2(config)#int lo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#no shu
R2(config-if)#exit
R2(config)#router eigrp 100
R2(config-router)#no auto-summary
R2(config-router)#network 192.168.0.0
R2(config-router)#net 172.16.0.0
R2(config-router)#exit
R2(config)#

R2#sho ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.0.0 is directly connected, FastEthernet0/0
C    192.168.0.0/24 is directly connected, FastEthernet0/1

 


Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ho R3
R3(config)#interface FastEthernet0/1
R3(config-if)#ip address 172.16.0.3 255.255.255.0
R3(config-if)#
R3(config-if)#exit
R3(config)#interface FastEthernet0/1
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#int lo 0
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R3(config-if)#exit
R3(config)#router eigrp 100
R3(config-router)#net 172.16.0.0
R3(config-router)#exit
R3(config)#exit


R3#sho ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     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, FastEthernet0/1
D    192.168.0.0/24 [90/30720] via 172.16.0.2, 00:00:33, FastEthernet0/1


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


R3#ping 10.0.0.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 62/62/63 ms

配置EIGRPAS200 通过tunnel0建立邻居关系
R1(config)#router eigrp 200
R1(config-router)#net 10.0.0.0

R3(config)#router eigrp 200
R3(config-router)#net 10.0.0.0

在R1上查看邻接关系
R1#sho ip eigrp neighbors 200

IP-EIGRP neighbors for process 200
H   Address         Interface      Hold Uptime    SRTT   RTO   Q   Seq
                                   (sec)          (ms)        Cnt  Num
0   10.0.0.3        Tun0           11   00:00:16  40     1000  0   1

 

你可能感兴趣的:(职场,休闲,gre,隧道配置)