思科設備實現運營商城域網架構ISIS+BGP+IPV6綜合實驗

使用GNS3 0.8.6版本模擬器c3725-adventerprisek9-mz.124-15.T5.image

實驗拓撲:

wKioL1SEapfQmvDLAAE3ly9ms54740.jpg

實驗要求:

1.   通過ISIS協議AS內部的直連和環回口路由宣告。

2.通過配置IBGP協議建立鄰居將所有的用戶業務路由(大客戶和PPOE撥號)宣告。

3.通過配置路由反射器實現市內、省內業務路由互傳

4.通過建立EBGP鄰居實現全省和國幹互聯網路由互傳

5.通過配置黑洞路由實現用戶業務網段聚合。

6.實現城域網網絡架構由ipv4ipv6平滑過渡。

實驗步驟及驗證:

1.接口及ip地址規劃:

路由器

接口

ip地址

R1

F0/0

12.0.0.1/30

R1

F0/1

16.0.0.1/30

R1

Loopback 0

1.1.1.1/32

R1

Loopback 10

192.168.1.1/30

R1

Loopback 20

192.168.2.1/32

R1

Loopback 30

192.168.2.3/32

R2

F0/0

12.0.0.2/30

R2

F2/0

23.0.0.1/30

R2

F0/1

25.0.0.1/30

R2

F1/0

26.0.0.1/30

R2

loopback 0

2.2.2.2/32

R3

F0/0

23.0.0.2/30

R3

F1/0

34.0.0.1/30

R3

F0/1

37.0.0.1/30

R3

loopback 0

3.3.3.3/32

R4

F0/0

34.0.0.2/30

R4

F0/1

48.0.0.1/30

R4

loopback 0

4.4.4.4/32

R4

loopback 10

192.168.4.1/30

R5

F0/0

25.0.0.2/30

R5

F0/1

56.0.0.1/30

R5

Loopback 0

5.5.5.5/32

R5

Loopback 10

192.168.3.1/30

R6

F0/1

56.0.0.2/30

R6

F0/0

16.0.0.2/30

R6

F1/0

26.0.0.2/30

R6

F2/0

67.0.0.1/30

R6

loopback 0

6.6.6.6/32

R7

F0/0

67.0.0.2/30

R7

F0/1

37.0.0.2/30

R7

F1/0

78.0.0.1/30

R7

loopback 0

7.7.7.7/32

R8

F0/0

78.0.0.2/30

R8

F0/1

48.0.0.2/30

R8

loopback 0

8.8.8.8/32

R8

loopback 10

192.168.5.1/30

2.配置腳本

R1

R1(config)#int f0/0

R1(config-if)#ip add 12.0.0.1255.255.255.252

R1(config-if)#no sh

R1(config)#int f0/1

R1(config-if)#ip add16.0.0.1 255.255.255.252

R1(config-if)#no sh

R1(config-if)#int lo 0

R1(config-if)#ip add1.1.1.1 255.255.255.255

R1(config-if)#int lo 10 //模擬下掛的30位掩碼靜態大客戶業務網段//

R1(config-if)#ip add192.168.1.1 255.255.255.252

R1(config-if)#int lo 20 //模擬下掛的32位掩碼PPOE用戶//

R1(config-if)#ip add192.168.2.1 255.255.255.255

R1(config-if)#int lo 30 //模擬下掛的32位掩碼PPOE用戶//

R1(config-if)#ip add192.168.2.3 255.255.255.255

R2

R2(config)#int f0/0

R2(config-if)#ip add 12.0.0.2 255.255.255.252

R2(config-if)#no sh

R2(config-if)#int f0/1

R2(config-if)#ip add 25.0.0.1 255.255.255.252

R2(config-if)#no sh

R2(config-if)#int f1/0

R2(config-if)#ip add 26.0.0.1 255.255.255.252

R2(config-if)#no sh

R2(config-if)#int f2/0

R2(config-if)#ip add 23.0.0.1 255.255.255.252

R2(config-if)#no sh

R2(config-if)#int lo 0

R2(config-if)#ip add 2.2.2.2 255.255.255.255

R3

R3(config)#int f0/0

R3(config-if)#ip add 23.0.0.2255.255.255.252

R3(config-if)#no sh

R3(config-if)#int f0/1

R3(config-if)#ip add 37.0.0.1255.255.255.252

R3(config-if)#no sh

R3(config-if)#int f1/0

