基于IPv6靜態(tài)路由和默認路由的配置
成都創(chuàng)新互聯(lián)公司2013年開創(chuàng)至今,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項目成都做網(wǎng)站、網(wǎng)站設(shè)計網(wǎng)站策劃,項目實施與項目整合能力。我們以讓每一個夢想脫穎而出為使命,1280元惠山做網(wǎng)站,已為上家服務(wù),為惠山各地企業(yè)和個人服務(wù),聯(lián)系電話:13518219792實驗環(huán)境:
實驗背景:在路由器R1上配置3個環(huán)回接口IPv6地址,分別模擬三個不同的IPv6前綴,作為IPV6目標網(wǎng)絡(luò),然后,在路由器R2上為三個IPv6前綴配置靜態(tài)路由,并檢測其連通性,最后使用IPv6的默認路由替代靜態(tài)路由條目。
第一步:為路由器R1和R2完成基礎(chǔ)配置,包括啟動IPv6和地址配置,并激活相關(guān)的接口,配置如下:
R1上的配置:
R1(config)#ipv6 unicast-routing //啟動IPv6的路由功能,否則靜態(tài)路由無法完成//
R1(config)#int f0/0 //進入f0/0接口
R1(config-if)#ipv6 add 2001:10::1/64 //為該接口配置IPv6地址
R1(config-if)#no sh
R1(config)#interface lo1
R1(config-if)#ipv6 add 2001:2::1/64
R1(config-if)#ex
R1(config)#int lo2
R1(config-if)#ipv6 add 2001:3::1/64
R1(config-if)#ex
R1(config)#int lo3
R1(config-if)#ipv6 add 2001:4::1/64
R1(config-if)#ex
R2上的配置:
R2(config)#ipv6 unicast-routing
R2(config)#int f0/0
R2(config-if)#ipv6 add 2001:10::2/64
R2(config-if)#no sh
第二步:在路由器R2上ping R1上的環(huán)回IPv6地址,結(jié)果為ping不通,因為在路由器R2上沒有到目標地址的路由,關(guān)于這一技術(shù)知識點與IPv4的環(huán)境相同,要配置IPv6靜態(tài)和默認路由功能類似于IPv4,但是書寫形式還存在一定的區(qū)別,而默認路由是一種特殊的靜態(tài)路由。
IPv6靜態(tài)路由的格式:
ipv6 route 【目標IPv6前綴】 【出站接口】 【下一跳IPv6地址】
目標IPv6前綴:指示目標IPv6網(wǎng)絡(luò),這與IPv4的目標子網(wǎng)的意義相同。
出站接口:當前路由器轉(zhuǎn)發(fā)數(shù)據(jù)包的出站接口,如果使用了鄰接路由器的IPv6本地鏈路地址來作為下一跳地址,那么在靜態(tài)路由的語法中必須包含出站接口關(guān)鍵字。
下一跳IPv6地址:要到達目標網(wǎng)絡(luò)所要經(jīng)歷的下一跳路由器的IPv6地址,這與IPv4的環(huán)境相同。注意:根據(jù)RFC2461規(guī)定,路由器必須能夠確定下一跳路由器的本地鏈路地址,所以,在配置IPv6靜態(tài)路由時,下一跳地址建議配置為鄰接路由器本地鏈路IPv6地址,在本次實驗中,可以在R1上使用show ipv6 interface f0/0來查看:
R1#sho ipv6 int f0/0
FastEthernet0/0 is up, line protocol is up
IPv6 is enabled, link-local address is FE80::C800:1AFF:FE74:8
No Virtual link-local address(es):
Global unicast address(es):
2001:10::1, subnet is 2001:10::/64
Joined group address(es):
FF02::1
FF02::2
FF02::1:FF00:1
FF02::1:FF74:8
MTU is 1500 bytes
ICMP error messages limited to one every 100 milliseconds
ICMP redirects are enabled
ICMP unreachables are sent
ND DAD is enabled, number of DAD attempts: 1
ND reachable time is 30000 milliseconds (using 19434)
ND advertised reachable time is 0 (unspecified)
ND advertised retransmit interval is 0 (unspecified)
ND router advertisements are sent every 200 seconds
ND router advertisements live for 1800 seconds
ND advertised default router preference is Medium
Hosts use stateless autoconfig for addresses.
在R2上配置靜態(tài)路由:
R2(config)#ipv6 route 2001:2::/64 f0/0 FE80::C800:1AFF:FE74:8
R2(config)#ipv6 route 2001:3::/64 f0/0 FE80::C800:1AFF:FE74:8
R2(config)#ipv6 route 2001:4::/64 f0/0 FE80::C800:1AFF:FE74:8
配置完成后,查看自己的路由表(show ipv6 route),可以看到被添加的三條靜態(tài)路由,然后再次測試與目標網(wǎng)段進行通訊。
R2#sho ipv6 route
IPv6 Routing Table - Default - 6 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
B - BGP, M - MIPv6, R - RIP, I1 - ISIS L1
I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
EX - EIGRP external
O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
S 2001:2::/64 [1/0]
via FE80::C800:1AFF:FE74:8, FastEthernet0/0 //被添加的
S 2001:3::/64 [1/0] 靜態(tài)路由//
via FE80::C800:1AFF:FE74:8, FastEthernet0/0
S 2001:4::/64 [1/0]
via FE80::C800:1AFF:FE74:8, FastEthernet0/0
C 2001:10::/64 [0/0]
via FastEthernet0/0, directly connected
L 2001:10::2/128 [0/0]
via FastEthernet0/0, receive
L FF00::/8 [0/0]
via Null0, receive
R2#ping 2001:2::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:2::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/28/48 ms
R2#ping 2001:3::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:3::1, timeout is 2 seconds:
!.!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 24/36/48 ms
R2#ping 2001:4::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:4::1, timeout is 2 seconds:
!!!!!
接下來把剛剛配置的靜態(tài)路由條目刪掉(直接在命令前面加no,就OK了),下面做默認路由。
R2(config)#no ipv6 route 2001:2::/64 f0/0 FE80::C800:1AFF:FE74:8
R2(config)#no ipv6 route 2001:3::/64 f0/0 FE80::C800:1AFF:FE74:8
R2(config)#no ipv6 route 2001:4::/64 f0/0 FE80::C800:1AFF:FE74:8
再次查看路由表,這時路由表中應(yīng)該沒有靜態(tài)路由條目,測試連通性也是不行的。
R2#sho ipv route
IPv6 Routing Table - Default - 3 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
B - BGP, M - MIPv6, R - RIP, I1 - ISIS L1
I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
EX - EIGRP external
O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
C 2001:10::/64 [0/0]
via FastEthernet0/0, directly connected
L 2001:10::2/128 [0/0]
via FastEthernet0/0, receive
L FF00::/8 [0/0]
via Null0, receive
R2#ping 2001:2::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:2::1, timeout is 2 seconds:
% No valid route for destination
Success rate is 0 percent (0/1)
在R2上配置默認路由:
(查看路由表中,有沒有默認路由條目,如果有則測試連通性,一步到位,就OKl)
R2(config)#ipv6 route ::/0 f0/0 FE80::C800:1AFF:FE74:8
R2(config)#end
*Jun 9 09:26:01.619: %SYS-5-CONFIG_I: Configured from console by console
R2#sho ipv6 route
IPv6 Routing Table - Default - 4 entries
Codes: C - Connected, L - Local, S - Static, U - Per-user Static route
B - BGP, M - MIPv6, R - RIP, I1 - ISIS L1
I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary, D - EIGRP
EX - EIGRP external
O - OSPF Intra, OI - OSPF Inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
S ::/0 [1/0]
via FE80::C800:1AFF:FE74:8, FastEthernet0/0 //被添加的默認路由//
C 2001:10::/64 [0/0]
via FastEthernet0/0, directly connected
L 2001:10::2/128 [0/0]
via FastEthernet0/0, receive
L FF00::/8 [0/0]
via Null0, receive
R2#ping 2001:2::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:2::1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/29/44 ms
以上就是今天的實驗了;其實原則上還是跟IPv4基本相似,沒有太大的差別,就是命令上有所改動,
只要有IPv4的基礎(chǔ),理解IPv6就很容易了
好了,今天就到這里啦!
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
本文標題:基于【IPv6】靜態(tài)路由和默認路由的配置-創(chuàng)新互聯(lián)
文章地址:http://www.rwnh.cn/article44/hsiee.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導航、定制網(wǎng)站、動態(tài)網(wǎng)站、建站公司、商城網(wǎng)站、網(wǎng)站內(nèi)鏈
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)