企業IPv6雙棧部署及IPv6-ospf
阿新 • • 發佈:2018-11-13
IPv6雙棧部署
概述
此實驗模擬一個企業外部入口網站進行IPv6改造,採用雙棧方案,即網站IPv4與IPv6共存。實驗還同時模擬了運營商網路,採用的是IPv6 OSPF。實際環境中可能不同的運營商會有不同的網路接入模式,需要根據自己的實際情況來進行調整。
前提條件:
設運營商已經分配IPv6地址: 2001:a:0:1::/64
網路裝置同時支援IPv4和IPv6協議棧。
配置運營商網路
【該模擬運營商網路由三個路由器組成,同時執行IPv4和IPv6,使用OSPF路由協議。】
配置運營商路由器Router1【運營商邊界路由器,直接與使用者路由器互聯】
配置運營商路由器Router3
配置運營商路由器Router4
配置本地網路
配置本地路由器Router0
配置本地伺服器Server0
測試配置
檢視ISP路由器Router4路由表及ping資訊
檢視ISP互聯路由器R1路由表資訊
本地伺服器上分別ping ISP地址測試IPv4和IPv6連通性
網路拓撲及ip分配地址如下:
hostname R1 ! ip cef ipv6 unicast-routing [開啟ipv6路由,cisco裝置上ipv6 cef一般在開啟ipv6路由的時候會自動啟用] ipv6 cef ! interface GigabitEthernet0/0 ip address 2.2.2.2 255.255.255.0 duplex auto speed auto ipv6 address FE80::1 link-local 【運營商路由器與組織本地網際網路路由器之間用link-local地址互聯】 ! interface GigabitEthernet0/1 ip address 4.4.4.1 255.255.255.0 duplex auto speed auto ipv6 address 2001:A:0:2::1/64 ipv6 ospf 10 area 0 【介面上啟用ipv6 ospf】 ! interface GigabitEthernet0/2 ip address 3.3.3.1 255.255.255.0 duplex auto speed auto ipv6 address 2001:A:0:3::1/64 ipv6 ospf 10 area 0 ! router ospf 1 【開啟IPv4 OSPF】 log-adjacency-changes network 3.3.3.1 0.0.0.0 area 0 network 4.4.4.1 0.0.0.0 area 0 network 2.2.2.0 0.0.0.255 area 0 ! ipv6 router ospf 10 log-adjacency-changes redistribute static 【將到公司內部的IPv6靜態路由注入到ospf中,使ISP網路可以檢視到組織內部的路由資訊】 ! ipv6 route 2001:A:0:1::/64 GigabitEthernet0/0 FE80::2 【ISP分給組織的IPv6地址段,通過靜態路由釋出到組織內部】 !
hostname r3 ! ip cef ipv6 unicast-routing ! interface GigabitEthernet0/0 ip address 5.5.5.1 255.255.255.0 duplex auto speed auto ipv6 address 2001:A:0:4::2/64 ipv6 ospf 10 area 0 ! interface GigabitEthernet0/1 ip address 3.3.3.2 255.255.255.0 duplex auto speed auto ipv6 address 2001:A:0:3::2/64 ipv6 ospf 10 area 0 ! router ospf 1 log-adjacency-changes network 3.3.3.2 0.0.0.0 area 0 network 5.5.5.0 0.0.0.255 area 0 ! ipv6 router ospf 10 log-adjacency-changes !
hostname R4 ! ip cef ipv6 unicast-routing ! ! interface GigabitEthernet0/0 ip address 5.5.5.2 255.255.255.0 duplex auto speed auto ipv6 address 2001:A:0:4::1/64 ipv6 ospf 10 area 0 ! interface GigabitEthernet0/1 ip address 4.4.4.2 255.255.255.0 duplex auto speed auto ipv6 address 2001:A:0:2::2/64 ipv6 ospf 10 area 0 ! router ospf 1 log-adjacency-changes network 4.4.4.0 0.0.0.255 area 0 network 5.5.5.0 0.0.0.255 area 0 ! ipv6 router ospf 10 log-adjacency-changes
hostname R0 ! ip cef ipv6 unicast-routing ! ipv6 cef ! ! interface GigabitEthernet0/0 ip address 2.2.2.1 255.255.255.252 duplex auto speed auto ipv6 address FE80::2 link-local ! interface GigabitEthernet0/1 ip address 2.2.2.9 255.255.255.248 duplex auto speed auto ipv6 address 2001:A:0:1:1::1/80 【將ISP分配的地址在組織內部又進一步劃分了子網】 ! ip classless ip route 0.0.0.0 0.0.0.0 2.2.2.2 ! ! ipv6 route ::/0 GigabitEthernet0/0 FE80::1 【IPv6地址預設路由】 !
IPv4 address:2.2.2.10 Netmask:255.255.255.0 Gateway:2.2.2.9 IPv6 address:2001:a:0:1:1::2/80 Gateway:2001:a:0:1:1::1
R4#sh ipv6 route IPv6 Routing Table - 8 entries OE2 2001:A:0:1::/64 [110/20] 【可以看到到注入到ospf中的組織內部IPv6路由資訊】 via FE80::290:CFF:FE69:8402, GigabitEthernet0/1 C 2001:A:0:2::/64 [0/0] via GigabitEthernet0/1, directly connected L 2001:A:0:2::2/128 [0/0] via GigabitEthernet0/1, receive O 2001:A:0:3::/64 [110/2] 【學習到的OSPF路由資訊】 via FE80::290:CFF:FE69:8402, GigabitEthernet0/1 C 2001:A:0:4::/64 [0/0] via GigabitEthernet0/0, directly connected L 2001:A:0:4::1/128 [0/0] via GigabitEthernet0/0, receive L FF00::/8 [0/0] via Null0, receive R4#ping 2001:a:0:1:1::2 [ping組織內部伺服器,如果通了證明配置成功]
R1#sh ipv6 route S 2001:A:0:1::/64 [1/0] 【有給組織分配的靜態路由資訊】 via FE80::2, GigabitEthernet0/0 C 2001:A:0:2::/64 [0/0] via GigabitEthernet0/1, directly connected L 2001:A:0:2::1/128 [0/0] via GigabitEthernet0/1, receive C 2001:A:0:3::/64 [0/0] via GigabitEthernet0/2, directly connected L 2001:A:0:3::1/128 [0/0] via GigabitEthernet0/2, receive O 2001:A:0:4::/64 [110/2] via FE80::205:5EFF:FE79:B602, GigabitEthernet0/2 L FF00::/8 [0/0] via Null0, receive
C:\>ping 2001:a:0:4::1 Pinging 2001:a:0:4::1 with 32 bytes of data: Reply from 2001:A:0:4::1: bytes=32 time=2ms TTL=253 Reply from 2001:A:0:4::1: bytes=32 time<1ms TTL=253 Reply from 2001:A:0:4::1: bytes=32 time<1ms TTL=253 Reply from 2001:A:0:4::1: bytes=32 time<1ms TTL=253 C:\>ping 5.5.5.1 Pinging 5.5.5.1 with 32 bytes of data: Reply from 5.5.5.1: bytes=32 time<1ms TTL=253 Reply from 5.5.5.1: bytes=32 time<1ms TTL=253 Reply from 5.5.5.1: bytes=32 time<1ms TTL=253 Reply from 5.5.5.1: bytes=32 time<1ms TTL=253 【證明已經完全聯通】