R3(config-if)#ip add 34.0.0.1255.255.255.252

R3(config-if)#no sh

R3(config-if)#int lo 0

R3(config-if)#ip add 3.3.3.3255.255.255.255

R4

R4(config)#int f0/0

R4(config-if)#ip add 34.0.0.2255.255.255.252

R4(config-if)#no sh

R4(config-if)#int f0/1

R4(config-if)#ip add 48.0.0.1255.255.255.252

R4(config-if)#no sh

R4(config-if)#int lo 0

R4(config-if)#ip add 4.4.4.4255.255.255.255

R4(config-if)#intlo 10 //模擬下掛的30位掩碼靜態大客戶業務網段//

R4(config-if)#ip add 192.168.4.1255.255.255.252

R5

R5(config)#int f0/0

R5(config-if)#ip add 25.0.0.2255.255.255.252

R5(config-if)#no sh

R5(config-if)#int f0/1

R5(config-if)#ip add 56.0.0.1255.255.255.252

R5(config-if)#no sh

R5(config-if)#intlo 10 //模擬下掛的30位掩碼靜態大客戶業務網段//

R5(config-if)#ip add 192.168.3.1255.255.255.252

R5(config-if)#int lo 0

R5(config-if)#ip add 5.5.5.5255.255.255.255

R6

R6(config)#int f0/1

R6(config-if)#ip add 56.0.0.2255.255.255.252

R6(config-if)#no sh

R6(config-if)#int f0/0

R6(config-if)#ip add 16.0.0.2255.255.255.252

R6(config-if)#no sh

R6(config-if)#int f1/0

R6(config-if)#ip add 26.0.0.2255.255.255.252

R6(config-if)#no sh

R6(config-if)#int f2/0

R6(config-if)#ip add 67.0.0.1 255.255.255.252

R6(config-if)#no sh

R6(config-if)#int lo 0

R6(config-if)#ip add 6.6.6.6255.255.255.255

R7

R7(config)#int f0/0

R7(config-if)#ip add 67.0.0.2255.255.255.252

R7(config-if)#no sh

R7(config-if)#int f0/1

R7(config-if)#ip add 37.0.0.2255.255.255.252

R7(config-if)#no sh

R7(config-if)#int f1/0

R7(config-if)#ip add 78.0.0.1255.255.255.252

R7(config-if)#no sh

R7(config)#int lo 0

R7(config-if)#ip add 7.7.7.7255.255.255.255

R8

R8(config)#int f0/0

R8(config-if)#ip add 78.0.0.2255.255.255.252

R8(config-if)#no sh

R8(config-if)#int f0/1

R8(config-if)#ip add 48.0.0.2255.255.255.252

R8(config-if)#no sh

R8(config-if)#intlo 10 //模擬下掛的30位掩碼靜態大客戶業務網段//

R8(config-if)#ip add 192.168.5.1255.255.255.252

R8(config-if)#int lo 0

R8(config-if)#ip add 8.8.8.8255.255.255.255

---------------------------以上是ip地址配置----------------------------------

R1

R1(config)#router isis //開啓ISIS協議//

R1(config-router)#net 49.0001.0010.0100.1001.00 //通過環回口翻譯得出net地址//

R1(config-router)#is-type level-1 //指定R1爲L1型路由器//

R1(config)#int range f0/0 - 1 ,lo 0

R1(config-if-range)#ip router isis //在R1的互連接口和環回口下通告ISIS協議//

R2 //R2上ISIS配置同R1這裏就不再贅述了//

R2(config)#router isis  

R2(config-router)#net 49.0001.0020.0200.2002.00

R2(config-router)#is-type level-1-2 //指定R2爲L1-2路由器//

R2(config)#int range f0/0 - 1 ,f1/0 ,f2/0 ,lo 0

R2(config-if-range)#ip router isis

R3 //R3上ISIS配置同R1這裏就不再贅述了//

R3(config)#router isis

R3(config-router)#net 49.0002.0030.0300.3003.00

R3(config-router)#is-type level-2 //指定R3爲L2路由器//

R3(config)#int range f0/0 - 1 ,lo 0

R3(config-if-range)#ip router isis

R5 //R5上ISIS配置同R1這裏就不再贅述了//

R5(config)#router isis

R5(config-router)#net 49.0001.0050.0500.5005.00

R5(config-router)#is-type level-1 //指定R5爲L1路由器//

