您的位置:首页 > 理论基础 > 计算机网络

IPv6使用隧道穿越IPv4网络

2009-09-20 20:08 766 查看
IPv6使用隧道穿越IPv4网络配置IPv6的手动模式 手动配置隧道是比较容易实现的隧道技术,但其有很大局限性,管理难度很大,每增加一个隧道都需要手动配置

配置如下:路由器R1
R1#sh running-config Building configuration...Current configuration : 1364 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R1!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!ip subnet-zeroip cef!!ipv6 unicast-routing!!!interface FastEthernet0/0no ip addressduplex halfipv6 address 2001:2::1/64ipv6 rip rip enable!interface Ethernet1/0no ip addressduplex halfipv6 address 2001:1::1/64ipv6 rip rip enable!interface Ethernet1/1no ip addressshutdownduplex half!interface Ethernet1/2no ip addressshutdownduplex half!interface Ethernet1/3no ip addressshutdownduplex half!interface Serial2/0no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/1no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!ip classlessno ip http serverno ip http secure-server!!!logging alarm informationalipv6 router rip rip!!control-plane!!gatekeepershutdown!!line con 0exec-timeout 0 0stopbits 1line aux 0stopbits 1line vty 0 4!!end
路由器R2
R2#SH RUNning-config Building configuration...Current configuration : 1577 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R2!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!ip subnet-zeroip cef!!!!!ipv6 unicast-routing!!!interface Tunnel0no ip addressipv6 address 2001:DB:1::1/64ipv6 rip rip enabletunnel source Serial2/0tunnel destination 192.32.1.1tunnel mode ipv6ip!interface FastEthernet0/0no ip addressduplex halfipv6 address 2001:2::2/64ipv6 rip rip enable!interface Ethernet1/0no ip addressshutdownduplex half!interface Ethernet1/1no ip addressshutdownduplex half!interface Ethernet1/2no ip addressshutdownduplex half!interface Ethernet1/3no ip addressshutdownduplex half!interface Serial2/0ip address 192.23.1.1 255.255.255.0serial restart-delay 0no dce-terminal-timing-enable!interface Serial2/1no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!router ospf 10log-adjacency-changesnetwork 192.23.1.0 0.0.0.255 area 0!ip classlessno ip http serverno ip http secure-server!!!logging alarm informationalipv6 router rip rip!!!control-plane!!!!!!gatekeepershutdown!!line con 0exec-timeout 0 0stopbits 1line aux 0stopbits 1line vty 0 4!!end
路由器R3
R3#sh running-config Building configuration...Current configuration : 1383 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R3!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!ip subnet-zeroip cef!!interface FastEthernet0/0no ip addressshutdownduplex half!interface Ethernet1/0no ip addressshutdownduplex half!interface Ethernet1/1no ip addressshutdownduplex half!interface Ethernet1/2no ip addressshutdownduplex half!interface Ethernet1/3no ip addressshutdownduplex half!interface Serial2/0ip address 192.23.1.2 255.255.255.0serial restart-delay 0no dce-terminal-timing-enable!interface Serial2/1ip address 192.32.1.2 255.255.255.0serial restart-delay 0no dce-terminal-timing-enable!interface Serial2/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!router ospf 10log-adjacency-changesnetwork 192.23.1.0 0.0.0.255 area 0network 192.32.1.0 0.0.0.255 area 0!ip classlessno ip http serverno ip http secure-server!!!logging alarm informational!!!!control-plane!!gatekeepershutdown!!line con 0exec-timeout 0 0stopbits 1line aux 0stopbits 1line vty 0 4!!end
路由器R4
R4#sh running-config Building configuration...Current configuration : 1577 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R4!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!ip subnet-zeroip cef!!!!!ipv6 unicast-routing!!!!interface Tunnel0no ip addressipv6 address 2001:DB:1::2/64ipv6 rip rip enabletunnel source Serial2/0tunnel destination 192.23.1.1tunnel mode ipv6ip!interface FastEthernet0/0no ip addressduplex halfipv6 address 2001:3::1/64ipv6 rip rip enable!interface Ethernet1/0no ip addressshutdownduplex half!interface Ethernet1/1no ip addressshutdownduplex half!interface Ethernet1/2no ip addressshutdownduplex half!interface Ethernet1/3no ip addressshutdownduplex half!interface Serial2/0ip address 192.32.1.1 255.255.255.0serial restart-delay 0no dce-terminal-timing-enable!interface Serial2/1no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!router ospf 10log-adjacency-changesnetwork 192.32.1.0 0.0.0.255 area 0!ip classlessno ip http serverno ip http secure-server!!!logging alarm informationalipv6 router rip rip!!!control-plane!!!gatekeepershutdown!!line con 0exec-timeout 0 0stopbits 1line aux 0stopbits 1line vty 0 4!!end
路由器R5
R5#sh running-config Building configuration...Current configuration : 1364 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R5!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!ip subnet-zeroip cef!!!!!ipv6 unicast-routing!!!!interface FastEthernet0/0no ip addressduplex halfipv6 address 2001:3::2/64ipv6 rip rip enable!interface Ethernet1/0no ip addressduplex halfipv6 address 2001:4::1/64ipv6 rip rip enable!interface Ethernet1/1no ip addressshutdownduplex half!interface Ethernet1/2no ip addressshutdownduplex half!interface Ethernet1/3no ip addressshutdownduplex half!interface Serial2/0no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/1no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!ip classlessno ip http serverno ip http secure-server!!!logging alarm informationalipv6 router rip rip!!!!!control-plane!!!!gatekeepershutdown!!line con 0exec-timeout 0 0stopbits 1line aux 0stopbits 1line vty 0 4!!end
使用show命令查看其状态信息
R5#sh ipv6 routeIPv6 Routing Table - 9 entriesCodes: C - Connected, L - Local, S - Static, R - RIP, B - BGPU - Per-user Static routeI1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summaryO - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2R 2001:1::/64 [120/4]via FE80::C800:1AFF:FE38:0, FastEthernet0/0R 2001:2::/64 [120/3]via FE80::C800:1AFF:FE38:0, FastEthernet0/0C 2001:3::/64 [0/0]via ::, FastEthernet0/0L 2001:3::2/128 [0/0]via ::, FastEthernet0/0C 2001:4::/64 [0/0]via ::, Ethernet1/0L 2001:4::1/128 [0/0]via ::, Ethernet1/0R 2001:DB:1::/64 [120/2]via FE80::C800:1AFF:FE38:0, FastEthernet0/0L FE80::/10 [0/0]via ::, Null0L FF00::/8 [0/0]via ::, Null0R5#R4#sh int tunnel 0Tunnel0 is up, line protocol is up Hardware is TunnelMTU 1514 bytes, BW 9 Kbit, DLY 500000 usec, reliability 255/255, txload 1/255, rxload 1/255Encapsulation TUNNEL, loopback not setKeepalive not setTunnel source 192.32.1.1 (Serial2/0), destination 192.23.1.1Tunnel protocol/transport IPv6/IPTunnel TTL 255Fast tunneling enabledTunnel transmit bandwidth 8000 (kbps)Tunnel receive bandwidth 8000 (kbps)Last input 00:00:04, output 00:00:06, output hang neverLast clearing of "show interface" counters neverInput queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0Queueing strategy: fifoOutput queue: 0/0 (size/max)5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec102 packets input, 15384 bytes, 0 no bufferReceived 0 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort140 packets output, 17136 bytes, 0 underruns0 output errors, 0 collisions, 0 interface resets0 output buffer failures, 0 output buffers swapped outR4#sh ipv6 interface tunnel 0Tunnel0 is up, line protocol is upIPv6 is enabled, link-local address is FE80::C020:101 No Virtual link-local address(es):Global unicast address(es):2001:DB:1::2, subnet is 2001:DB:1::/64 Joined group address(es):FF02::1FF02::2FF02::9FF02::1:FF00:2FF02::1:FF20:101MTU is 1480 bytesICMP error messages limited to one every 100 millisecondsICMP redirects are enabledICMP unreachables are sentND DAD is enabled, number of DAD attempts: 1ND reachable time is 30000 millisecondsHosts use stateless autoconfig for addresses.
配置自动IPv4兼容模式 当您配置IPv4兼容的隧道,没有明确指定隧道目标的IPv4地址。隧道目的地是自动计算从IPv6路由的下一跳地址。为了提供对这些隧道的路线,路由定义明确的邻居地址协议,必须BGP或静态的路由,在这种情况下,你需要使用一个IPv4的BGP邻居的IPv6地址或静态路由下一跳地址兼容的IPv6地址。这种隧道技术目前已过时,思科建议您使用IPv6的ISATAP隧道技术。

