1. GRE trafiginin yapılandırması
GRE üzerinde ACL Ipsec yeniden yapılandıralım.
[CLIGURU-R1]acl 3001[CLIGURU-R1-acl-adv-3001]rule 5 permit gre source 10.0.12.1 0 destination 10.0.23.3 0 |
[CLIGURU-R3]acl 3001[CLIGURU-R3-acl-adv-3001]rule 5 permit gre source 10.0.23.3 0 destination 10.0.12.1 0 |
2.Interfaceler arası tunnel oluşturalım.
Bir tünel arabirimi oluşturulım ve encapsulation türü GRE olarak belirtelim.
Tunnel source adresi veya source interface ayarlayalım , ve tunnel destination adresini ayarlayalım.
[CLIGURU-R1]interface Tunnel 0/0/1[CLIGURU-R1-Tunnel0/0/1]ip address 100.1.1.1 24[CLIGURU-R1-Tunnel0/0/1]tunnel-protocol greInfo: Relevant configurations on this interface are deleted.[CLIGURU-R1-Tunnel0/0/1]source 10.0.12.1[CLIGURU-R1-Tunnel0/0/1]destination 10.0.23.3 |
[CLIGURU-R3]interface Tunnel 0/0/1[CLIGURU-R3-Tunnel0/0/1]ip address 100.1.1.2 24[CLIGURU-R3-Tunnel0/0/1]tunnel-protocol greInfo: Relevant configurations on this interface are deleted.[CLIGURU-R3-Tunnel0/0/1]source 10.0.23.3[CLIGURU-R3-Tunnel0/0/1]destination 10.0.12.1 |
3. OSPF yapılandırması .
[CLIGURU-R1]ospf 1[CLIGURU-R1-ospf-1]area 0[CLIGURU-R1-ospf-1-area-0.0.0.0]network 100.1.1.0 0.0.0.255[CLIGURU-R1]ospf 2 router-id 10.0.1.1[CLIGURU-R1-ospf-2]area 0[CLIGURU-R1-ospf-2-area-0.0.0.0]network 10.0.12.0 0.0.0.255 |
[CLIGURU-R3]ospf 1[CLIGURU-R3-ospf-1]area 0[CLIGURU-R3-ospf-1-area-0.0.0.0]network 100.1.1.0 0.0.0.255[CLIGURU-R3]ospf 2 router-id 10.0.3.3[CLIGURU-R3-ospf-2]area 0[CLIGURU-R3-ospf-2-area-0.0.0.0]network 10.0.23.0 0.0.0.255 |
Tunnel konfigürasyonunn yapılandırmasına display interface tunnel 0/0/1 komutu ile bakabiliriz.
[CLIGURU-R1]display interface Tunnel 0/0/1Tunnel0/0/1 current state : UPLine protocol current state : UPLast line protocol up time : 2015-01-29 12:16:41 UTC-08:00Description:Route Port,The Maximum Transmit Unit is 1500Internet Address is 100.1.1.1/24Encapsulation is TUNNEL, loopback not setTunnel source 10.0.12.1 (Serial0/0/1), destination 10.0.23.3Tunnel protocol/transport GRE/IP, key disabledkeepalive disabledChecksumming of packets disabledCurrent system time: 2015-01-29 12:19:41-08:00300 seconds input rate 32 bits/sec, 0 packets/sec300 seconds output rate 32 bits/sec, 0 packets/sec0 seconds input rate 0 bits/sec, 0 packets/sec0 seconds output rate 0 bits/sec, 0 packets/sec28 packets input, 2676 bytes0 input error28 packets output, 2612 bytes0 output errorInput:Unicast: 0 packets, Multicast: 0 packetsOutput:Unicast: 0 packets, Multicast: 28 packetsInput bandwidth utilization : —Output bandwidth utilization : — |
[CLIGURU-R3]display interface Tunnel 0/0/1Tunnel0/0/1 current state : UPLine protocol current state : UPLast line protocol up time : 2015-01-29 12:16:45 UTC-08:00Description:Route Port,The Maximum Transmit Unit is 1500Internet Address is 100.1.1.2/24Encapsulation is TUNNEL, loopback not setTunnel source 10.0.23.3 (Serial0/0/2), destination 10.0.12.1Tunnel protocol/transport GRE/IP, key disabledkeepalive disabledChecksumming of packets disabledCurrent system time: 2015-01-29 12:20:41-08:00300 seconds input rate 64 bits/sec, 0 packets/sec300 seconds output rate 72 bits/sec, 0 packets/sec0 seconds input rate 0 bits/sec, 0 packets/sec0 seconds output rate 0 bits/sec, 0 packets/sec34 packets input, 3168 bytes0 input error34 packets output, 3228 bytes0 output errorInput:Unicast: 0 packets, Multicast: 0 packetsOutput:Unicast: 0 packets, Multicast: 34 packetsInput bandwidth utilization : —Output bandwidth utilization : — |
GRE tunnel konfigürasyonunu kontrol edelim.
Routing tablosuna display ip routing-table komutu ile bakabiliriz.
[CLIGURU-R1]display ip routing-tableRoute Flags: R – relay, D – download to fib——————————————————————————Routing Tables: PublicDestinations : 15 Routes : 15Destination/Mask Proto Pre Cost Flags NextHop Interface10.0.1.0/24 Direct 0 0 D 10.0.1.1 LoopBack010.0.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack010.0.2.2/32 OSPF 10 1562 D 10.0.12.2 Serial0/0/110.0.3.3/32 OSPF 10 1562 D 100.1.1.2 Tunnel0/0/110.0.11.0/24 Direct 0 0 D 10.0.11.11 LoopBack110.0.11.11/32 Direct 0 0 D 127.0.0.1 LoopBack110.0.12.0/24 Direct 0 0 D 10.0.12.1 Serial0/0/110.0.12.1/32 Direct 0 0 D 127.0.0.1 Serial0/0/110.0.12.2/32 Direct 0 0 D 10.0.12.2 Serial0/0/110.0.23.0/24 OSPF 10 3124 D 10.0.12.2 Serial0/0/110.0.33.33/32 OSPF 10 1562 D 100.1.1.2 Tunnel0/0/1100.1.1.0/24 Direct 0 0 D 100.1.1.1 Tunnel0/0/1100.1.1.1/32 Direct 0 0 D 127.0.0.1 Tunnel0/0/1127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 |
<CLIGURU-R3>display ip routing-tableRoute Flags: R – relay, D – download to fib——————————————————————————Routing Tables: PublicDestinations : 15 Routes : 15Destination/Mask Proto Pre Cost Flags NextHop Interface10.0.1.1/32 OSPF 10 1562 D 100.1.1.1 Tunnel0/0/110.0.2.2/32 OSPF 10 1562 D 10.0.23.2 Serial0/0/210.0.3.0/24 Direct 0 0 D 10.0.3.3 LoopBack010.0.3.3/32 Direct 0 0 D 127.0.0.1 LoopBack010.0.11.11/32 OSPF 10 1562 D 100.1.1.1 Tunnel0/0/110.0.12.0/24 OSPF 10 3124 D 10.0.23.2 Serial0/0/210.0.23.0/24 Direct 0 0 D 10.0.23.3 Serial0/0/210.0.23.2/32 Direct 0 0 D 10.0.23.2 Serial0/0/210.0.23.3/32 Direct 0 0 D 127.0.0.1 Serial0/0/210.0.33.0/24 Direct 0 0 D 10.0.33.33 LoopBack110.0.33.33/32 Direct 0 0 D 127.0.0.1 LoopBack1100.1.1.0/24 Direct 0 0 D 100.1.1.2 Tunnel0/0/1100.1.1.2/32 Direct 0 0 D 127.0.0.1 Tunnel0/0/1127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 |
GRE tünel kurulduktan sonra , GRE tunnel üzerinden konfigürasyonun çalıtıgını kontrol edelim.Ipsec statisticleri temizledikten sonra bağlantıyı test edelim.
<CLIGURU-R1>reset ipsec statistics esp<CLIGURU-R1>ping -a 10.0.1.1 10.0.3.3PING 10.0.3.3: 56 data bytes, press CTRL_C to breakReply from 10.0.3.3: bytes=56 Sequence=1 ttl=255 time=70 msReply from 10.0.3.3: bytes=56 Sequence=2 ttl=255 time=70 msReply from 10.0.3.3: bytes=56 Sequence=3 ttl=255 time=70 msReply from 10.0.3.3: bytes=56 Sequence=4 ttl=255 time=80 msReply from 10.0.3.3: bytes=56 Sequence=5 ttl=255 time=30 ms— 10.0.3.3 ping statistics —5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 30/64/80 ms |
<CLIGURU-R1>display ipsec statistics espInpacket count : 8Inpacket auth count : 0Inpacket decap count : 0Outpacket count : 8Outpacket auth count : 0Outpacket encap count : 0Inpacket drop count : 0Outpacket drop count : 0BadAuthLen count : 0AuthFail count : 0PktDuplicateDrop count : 0PktSeqNoTooSmallDrop count: 0PktInSAMissDrop count : 0 |
GRE IPsec üzerinden hello paketleri dahil tüm OSPF trafiğini encapsüle eder ,
[CLIGURU-R1]interface Tunnel 0/0/1[CLIGURU-R1-Tunnel0/0/1]keepalive period 3 |
<CLIGURU-R1>display interface Tunnel 0/0/1Tunnel0/0/1 current state : UPLine protocol current state : UPLast line protocol up time : 2015-01-29 12:16:41 UTC-08:00Description:Route Port,The Maximum Transmit Unit is 1500Internet Address is 100.1.1.1/24Encapsulation is TUNNEL, loopback not setTunnel source 10.0.12.1 (Serial0/0/1), destination 10.0.23.3Tunnel protocol/transport GRE/IP, key disabledkeepalive enable period 3 retry-times 3Checksumming of packets disabledCurrent system time: 2015-01-29 12:24:55-08:00300 seconds input rate 80 bits/sec, 0 packets/sec300 seconds output rate 80 bits/sec, 0 packets/sec0 seconds input rate 0 bits/sec, 0 packets/sec0 seconds output rate 0 bits/sec, 0 packets/sec66 packets input, 6252 bytes0 input error76 packets output, 6712 bytes0 output errorInput:Unicast: 0 packets, Multicast: 0 packetsOutput:Unicast: 5 packets, Multicast: 62 packetsInput bandwidth utilization : —Output bandwidth utilization : — |
<CLIGURU-R1>display current-configuration#sysname CLIGURU-R1#acl number 3001rule 5 permit gre source 10.0.12.1 0 destination 10.0.23.3 0#interface Serial0/0/1link-protocol pppip address 10.0.12.1 255.255.255.0#interface LoopBack0ip address 10.0.1.1 255.255.255.0#interface LoopBack1ip address 10.0.11.11 255.255.255.0#interface Tunnel0/0/1ip address 100.1.1.1 255.255.255.0tunnel-protocol grekeepalive period 3source 10.0.12.1destination 10.0.23.3#ospf 1 router-id 10.0.1.1area 0.0.0.0network 100.1.1.0 0.0.0.255network 10.0.1.0 0.0.0.255network 10.0.11.0 0.0.0.255#ospf 2 router-id 10.0.1.1area 0.0.0.0network 10.0.12.0 0.0.0.255#user-interface con 0user-interface vty 0 4user-interface vty 16 20#Return |
<R2>display current-configuration#sysname R2#interface Serial0/0/1link-protocol pppip address 10.0.12.2 255.255.255.0#interface Serial0/0/2link-protocol pppip address 10.0.23.2 255.255.255.0#interface LoopBack0ip address 10.0.2.2 255.255.255.0#ospf 1 router-id 10.0.2.2area 0.0.0.0network 10.0.2.0 0.0.0.255network 10.0.12.0 0.0.0.255network 10.0.23.0 0.0.0.255#user-interface con 0user-interface vty 0 4user-interface vty 16 20#Return |
<CLIGURU-R3>display current-configuration#sysname CLIGURU-R3#acl number 3001rule 5 permit gre source 10.0.23.3 0 destination 10.0.12.1 0#interface Serial0/0/2link-protocol pppip address 10.0.23.3 255.255.255.0#interface LoopBack0ip address 10.0.3.3 255.255.255.0#interface LoopBack1ip address 10.0.33.33 255.255.255.0#interface Tunnel0/0/1ip address 100.1.1.2 255.255.255.0tunnel-protocol gresource 10.0.23.3destination 10.0.12.1#ospf 1 router-id 10.0.3.3area 0.0.0.0network 100.1.1.0 0.0.0.255network 10.0.3.0 0.0.0.255network 10.0.33.0 0.0.0.255#ospf 2 router-id 10.0.3.3area 0.0.0.0network 10.0.23.0 0.0.0.255#user-interface con 0user-interface vty 0 4user-interface vty 16 20#Return |