R5(config)#int range f0/0 - 1 ,lo 0

R5(config-if-range)#ip router isis

R6 //R6上ISIS配置同R1這裏就不再贅述了//

R6(config)#router isis

R6(config-router)#net 49.0001.0060.0600.6006.00

R6(config-router)#is-type level-1-2 //指定R6爲L1-2路由器//

 

 

R6(config)#int range f0/0 - 1 ,f1/0 ,f2/0 ,lo 0

R6(config-if-range)#ip router isis

R7 //R7上ISIS配置同R1這裏就不再贅述了//

R7(config)#router isis

R7(config-router)#net 49.0002.0070.0700.7007.00

R7(config-router)#is-type level-2 //指定R7爲L2路由器//

R7(config)#int range f0/0 - 1 ,lo 0

R7(config-if-range)#ip router isis

---------------------------以上是IS-IS路由配置----------------------------

實驗驗證:

wKiom1SEanODmCLEAALZWCjI4D4579.jpg

R7上查看路由表發現可以學到通告了ISIS的路由器的環回口地址,Ping 1.1.1.1可以通信,證明ISIS協議內部互連接口及環回口間可以通信。

------------------------以上是IS-IS  AS內部互通驗證---------------------------

R4

R4(config)#router ospf 110 //開啓OSPF協議進程號爲110//

R4(config-router)#router-id 4.4.4.4 //使用環回口地址作爲RID//

R4(config-router)#network 4.4.4.4 0.0.0.0 area 1

R4(config-router)#network 48.0.0.0 0.0.0.3 area 1 //通告互連接口及環回口//

R8 //R8上OSPF配置同R4這裏就不再贅述了//

R8(config)#router ospf 110

R8(config-router)#router-id 8.8.8.8

R8(config-router)#network 48.0.0.0 0.0.0.3 area 1

R8(config-router)#network 8.8.8.8 0.0.0.0 area 1

wKioL1SEa0jSMqUTAADlrGGfgk0161.jpg

R8ping R4的環回口(4.4.4.4)可以通信,證明OSPF內部互連接口及環回口間可以通信。

------------------------以上是OSPF  AS內部互通驗證---------------------------

注意:

在配置中,兩個AS間關口局設備的互連接口不需要通告到IGP中。

R1

R1(config)#router bgp 65001 //在R1上開啓BGP協議//

R1(config-router)#bgp router-id 1.1.1.1 //指定BGP的RID//

R1(config-router)#neighbor 2.2.2.2 remote-as 65001 //R1作爲BRAS/SR設備需要和所有市幹/省幹設備(本例中爲R2,6,3,7)建立IBGP鄰居關係以傳遞下掛業務網段路由,所以remote-as爲同一AS號//

R1(config-router)#neighbor 2.2.2.2 update-source lo 0 //使用自身的環回口(環回口更加穩定)和對放建立IBGP鄰居關係//

R1(config-router)#neighbor 6.6.6.6 remote-as 65001  

R1(config-router)#neighbor 6.6.6.6 update-source lo 0

R1(config-router)#neighbor 3.3.3.3 remote-as 65001  

R1(config-router)#neighbor 3.3.3.3 update-source lo 0

R1(config-router)#neighbor 7.7.7.7 remote-as 65001 

R1(config-router)#neighbor 7.7.7.7 update-source lo 0

注意:

BGP的鄰居關係需手工雙向建立(即兩相情願型),在建立鄰居的對端設備上也要手工指定鄰居。

R2//R2作爲市幹設備需要和所有BARS/SR設備建立鄰居關係以獲得業務網段路由,同時還需和直連路由器建立鄰居關係以提供路由的冗餘,R2建立IBGP鄰居關係配置同R1這裏就不再贅述了//

R2(config)#router bgp 65001    

R2(config-router)#bgp router-id 2.2.2.2

R2(config-router)#neighbor 1.1.1.1 remote-as 65001

R2(config-router)#neighbor 1.1.1.1 update-source lo 0

R2(config-router)#neighbor 5.5.5.5 remote-as 65001

R2(config-router)#neighbor 5.5.5.5 update-source lo 0

R2(config-router)#neighbor 6.6.6.6 remote-as 65001

R2(config-router)#neighbor 6.6.6.6 update-source lo 0

R2(config-router)#neighbor 3.3.3.3 remote-as 65001

R2(config-router)#neighbor 3.3.3.3 update-source lo 0