配置如下:路由器R1
R1#sh running-config Building configuration...Current configuration : 1370 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R1!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!ip subnet-zeroip cef!!!!!ipv6 unicast-routing!!!interface FastEthernet0/0no ip addressduplex halfipv6 address 2001:2::1:1/112ipv6 rip rip enable!interface Ethernet1/0no ip addressduplex halfipv6 address 2001:1::1:1/112ipv6 rip rip enable!interface Ethernet1/1no ip addressshutdownduplex half!interface Ethernet1/2no ip addressshutdownduplex half!interface Ethernet1/3no ip addressshutdownduplex half!interface Serial2/0no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/1no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!ip classlessno ip http serverno ip http secure-server!!!logging alarm informationalipv6 router rip rip!!!!!control-plane!!!!!!gatekeepershutdown!!line con 0exec-timeout 0 0stopbits 1line aux 0stopbits 1line vty 0 4!!end
路由器R2
R2#sh running-config Building configuration...Current configuration : 1854 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R2!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!ip subnet-zeroip cef!!!!!ipv6 unicast-routing!!!!interface Tunnel0no ip addressno ip redirectsipv6 rip rip enabletunnel source Serial2/0tunnel mode ipv6ip auto-tunnel!interface FastEthernet0/0no ip addressduplex halfipv6 address 2001:2::1:2/112ipv6 rip rip enable!interface Ethernet1/0no ip addressshutdownduplex half!interface Ethernet1/1no ip addressshutdownduplex half!interface Ethernet1/2no ip addressshutdownduplex half!interface Ethernet1/3no ip addressshutdownduplex half!interface Serial2/0ip address 192.23.1.1 255.255.255.0serial restart-delay 0no dce-terminal-timing-enable!interface Serial2/1no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!router ospf 10log-adjacency-changesnetwork 192.23.1.0 0.0.0.255 area 0!router bgp 100no bgp default ipv4-unicastbgp log-neighbor-changesneighbor ::192.32.1.1 remote-as 100!address-family ipv6neighbor ::192.32.1.1 activateneighbor ::192.32.1.1 next-hop-selfbgp redistribute-internalnetwork 2001:2::1:0/112exit-address-family!ip classlessno ip http serverno ip http secure-server!!!logging alarm informationalipv6 router rip ripredistribute bgp 100 metric 2!!!!!control-plane!!!!!!gatekeepershutdown!!line con 0exec-timeout 0 0stopbits 1line aux 0stopbits 1line vty 0 4!!end
路由器R3
R3#sh running-config Building configuration...Current configuration : 1383 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R3!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!ip subnet-zeroip cef!!!!interface FastEthernet0/0no ip addressshutdownduplex half!interface Ethernet1/0no ip addressshutdownduplex half!interface Ethernet1/1no ip addressshutdownduplex half!interface Ethernet1/2no ip addressshutdownduplex half!interface Ethernet1/3no ip addressshutdownduplex half!interface Serial2/0ip address 192.23.1.2 255.255.255.0serial restart-delay 0no dce-terminal-timing-enable!interface Serial2/1ip address 192.32.1.2 255.255.255.0serial restart-delay 0no dce-terminal-timing-enable!interface Serial2/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!router ospf 10log-adjacency-changesnetwork 192.23.1.0 0.0.0.255 area 0network 192.32.1.0 0.0.0.255 area 0!ip classlessno ip http serverno ip http secure-server!!!logging alarm informational!!!!control-plane!!!!!!gatekeepershutdown!!line con 0exec-timeout 0 0stopbits 1line aux 0stopbits 1line vty 0 4!!end
路由器R4
R4#sh running-config Building configuration...Current configuration : 1854 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R4!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!ip subnet-zeroip cef!!!!!ipv6 unicast-routing!!!!interface Tunnel0no ip addressno ip redirectsipv6 rip rip enabletunnel source Serial2/0tunnel mode ipv6ip auto-tunnel!interface FastEthernet0/0no ip addressduplex halfipv6 address 2001:3::1:1/112ipv6 rip rip enable!interface Ethernet1/0no ip addressshutdownduplex half!interface Ethernet1/1no ip addressshutdownduplex half!interface Ethernet1/2no ip addressshutdownduplex half!interface Ethernet1/3no ip addressshutdownduplex half!interface Serial2/0ip address 192.32.1.1 255.255.255.0serial restart-delay 0no dce-terminal-timing-enable!interface Serial2/1no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!router ospf 10log-adjacency-changesnetwork 192.32.1.0 0.0.0.255 area 0!router bgp 100no bgp default ipv4-unicastbgp log-neighbor-changesneighbor ::192.23.1.1 remote-as 100!address-family ipv6neighbor ::192.23.1.1 activateneighbor ::192.23.1.1 next-hop-selfbgp redistribute-internalnetwork 2001:3::1:0/112exit-address-family!ip classlessno ip http serverno ip http secure-server!!!logging alarm informationalipv6 router rip ripredistribute bgp 100 metric 2!!!!!control-plane!!!!!!gatekeepershutdown!!line con 0exec-timeout 0 0stopbits 1line aux 0stopbits 1line vty 0 4!!end
路由器R5
R5#sh running-config Building configuration...Current configuration : 1370 bytes!version 12.4service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname R5!boot-start-markerboot-end-marker!!no aaa new-model!resource policy!ip subnet-zeroip cef!!!!!ipv6 unicast-routing!!!!!interface FastEthernet0/0no ip addressduplex halfipv6 address 2001:3::1:2/112ipv6 rip rip enable!interface Ethernet1/0no ip addressduplex halfipv6 address 2001:4::1:1/112ipv6 rip rip enable!interface Ethernet1/1no ip addressshutdownduplex half!interface Ethernet1/2no ip addressshutdownduplex half!interface Ethernet1/3no ip addressshutdownduplex half!interface Serial2/0no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/1no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/2no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!interface Serial2/3no ip addressshutdownserial restart-delay 0no dce-terminal-timing-enable!ip classlessno ip http serverno ip http secure-server!!!logging alarm informationalipv6 router rip rip!!!!!control-plane!!!!!!gatekeepershutdown!!line con 0exec-timeout 0 0stopbits 1line aux 0stopbits 1line vty 0 4!!end
查看路由器状态信息
R5#sh ipv6 routeIPv6 Routing Table - 8 entriesCodes: C - Connected, L - Local, S - Static, R - RIP, B - BGPU - Per-user Static routeI1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summaryO - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2R ::/96 [120/2]via FE80::C800:1AFF:FE38:0, FastEthernet0/0R 2001:2::1:0/112 [120/3]via FE80::C800:1AFF:FE38:0, FastEthernet0/0C 2001:3::1:0/112 [0/0]via ::, FastEthernet0/0L 2001:3::1:2/128 [0/0]via ::, FastEthernet0/0C 2001:4::1:0/112 [0/0]via ::, Ethernet1/0L 2001:4::1:1/128 [0/0]via ::, Ethernet1/0L FE80::/10 [0/0]via ::, Null0L FF00::/8 [0/0]via ::, Null0!R4#sh bgp ipv6 unicast BGP table version is 3, local router ID is 192.32.1.1Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP, e - EGP, ? - incompleteNetwork Next Hop Metric LocPrf Weight Path*>i2001:2::1:0/112 ::192.23.1.1 0 100 0 i*> 2001:3::1:0/112 :: 0 32768 iR4#sh bgp ipv6 unicast summary BGP router identifier 192.32.1.1, local AS number 100BGP table version is 3, main routing table version 32 network entries using 298 bytes of memory2 path entries using 152 bytes of memory3/2 BGP path/bestpath attribute entries using 372 bytes of memory0 BGP route-map cache entries using 0 bytes of memory0 BGP filter-list cache entries using 0 bytes of memoryBGP using 822 total bytes of memoryBGP activity 2/0 prefixes, 2/0 paths, scan interval 60 secsNeighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd::192.23.1.1 4 100 20 20 3 0 0 00:15:56 1R4#R4#sh ipv6 int tunnel 0Tunnel0 is up, line protocol is upIPv6 is enabled, link-local address is FE80::C020:101 No Virtual link-local address(es):Global unicast address(es):::192.32.1.1, subnet is ::/96 Joined group address(es):FF02::1FF02::2FF02::9FF02::1:FF20:101MTU is 1480 bytesICMP error messages limited to one every 100 millisecondsICMP redirects are enabledICMP unreachables are sentND DAD is not supportedND reachable time is 30000 millisecondsHosts use stateless autoconfig for addresses.R4#sh int tunnel 0Tunnel0 is up, line protocol is up Hardware is TunnelMTU 1514 bytes, BW 9 Kbit, DLY 500000 usec, reliability 255/255, txload 1/255, rxload 1/255Encapsulation TUNNEL, loopback not setKeepalive not setTunnel source 192.32.1.1 (Serial2/0), destination UNKNOWNTunnel protocol/transport IPv6 auto-tunnelFast tunneling enabledTunnel transmit bandwidth 8000 (kbps)Tunnel receive bandwidth 8000 (kbps)Last input 00:00:19, output 00:00:13, output hang neverLast clearing of "show interface" counters neverInput queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0Queueing strategy: fifoOutput queue: 0/0 (size/max)5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec186 packets input, 21178 bytes, 0 no bufferReceived 0 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort372 packets output, 42926 bytes, 0 underruns0 output errors, 0 collisions, 0 interface resets0 output buffer failures, 0 output buffers swapped out
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  网络 职场 休闲 隧道