R3//R3作爲省幹設備需要和所有BARS/SR設備建立鄰居關係以獲得業務網段路由,同時還需和直連路由器建立鄰居關係以提供路由的冗餘,R3建立IBGP鄰居關係配置同R1這裏就不再贅述了//

R3(config)#router bgp 65001

R3(config-router)#bgp router-id 3.3.3.3

R3(config-router)#neighbor 1.1.1.1 remote-as 65001

R3(config-router)#neighbor 1.1.1.1 update-source lo 0

R3(config-router)#neighbor 5.5.5.5 remote-as 65001  

R3(config-router)#neighbor 5.5.5.5 update-source lo 0

R3(config-router)#neighbor 2.2.2.2 remote-as 65001  

R3(config-router)#neighbor 2.2.2.2 update-source lo 0

R3(config-router)#neighbor 7.7.7.7 remote-as 65001  

R3(config-router)#neighbor 7.7.7.7 update-source lo 0

R5 //R5作爲BRAS/SR設備需要和所有市幹/省幹設備(本例中爲R2,6,3,7)建立IBGP鄰居關係以傳遞下掛業務網段路由,R5配置同R1,在此就不再贅述了//

R5(config)#router bgp 65001

R5(config-router)#bgp router-id 5.5.5.5

R5(config-router)#neighbor 2.2.2.2 remote-as 65001

R5(config-router)#neighbor 2.2.2.2 update-source lo 0

R5(config-router)#neighbor 6.6.6.6 remote-as 65001  

R5(config-router)#neighbor 6.6.6.6 update-source lo 0

R5(config-router)#neighbor 3.3.3.3 remote-as 65001  

R5(config-router)#neighbor 3.3.3.3 update-source lo 0

R5(config-router)#neighbor 7.7.7.7 remote-as 65001  

R5(config-router)#neighbor 7.7.7.7 update-source lo 0

R6//R6作爲市幹設備需要和所有BARS/SR設備建立鄰居關係以獲得業務網段路由,同時還需和直連路由器建立鄰居關係以提供路由的冗餘,R6建立IBGP鄰居關係配置同R1這裏就不再贅述了//

R6(config)#router bgp 65001

R6(config-router)#bgp router-id 6.6.6.6

R6(config-router)#neighbor 1.1.1.1 remote-as 65001  

R6(config-router)#neighbor 1.1.1.1 update-source lo 0

R6(config-router)#neighbor 5.5.5.5 remote-as 65001

R6(config-router)#neighbor 5.5.5.5 update-source lo 0

R6(config-router)#neighbor 2.2.2.2 remote-as 65001

R6(config-router)#neighbor 2.2.2.2 update-source lo 0

R6(config-router)#neighbor 7.7.7.7 remote-as 65001

R6(config-router)#neighbor 7.7.7.7 update-source lo 0

R7//R7作爲省幹設備需要和所有BARS/SR設備建立鄰居關係以獲得業務網段路由,同時還需和直連路由器建立鄰居關係以提供路由的冗餘,R7建立IBGP鄰居關係配置同R1這裏就不再贅述了//

R7(config)#router bgp 65001

R7(config-router)#bgp router-id 7.7.7.7

R7(config-router)#neighbor 1.1.1.1 remote-as 65001  

R7(config-router)#neighbor 1.1.1.1 update-source lo 0

R7(config-router)#neighbor 5.5.5.5 remote-as 65001

R7(config-router)#neighbor 5.5.5.5 update-source lo 0

R7(config-router)#neighbor 6.6.6.6 remote-as 65001  

R7(config-router)#neighbor 6.6.6.6 update-source lo 0

R7(config-router)#neighbor 3.3.3.3 remote-as 65001  

R7(config-router)#neighbor 3.3.3.3 update-source lo 0

R1

R1(config)#ip route 192.168.2.0 255.255.255.0 null 0 //指定一條到PPOE用戶彙總網段的靜態路由下一跳爲null 0(黑洞路由,數據到這就會被丟棄)//

wKiom1SEavTzd4SuAAFykyH8OQs322.jpg

R1(config)#router bgp 65001 //在BGP下宣告路由//

R1(config-router)#network 192.168.1.0 mask 255.255.255.252

R1(config-router)#network 192.168.2.0 mask 255.255.255.0

注意:

通過建立BGP鄰居關係傳遞路由時,前提條件是路由器的路由表中一定要有該條路由條目,並且必須是匹配的(即網絡號和掩碼必須相同)。

R5

R5(config)#router bgp 65001 //在R5上把下掛的30位掩碼大客戶路由通過BGP宣告//

R5(config-router)#network 192.168.3.0 mask 255.255.255.252

注意:

因爲IBGP的水平分割原則,從一個IBGP鄰居收到的路由不會發給另一個IBGP鄰居,所以需要在市幹設備(R2,R6上)指定所有BARS/SR設備爲自己的路由反射器客戶端,使得每一臺BARS/SR設備上都所有業務網段的路由。

R2 //在R2上指定所有BARS/SR設備爲自己的路由反射器客戶端//

R2(config-router)#neighbor 1.1.1.1 route-reflector-client

R2(config-router)#neighbor 5.5.5.5 route-reflector-client

R2(config-router)# bgp cluster-id 123 //配置同一層設備相同的組ID使得客戶端設備認爲路由信息是同一設備傳給它的//

R6 //在R6上指定所有BARS/SR設備爲自己的路由反射器客戶端//

R6(config-router)#neighbor 1.1.1.1 route-reflector-client

R6(config-router)#neighbor 5.5.5.5 route-reflector-client

//配置同一層設備相同的組ID使得客戶端設備認爲路由信息是同一設備傳給它的//

wKioL1SEa8GSNi2MAAJJWk4y5N4007.jpg

在R1上查看路由表可以看到通過BGP學習到了同爲BARS/SR設備的R5下的業務路由,在R1上ping  192.168.3.1(R5的lo 10模擬下掛業務網段)可以通信,至此全省省內的路由可達,實現省內互通。

---------------------------以上通過IBGP實現省內互通--------------------------

R4 //在國幹設備R4上與同一BGP AS中的國幹設備R8建立IBGP鄰居關係產地業務路由,具體原理及配置上文有詳細介紹,這裏不再贅述//

R4(config)#router bgp 65002

R4(config-router)#bgp router-id 4.4.4.4

R4(config-router)#neighbor 8.8.8.8 remote-as 65002

R4(config-router)#neighbor 8.8.8.8 update-source lo 0

R8 //在國幹設備R8上與同一BGP AS中的國幹設備R4建立IBGP鄰居關係產地業務路由,具體原理及配置上文有詳細介紹,這裏不再贅述//

R8(config)#router bgp 65002

R8(config-router)#bgp router-id 8.8.8.8

R8(config-router)#neighbor 4.4.4.4 remote-as 65002

R8(config-router)#neighbor 4.4.4.4 update-source lo 0

注意:

需要在兩個BGP AS間配置EBGP鄰居來傳遞兩省間跨越互聯網(國幹)的通信,EBGP鄰居建立的條件是鄰居間可以通信,所以需要在兩個AS的關口局設備上互指靜態路由。

R3

R3(config)#ip route 4.4.4.4 255.255.255.255 34.0.0.2

R4

R4(config)#ip route 3.3.3.3 255.255.255.255 34.0.0.1

//在關口局設備R3,R4上互指靜態路由//

R7

R7(config)#ip route 8.8.8.8 255.255.255.255 78.0.0.2

R8

R8(config)#ip route 7.7.7.7 255.255.255.255 78.0.0.1

//在關口局設備R7,R8上互指靜態路由//

R3

R3(config)#router bgp 65001

R3(config-router)#neighbor 4.4.4.4 remote-as 65002 //和另一個BGP AS建立EBGP鄰居//

R3(config-router)#neighbor 4.4.4.4 update-source lo 0

R3(config-router)#neighbor 4.4.4.4 ebgp-multihop 2  //EBGP默認有跳數爲1的限制所以需要手動將跳數設置爲2//

R4

R4(config)#router bgp 65002

R4(config-router)#neighbor 3.3.3.3 remote-as 65001  //和另一個BGP AS建立EBGP鄰居//

R4(config-router)#neighbor 3.3.3.3 update-source lo 0

R4(config-router)#neighbor 3.3.3.3 ebgp-multihop 2   //EBGP默認有跳數爲1的限制所以需要手動將跳數設置爲2//

R7 //這裏R7配置同R3,就不再贅述//

R7(config)#router bgp 65001

R7(config-router)#neighbor 8.8.8.8 remote-as 65002

R7(config-router)#neighbor 8.8.8.8 update-source lo 0

R7(config-router)#neighbor 8.8.8.8 ebgp-multihop 2

R8 //這裏R8配置同R4,就不再贅述//

R8(config)#router bgp 65002                        

R8(config-router)#neighbor 7.7.7.7 remote-as 65001 

R8(config-router)#neighbor 7.7.7.7 update-source lo 0

R8(config-router)#neighbor 7.7.7.7 ebgp-multihop 2

wKiom1SEa37DaQxRAAFHfX2DY18088.jpg

在R1上查看BGP的路由表發現到達192.168.4.0/30子網的路由已經被優化放入路由表中,但在R1上ping R4的lo 10(192.168.4.1模擬業務網段)不通,繼續查看路由表可以找出原因。

wKiom1SEa8GwpfWEAAIokpXxnao108.jpg

這是因爲R1上有一條由ISIS的L1-2路由器下發給它的默認路由,所以R1會認爲到達192.168.4.0/30子網的下一跳4.4.4.4可達,所以就會優化將此 放入路由表,但是我們繼續看路由表可以發現並沒有到達4.4.4.4的明細路由,故雖然控制層面的路由有了,但數據層面仍然是不通的。

wKiom1SEbC_QwKOqAAIALd4Eetc347.jpg

查看R3路由表發現R3因爲配置了靜態路由,R3是知道如何到4.4.4.4的,而R3的環回口是通過IGP(ISIS)通告的,所以R1是知道如何到R3的,因此我們可以採用跳板,在R3上告訴所有的IBGP鄰居下一跳爲自己,在R7上也一樣,在市幹設備(R2,R6)上同樣要告訴所有BARS/SR設備下一跳爲自己,同時爲了路由冗餘,同層設備之間也要相互宣告。

R2

R2(config-router)#neighbor 1.1.1.1 next-hop-self

R2(config-router)#neighbor 5.5.5.5 next-hop-self

R2(config-router)#neighbor 6.6.6.6 next-hop-self

R6

R6(config-router)#neighbor 1.1.1.1 next-hop-self

R6(config-router)#neighbor 5.5.5.5 next-hop-self 

R6(config-router)#neighbor 2.2.2.2 next-hop-self

R3

R3(config-router)#neighbor 1.1.1.1 next-hop-self

R3(config-router)#neighbor 2.2.2.2 next-hop-self

R3(config-router)#neighbor 7.7.7.7 next-hop-self

R3(config-router)#neighbor 5.5.5.5 next-hop-self

R7

R7(config-router)#neighbor 1.1.1.1 next-hop-self

R7(config-router)#neighbor 5.5.5.5 next-hop-self

R7(config-router)#neighbor 6.6.6.6 next-hop-self

R7(config-router)#neighbor 3.3.3.3 next-hop-self

注意:

假設R3R4之間鏈路故障,則R3R4不可以建立EBGP鄰居關係,只有R4通過IBGP鄰居關係將業務路由傳遞給R8R8通過EBGP鄰居關係將路由傳給R7R7會通過IBGP鄰居關係傳路由給R3R6,R3R6因爲IBGP的水平分割原則將不會傳路由給R2有可能出現兩省間業務網段通信問題,所以需要將所有的市幹設備作爲省幹設備的路由反射器客戶端,打破水平分割從而傳路由。

R3

R3(config-router)#neighbor 2.2.2.2 route-reflector-client

R3(config-router)#bgp cluster-id 321  //配置同一層設備相同的組ID使得客戶端設備認爲路由信息是同一設備傳給它的//

R7

R7(config-router)#neighbor 6.6.6.6 route-reflector-client

R7(config-router)#bgp cluster-id 321 //配置同一層設備相同的組ID使得客戶端設備認爲路由信息是同一設備傳給它的//

wKioL1SEbQjRpIONAAJkWJtEMxE827.jpg

在R1上使用loopback 10作爲源(模擬的30位掩碼大客戶業務網段)Ping  R4的loopback 10(模擬的其他省業務網段),R8的loopback 10(模擬的其他省業務網段)可以通信,同時traceroute可以發現實現了路由的冗餘和負載,至此實現跨越互聯網的兩省通信,實驗完成。

——————————以上爲ipv4環境下配置—————————

ipv6技術的重要性:

由於全球互聯網的不斷髮展,ipv4地址短缺問題日益嚴重,雖然通過PAT等技術可以一定程度上延緩ipv4地址耗盡速度,但是並不能根本上解決ipv4地址短缺問題,所以未來ipv6將會是主流(ipv6地址總長度爲128位,可以從根本上解決ip地址短缺的問題)。

//因ipv6下原理及配置思路同ipv4,所以實驗只完成上面一排路由器的ipv6配置(R1,R2,R3,R4)//

1.接口及ipv6地址規劃:

路由器

接口

ipv6地址

R1

Loopback 10

110::1/64

R1

Loopback 0

111::1/128

R1

F0/0

12::1/64

R2

F0/0

12::2/64

R2

Loopback 0

222::2/128

R2

F2/0

23::1/64

R3

F0/0

23::2/64

R3

loopback 0

333::3/128

R3

F1/0

34::1/64

R4

F0/0

34::2/64

R4

loopback 0

444::4/128

R4

loopback 10

120::1/64

2.配置腳本及驗證:

R1

R1(config)#ipv6 unicast-routing //開啓ipv6單播路由//

R1(config)#int lo 10 //配置loopback 10模擬BRAS/SR下掛的業務網段//

R1(config-if)#ipv6 add 110::1/64

R1(config-if)#no sh

R1(config-if)#int lo 0

R1(config-if)#ipv6 add 111::1/128

R1(config-if)#no sh

R1(config-if)#int f0/0

R1(config-if)#ipv6 add 12::1/64

R1(config-if)#no sh

R2

R2(config)#ipv6 unicast-routing //開啓ipv6單播路由//

R2(config)#int f0/0

R2(config-if)#ipv6 add 12::2/64

R2(config-if)#no sh

R2(config-if)#int lo 0

R2(config-if)#ipv6 add 222::2/128

R2(config-if)#int f2/0

R2(config-if)#ipv6 add 23::1/64

R2(config-if)#no sh

R3

R3(config)#ipv6 unicast-routing //開啓ipv6單播路由//

R3(config)#int f0/0

R3(config-if)#ipv6 add 23::2/64

R3(config-if)#no sh

R3(config-if)#int lo 0

R3(config-if)#ipv6 add 333::3/128

R3(config-if)#int f1/0

R3(config-if)#ipv6 add 34::1/64 

R3(config-if)#no sh

R4

R4(config)#ipv6 unicast-routing  //開啓ipv6單播路由//

R4(config)#int f0/0

R4(config-if)#ipv6 add 34::2/64

R4(config-if)#no sh

R4(config-if)#int lo 0

R4(config-if)#ipv6 add 444::4/128

R4(config-if)#int lo 10 //配置loopback 10模擬另外一個省下掛的業務網段//

R4(config-if)#ipv6 add 120::1/64

————————以上爲接口ipv6地址配置——————————

R1

R1(config)#ipv6 router ospf 110 //開啓ospf v3//

R1(config)#int lo 0 //注意:ipv6下ospfv3要在接口下宣告網段//

R1(config-if)#ipv6 ospf 110 area 0

R1(config-if)#int f0/0

R1(config-if)#ipv6 ospf 110 area 0

R2 //R2上ospfv3配置同R1,就不再贅述//

R2(config)#ipv6 router ospf 110

R2(config)#int f0/0

R2(config-if)#ipv6 ospf 110 area 0  

R2(config-if)#int lo 0

R2(config-if)#ipv6 ospf 110 area 0  

R2(config)#int f2/0

R2(config-if)#ipv6 ospf 110 area 0

R3 //R3上ospfv3配置同R1,就不再贅述//

R3(config)#ipv6 router ospf 110

R3(config)#int f0/0

R3(config-if)#ipv6 ospf 110 area 0

R3(config-if)#int lo 0

R3(config-if)#ipv6 ospf 110 area 0

wKiom1SEbMOQRVkNAAECg5pAJlI400.jpg

在R1上查看ipv6的ospf 鄰居關係表,可以看到鄰居關係應經是full,在R1上Ping R3的loopback 0可以通信,證明AS內部可以通信。

————————以上爲ospf v3  AS內部配置—————————

R1

R1(config)#router bgp 65001 //在R1上開啓BGP協議//

R1(config-router)#address-family ipv6 unicast //指定爲ipv6的BGP//

R1(config-router-af)#neighbor 222::2 remote-as 65001 //R1需要和R2,R3建立ipv6的IBGP鄰居關係//

R1(config-router-af)#neighbor 222::2 update-source lo 0

R1(config-router-af)#neighbor 333::3 remote-as 65001  

R1(config-router-af)#neighbor 333::3 update-source lo 0

R1(config-router-af)#network 110::/64 //在R1上通過IBGP宣告下掛的業務網段//

R2 //R2上IBGP配置同R1,這裏不再贅述//

R2(config)#router bgp 65001

R2(config-router)#address-family ipv6 unicast

R2(config-router-af)#neighbor 111::1 remote-as 65001

R2(config-router-af)#neighbor 111::1 update-source lo 0

R2(config-router-af)#neighbor 333::3 remote-as 65001

R2(config-router-af)#neighbor 333::3 update-source lo 0

R3 //R3上IBGP配置同R1,這裏不再贅述//

R3(config)#router bgp 65001

R3(config-router)#address-family ipv6 unicast

R3(config-router-af)#neighbor 111::1 remote-as 65001

R3(config-router-af)#neighbor 111::1 update-source lo 0

R3(config-router-af)#neighbor 222::2 remote-as 65001  

R3(config-router-af)#neighbor 111::1 update-source lo 0

wKioL1SEbbDj-YcvAAJV_3x-xSY711.jpg

在R3上查看BGP鄰居關係表,可以看到R3與R1,R2的鄰居關係已經建立,再查看BGP表可以看到到達R1下掛業務網段路由已經優化,在ipv6路由表中可以看到通過IBGP鄰居學習到的路由,在R3上pingR1下掛的業務網段(loopback 10)可以通信,證明R1下掛的業務網段通過IBGP鄰居關係被ospf  AS內部的路由器學習到。

R3

R3(config)#ipv6 route 444::4/128 34::2

R4

R4(config)#ipv6 route 333::3/128 34::1 //建立BGP鄰居的條件是雙方可以通信,所以要在兩個AS間的關口局設備上互指靜態路由//

wKiom1SEbWnhVQk9AADNsfJDg80029.jpg

在R4上可以ping通R3的環回口,證明兩者間可以通信。

R3

R3(config)#router bgp 65001

R3(config-router)#address-family ipv6 unicast

R3(config-router-af)#neighbor 444::4 remote-as 65002   //R3與R4間建立EBGP鄰居關係//

R3(config-router-af)#neighbor 444::4 update-source lo 0

R3(config-router-af)#neighbor 444::4 ebgp-multihop 2 //EBGP鄰居關係默認跳數限制爲1,需要手動指定爲2//

R4 //R4上EBGP配置同R3,這裏不再贅述//

R4(config)#router bgp 65002

R4(config-router)#address-family ipv6 unicast

R4(config-router-af)#neighbor 333::3 remote-as 65001

R4(config-router-af)#neighbor 333::3 update-source lo 0

R4(config-router-af)#neighbor 333::3 ebgp-multihop 2

R4(config-router-af)#network 120::/64 //把R4下掛業務網段通過EBGP宣告出去//

wKioL1SEblWSYejFAAITHvGeEmo481.jpg

在R3上查看鄰居表可以看到R3與R4的EBGP鄰居關係已經建立,在路由表中可以看到到達R4下業務網段的路由,證明通過EBGP鄰居傳遞路由成功。

R2 //在R2上需告訴R1爲自己的路由反射器客戶端,並且指明下一跳爲自己//

R2(config-router-af)#neighbor 111::1 next-hop-self

R2(config-router-af)#neighbor 111::1 route-reflector-client

R3 //在R3上需告訴R2爲自己的路由反射器客戶端,並且向R1,R2指明下一跳爲自己//

R3(config-router-af)#neighbor 111::1 next-hop-self

R3(config-router-af)#neighbor 222::2 next-hop-self

R3(config-router-af)#neighbor 222::2 route-reflector-client

wKioL1SEbpahinLoAADbxECM8F8434.jpg

在R1上以loopback 10作爲源pingR4下掛的業務網段(loopback 10)可以通信,證明兩省下掛業務網段跨越互聯網可以通信,實驗完成。

實驗總結

1.ISIS協議因爲其收斂快速,易於擴展,通常在運營商的架構中用來作爲IGP運行設備互聯接口和環回口間的通信。 

2.BGP協議作爲目前唯一的EGP主要用來傳遞業務路由到AS內部以及在AS間傳遞業務路由。

3.目前城域網網絡架構已經具備從ipv4ipv6平滑過渡的能力,可以說ipv6時代真的要來了。



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章