S1和S2是汇聚交换机,用的57,

S3和S4是接入交换机,用的37.

华为的以太信道是 Eth-Trunk   、12是server1和server2

mode manual load-balance     可以不用敲 因为默认以太信道的模式就是手工负载分担方式 load-balance src-ast-mac     思科是在以太信道外部敲 华为是在以太信道内部敲load-balance src-ast-mac     思科是在以太信道外部敲 华为是在以太信道内部敲

首先先看接口的配置,物理接口的配置一定是空的 ,一个接口一旦有配置 就做不了其他配置的修改

<S1>display current-configuration interface GigabitEthernet 0/0/23<S1>display current-configuration interface GigabitEthernet 0/0/24<S1>display current-configuration          ##查看有没有做以太信道的配置

1,Layer-2

1.1链路聚合

S1和S2之间配置链路聚合,使用手动负载分担,基于源目MAC地址负载分担

解法:分别在S1,S2上配置Eth-Trunk

[S1]interface Eth-Trunk 12
[S1-Eth-Trunk12]mode manual load-balance
[S1-Eth-Trunk12]load-balance src-dst-mac
[S1-Eth-Trunk12]trunkport GigabitEthernet 0/0/23 0/0/24     ###默认是源目IP 要改成源目MAC

第二种方式进行捆绑

[S2]interface Eth-Trunk 12
[S2-Eth-Trunk12]mode manual load-balance
[S2-Eth-Trunk12]load-balance src-dst-mac
[S2]int g0/0/23
[S2-GigabitEthernet0/0/23]eth-trunk 12
[S2]int g0/0/24
[S2-GigabitEthernet0/0/23]eth-trunk 12
[S1]display eth-trunk 12             ##查看接口23 24 状态为UP
[S2]display eth-trunk 12             ##查看接口23 24 状态为UP

1.2 Link-type

1.S1,S2,S3,S4互连接口的链路类型为Trunk,允许除VLAN 1 外的所有VLAN 通过。

​ 解法:在S1 S2 S3 S4上分别创建vlan10,vlan 20 ,配置交换机之间的链路为Trunk,并放行除VLAN1之外的VLAN通过

批量创建VLAN方式      vlan   batch

[S1]vlan batch 10 20
[S1-GigabitEthernet0/0/1]port link-type trunk                ##接口做中继
[S1-GigabitEthernet0/0/1]port trunk allow-pass vlan all      ##放行所有vlan
[S1-GigabitEthernet0/0/1]undo port trunk allow-pass vlan 1   ## 去掉vlan 1
[S1-GigabitEthernet0/0/1]display this[S1-GigabitEthernet0/0/12]操作如上[S1]interface Eth-Trunk 12
[S1-Eth-Trunk12]port trunk allow-pass vlan all
[S1-Eth-Trunk12]undo port trunk allow-pass vlan 1

做完之后 通过 display port vlan 查看接口是否变成中继

2. CE1,CW2的VRRP虚拟IP地址

CE1和CE2

[CE1]display ip int b                                  ##先查看接口 [CE1]int g0/0/2.10
[CE1-GigabitEthernet0/0/2.10]dot1q termination vid 10  ##接口绑定vlan 10
[CE1-GigabitEthernet0/0/2.10]arp broadcast enable      ## 默认不支持收发广播的ARP报文,所以这个接口通不了,这条命令是让这个接口通
##先敲这两条命令让路由能通,然后接下来再做这个VRRP[CE1-GigabitEthernet0/0/2.10]vrrp vrid 1 virtual-ip 10.3.1.254
[CE1-GigabitEthernet0/0/2.10]vrrp vrid 1 priority 105  ##修改优先级
[CE1-GigabitEthernet0/0/2.10]vrrp vrid 1 preempt-mode timer delay 60 ##延迟修改为60秒
[CE1-GigabitEthernet0/0/2.10]dis th[CE1]int g0/0/2.20
[CE1-GigabitEthernet0/0/2.20]dot1q termination vid 20  ##接口绑定vlan 20
[CE1-GigabitEthernet0/0/2.20]arp broadcast enable      ## 默认不支持收发广播的ARP报文,所以这个接口通不了,这条命令是让这个接口通[CE1-GigabitEthernet0/0/2.20]vrrp vrid 2 virtual-ip 10.3.2.254
##由于这个接口啥都不是,不用敲其他命令,优先级也不用管 preempt-mode timer delay 也不用管
[CE2]int g0/0/2.10
[CE2-GigabitEthernet0/0/2.10]dot1q termination vid 10
[CE2-GigabitEthernet0/0/2.10]arp broadcast enable
[CE2-GigabitEthernet0/0/2.10]vrrp vrid 1 virtual-ip 10.3.1.254[CE2]int g0/0/2.20
[CE2-GigabitEthernet0/0/2.20]dot1q termination vid 10
[CE2-GigabitEthernet0/0/2.20]arp broadcast enable
[CE2-GigabitEthernet0/0/2.20]vrrp vrid 2 virtual-ip 10.3.2.254
[CE2-GigabitEthernet0/0/2.20]vrrp vrid 2 priority 105      ##优先级需要修改一下
[CE2-GigabitEthernet0/0/2.20]vrrp vrid 2 preempt-mode timer delay 60

CE1上看一下效果

[CE1]dis vrrp 1
[CE1]dis vrrp 2

S1和S2连接CE1和CE2的单臂路由没有起中继 ,没有做中继意味着单臂路由子接口是不通的

[S1]int g0/0/2
[S1-GigabitEthernet0/0/2]port link-type trunk
[S1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[S1-GigabitEthernet0/0/2]undo port trunk allow-pass vlan 1
[S2]int g0/0/2
[S2-GigabitEthernet0/0/2]port link-type trunk
[S2-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[S2-GigabitEthernet0/0/2]undo port trunk allow-pass vlan 1

测试一下

[CE1]ping 10.3.1.2
[CE1]ping 10.3.2.2
[CE1]dis vrrp 1  ##我是Master
[CE1]dis vrrp 2  ##我是Backup

1.3 MSTP 生成树

边缘端口特性  stp edged-port default  默认所有不能使用BPDU的接口都启用边缘端口特性

最优做法就是在所有交换机上启用边缘端口 在交换机互连接口把边缘端口给关了 因为接口级别优于全局

[S1]int g0/0/1
[S1-GigabitEthernet0/0/1]stp edged-port disable
[S1]int g0/0/12
[S1-GigabitEthernet0/0/12]stp edged-port disable
[S1]int eth-trunk 12
[S1-Eth-Trunk12]stp edged-port disable
[S2]int g0/0/1
[S2-GigabitEthernet0/0/1]stp edged-port disable
[S2]int g0/0/12
[S2-GigabitEthernet0/0/12]stp edged-port disable
[S2]int eth-trunk 12
[S2-Eth-Trunk12]stp edged-port disable

连接路由器的不要敲

[S3]int g0/0/1
[S3-GigabitEthernet0/0/1]stp edged-port disable
[S3]int g0/0/2
[S3-GigabitEthernet0/0/2]stp edged-port disable
[S4]int g0/0/1
[S4-GigabitEthernet0/0/1]stp edged-port disable
[S4]int g0/0/2
[S4-GigabitEthernet0/0/2]stp edged-port disable
[S1]stp ebged-port default[S2]stp ebged-port default[S3]stp ebged-port default[S4]stp ebged-port default

生成树

[S1]stp mode mstp                                 ##STP 模式 mstp --默认是mstp 可以不用敲
[S1]stp region-configuration                      ##STP域配置
[S1-mst-region]region-name HUAWEI                 ##设置域名 HUAWEI
[S1-mst-region]revision-level 12                  ##修正级别 12
[S1-mst-region]instance 10 vlan 10                ##创建实例10 绑定vlan10
[S1-mst-region]instance 20 vlan 20                ##创建实例20 绑定vlan20
[S1-mst-region]active region-configuration        ##激活域配置(必须做的)
[S1-mst-region]dis this
主根
[S1]stp instance 10 root primary                  ##进程10你做主 我做备
[S1]stp instance 20 root secondary                ##进程20你做主 我做备
[S2]stp mode mstp                                 ##STP 模式 mstp --默认是mstp 可以不用敲
[S2]stp region-configuration                      ##STP域配置
[S2-mst-region]region-name HUAWEI                 ##设置域名 HUAWEI
[S2-mst-region]revision-level 12                  ##修正级别 12
[S2-mst-region]instance 10 vlan 10                ##创建实例10 绑定vlan10
[S2-mst-region]instance 20 vlan 20                ##创建实例20 绑定vlan20
[S2-mst-region]active region-configuration        ##激活域配置(必须做的)
[S2-mst-region]dis this
主根
[S2]stp instance 10 root primary                  ##进程10你做主 我做备 (优先级改成0)
[S2]stp instance 20 root secondary                ##进程20你做主 我做备 (设置成备用根桥)
[S3]stp mode mstp
[S3]stp region-configuration
[S3-mst-region]region-name HUAWEI
[S3-mst-region]revision-level 12
[S3-mst-region]instance 10 vlan 10              ##进程10 vlan 10
[S3-mst-region]instance 20 vlan 20              ##进程20 vlan 20
[S3-mst-region]active region-configuration      ##激活(必须做的)
[S3-mst-region]dis this   
[S4]stp mode mstp
[S4]stp region-configuration
[S4-mst-region]region-name HUAWEI
[S4-mst-region]revision-level 12
[S4-mst-region]instance 10 vlan 10             ##进程10 vlan 10
[S4-mst-region]instance 20 vlan 20             ##进程20 vlan 20
[S4-mst-region]active region-configuration     ##激活(必须做的)
[S4-mst-region]dis this   
[S1]dis stp instance 10    ##查看进程10 为主根

1.4 WAN 广域网

hdlc的捆绑

在PE1上配置IP-Trunk,并配置IPv4和IPv6

[PE1]int serial 0/0/0
[PE1-serial0/0/0]link-protocol hdlc[PE1]int serial 0/0/1
[PE1-serial0/0/1]link-protocol hdlc[PE1]interface ip-trunk 1
[PE1-IP-Trunk1]trunkport Serial 0/0/0 0/0/1   ##绑定
[PE1-IP-Trunk1]ip add 10.1.13.1 30
[PE1-IP-Trunk1]ipv6 enable
[PE1-IP-Trunk1]ipv6 add 2000:EAD8:99EF:CC3E:B2AD:9EFF:32DD:1300 127
[RR1]int serial 0/0/0
[RR1-serial0/0/0]link-protocol hdlc[RR1]int serial 0/0/1
[RR1-serial0/0/1]link-protocol hdlc
华为默认serial接口使用的是PPP PPP没法去捆绑 只有HDLC的接口才能去捆绑[RR1]interface ip-trunk 1
[RR1-IP-Trunk1]trunkport Serial 0/0/0 0/0/1   ##绑定
[RR1-IP-Trunk1]ip add 10.1.13.2 30
[RR1-IP-Trunk1]ipv6 enable
[RR1-IP-Trunk1]ipv6 add 2000:EAD8:99EF:CC3E:B2AD:9EFF:32DD:1301 127

在PE1上ping 10.1.13.2 只要能ping通 就ok了

2.下面是通过PE3到CE3 解法:在PE3上配置MP-Group 接口 并配置IPv4地址

[PE3]interface MP-group 0/0/1
[PE3-MP-group0/0/1]ip add 10.2.33.2 30
[PE3]display ip int brief    ##查看pos接口 pos4/0/0 和 pos6/0/0[PE3]interface Pos 4/0/0
[PE3-Pos4/0/0]ppp mp Mp-group 0/0/1[PE3]interface Pos 6/0/0
[PE3-Pos6/0/0]ppp mp Mp-group 0/0/1
[CE3]interface MP-group 0/0/1
[CE3-MP-group0/0/1]ip add 10.2.33.1 30[CE3]interface Pos 4/0/0
[CE3-Pos4/0/0]ppp mp Mp-group 0/0/1[CE3]interface Pos 6/0/0
[CE3-Pos6/0/0]ppp mp Mp-group 0/0/1

ping以下 ping 10.2.33.2 能通就没问题

第二大项的需求

OSPF

需求1已结做好预配,需要我们宣告的只有子接口 ,在宣告之前把它们置为被动接口,避免它们发送hello

先看一下配置

[CE1]display current-configuration section ospf  ## ospf 在配置的时候没有指定路由器 ID    建议自己给指定以下路由器ID根据环回口来配置路由器ID
[CE1]dis ip int brief[CE1]ospf 1 router-id 172.17.1.1  ##注意,如果你的路由器ID就是这个,系统不会有提示,如果路由器ID不是这个,需要重置一下OSPF进程才能生效[CE1-ospf-1]silent-interface GigabitEthernet 0/0/2.10 ##被动接口
[CE1-ospf-1]silent-interface GigabitEthernet 0/0/2.20 ##被动接口
[CE1-ospf-1]area 0
[CE1-ospf-1-area-0.0.0.0]network 10.3.1.1 0.0.0.0
[CE1-ospf-1-area-0.0.0.0]network 10.3.2.1 0.0.0.0
[CE2]ospf 1 router-id 172.17.1.2  ##注意,如果你的路由器ID就是这个,系统不会有提示,如果路由器ID不是这个,需要重置一下OSPF进程才能生效[CE2-ospf-1]silent-interface GigabitEthernet 0/0/2.10 ##被动接口
[CE2-ospf-1]silent-interface GigabitEthernet 0/0/2.20 ##被动接口
[CE2-ospf-1]area 0
[CE2-ospf-1-area-0.0.0.0]network 10.3.1.2 0.0.0.0
[CE2-ospf-1-area-0.0.0.0]network 10.3.2.2 0.0.0.0

检测一下邻居

[CE2]dis ospf peer brief   ##跟CE1建立Full的邻居

接下来做PE3和PE4 的OSPF链路类型为P2P (PE3和PE4是运营商)

[PE3]int g0/0/0
[PE3-GigabitEthernet0/0/0]ospf network-type p2p[PE4]int g0/0/0
[PE4-GigabitEthernet0/0/0]ospf network-type p2p

测试一下

[PE4]display ospf peer brief    ##收到邻居就OK了

接下来做前缀列表

[PE4]ip ip-prefix Loopback index 10 permit 172.16.1.2 32 greater-equal 32 less-equal 32   ##官方给出的文档,这样写更精确
[PE4]route-policy Loopback permit node 10
[PE4-route-policy]if-match ip-prefix Loopback

查看ospf 进程

[PE4]display current-configuration section ospf
[PE4]ospf 1 router-id 172.16.1.2
[PE4-ospf-1]import-route direct route-policy Loopback type 1   ##以oe1 的形式重分发进入

ISIS

解法:分别在PE1和RR1之间的逻辑接口启用ISIS协议,并设置链路开销

interface IP-Trunk1

isis enable 1

isis cost 1500

[PE1]interface IP-Trunk1
[PE1-IP-Trunk1]isis enable 1
[PE1-IP-Trunk1]isis cost 1500[RR1]interface IP-Trunk1
[RR1-IP-Trunk1]isis enable 1
[RR1-IP-Trunk1]isis cost 1500

第二问:RR2-P2的ISIS链路类型为P2P

[P2]int g0/0/0
[P2-g0/0/0]isis circuit-type p2p[RR2]int g0/0/0
[RR2-g0/0/0]isis circuit-type p2p

RR1和P1上需要做路由泄露

[RR1]ip ip-prefix Loopbacks index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32
[RR1]isis 1
[RR1-isis-1]import-route isis level-2 into level-1 filter-policy ip-prefix Loopbacks[P1]ip ip-prefix Loopbacks index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32
[P1]isis 1
[P1-isis-1]import-route isis level-2 into level-1 filter-policy ip-prefix Loopbacks

查看一下路由

[PE1]display ip routing-table protocol isis

第三问:双点双向重分发

“被引入的协议的cost要继承到引入后的协议中”这句话的意思是,你路由原本是ospf里的度量值是多少重分发到isis里面之后度量值不变  路由原本是isis里的度量值是多少 重分发进ospf里面之后度量值不变,这种我们称为度量值继承

RR2在做OSPF到ISIS重分发的 deny tag 400 permit 其他打上标记100

RR在做ISIS到OSPF重分发 的 deny tag 300 permit 其他打上标记200

P2在做OSPF 到ISIS 重分发的deny tag 200 permit 其他打上标记200

P2在做ISIS到OSPF重分发 的 deny tag 100 permit 其他打上标记400

先做一个前缀列表

[RR2]ip ip-prefix Loopbacks index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32   ##前缀列表
[RR2]route-policy O-2-I deny node 10  ##重分发
[RR2-route-policy]if-match tag 400    ##[RR2]route-policy O-2-I permit node 20
[RR2-route-policy]apply tag 100      ##设置一个tag 100[RR2]route-policy I-2-O deny node 10  ##重分发
[RR2-route-policy]if-match tag 300  [RR2]route-policy I-2-O permit node 20
[RR2-route-policy]apply tag 200      ##设置一个tag 200[RR2]route-policy ASE permit node 10
[RR2-route-policy]if-match tag 400   ##对方重分发进来tag400的路由
[RR2-route-policy]apply preference 150   
[P2]ip ip-prefix Loopbacks index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32   ##前缀列表
[P2]route-policy O-2-I deny node 10  ##重分发
[P2-route-policy]if-match tag 200   [P2]route-policy O-2-I permit node 20
[P2-route-policy]apply tag 300 [P2]route-policy I-2-O deny node 10
[P2-route-policy]if-match tag 100  [P2]route-policy I-2-O permit node 20
[P2-route-policy]apply tag 400      ##设置一个tag 400[P2]route-policy ASE permit node 10
[P2-route-policy]if-match tag 200   ##对方重分发进来tag400的路由
[P2-route-policy]apply preference 150   

在ospf里先做路由环路防止

[RR2]ospf 1
[RR2-ospf-1]preference ase route-policy ASE 14  ##防止路由环路把内部优先级改为14[P2]ospf 1
[P2-ospf-1]preference ase route-policy ASE 14  ##防止路由环路把内部优先级改为14

查看一下

[P2]dis ip routing-table protocol ospf
[RR2]dis ip routing-table protocol ospf172.16.1.2/32 O_ASE 要保证这条路由改成14

改成14之后我们开始重分发

[RR2]route-policy O-2-I deny node 20
[RR2-route-policy]if-match ip-prefix Loopbacks
[RR2]route-policy I-2-O deny node 20
[RR2-route-policy]if-match ip-prefix Loopbacks[RR2]ospf 1
[RR2-ospf-1]default cost inherit-metric     ##引入进来的路由开销保持不变
[RR2-ospf-1]import-route isis 1 route-policy I-2-O
[RR2]isis 1
[RR2-isis-1]import-route ospf 1 inherit-cost route-policy O-2-I
[P2]route-policy I-2-O deny node 20
[P2-route-policy]if-match ip-prefix Loopbacks
[P2]route-policy O-2-I deny node 20
[P2-route-policy]if-match ip-prefix Loopbacks[P2]ospf 1
[P2-ospf-1]default cost inherit-metric       ##引入进来的路由开销保持不变
[P2-ospf-1]import-route isis 1 route-policy I-2-O
[P2]isis 1
[P2-isis-1]import-route ospf 1 inherit-cost route-policy O-2-I

看一下结果

首先在ASBR 3上 只能收到PE3和PE4环回口路由 不会收到其他路由

[ASBR3]dis ip routing-table protocol isis  ##可以收到 9 10 11 2 的路由 

接下来查看RR2和P2

[P2]dis ip routing-table protocol   ##172.16.1.2/32 依旧是ospf路由
[RR2]dis ip routing-table protocol  ##172.16.1.2/32 依旧是ospf路由

4.P1的ISIS进程 :产生LSP的最大延迟时间是1s,初始延迟为50ms,递增时间为50ms

在P1上配置LSP的优化

[P1]isis 1
[P1-isis-1]time lsp-generation 1 50 50
[P1-isis-1]timer spf 1 100 100
[P1-isis-1]flash-flood

第3大项.MPLS VPN

1.CE1、CE2为VPN1的Hub-CE,PE1、PE2为Hub-PE;CE3、CE4为VPN1的Spoke站点;PE3、PE4为Spoke-PE。

2.CE4为Multi-VPN-instance CE,CE4的VPN实例VPN1,通过GE0/0/1连接PE4。

解法:在CE4上创建VPN实例VPN1,其中RD为100:14,将所有直连接口都绑定到实例中

[CE4]ip vpn-instance VPN1
[CE4-vpn-instance-vpn1]route-distinguisher 100:14  ##路由区分符 100:14 [CE4]int g0/0/1    ##是连接PE的接口
[CE4-GigabitEthernet0/0/1]ip binding vpn-instance VPN1
[CE4-GigabitEthernet0/0/1]ip add 10.2.41.1 255.255.255.252
[CE4-GigabitEthernet0/0/1]display this[CE4]int loopback 0
[CE4-Loopbcak0]display this
[CE4-Loopback0]ip bindinng vpn-instance VPN1
[CE4-Loopback0]ip add 172.16.1.4 255.255.255.255[CE4]int loopback 1
[CE4-Loopbcak1]display this
[CE4-Loopback1]ip bindinng vpn-instance VPN1
[CE4-Loopback1]ip add 10.3.3.4 255.255.255.255

3.合理设置VPN1参数,使得Spoke站点互访的流量必须经过Hub-CE设备。当CE1—PE1链路断开的情况下,PE1仍然可以学习到CE1的业务路由。(PE3上VPN1的RD为100:13,Export RT为100:1,Import RT为200:1)。(2分)

<PE1>display ip vpn-instance   ##目前看什么都没有
[PE1]ip vpn-instance VPN1_IN
[PE1-vpn-instance-VPN1_IN]route-distinguisher 100:10   ##路由区分符 RD 100:14
[PE1-vpn-instance-VPN1_IN-af-ipv4]vpn-target 100:1 import-extcommunity   ##我们要接受路由
[PE1-vpn-instance-VPN1_IN-af-ipv4]vpn-target 400:1 import-extcommunity   ##PE2导出的[PE1]ip vpn-instance VPN1_OUT
[PE1-vpn-instance-VPN1_OUT]route-distinguisher 100:12
[PE1-vpn-instance-VPN1_OUT-af-ipv4]vpn-target 200:1 export-extcommunity
[PE1-vpn-instance-VPN1_OUT-af-ipv4]vpn-target 300:1 import-extcommunity   [PE1]display ip interface brief ##查看子接口 .1 和.2[PE1]interface GigabitEthernet0/0/1.1
[PE1-GigabitEthernet0/0/1.1]ip binding vpn-instance VPN1_IN
[PE1-GigabitEthernet0/0/1.1]ip add 10.2.11.2 30  ##地址重新贴一下
[PE1-GigabitEthernet0/0/1.1]arp broadcast enable[PE1]interface GigabitEthernet0/0/1.2
[PE1-GigabitEthernet0/0/1.2]arp broadcast enable
[PE1-GigabitEthernet0/0/1.2]ip binding vpn-instance VPN1_OUT
[PE1-GigabitEthernet0/0/1.2]ip add 10.2.11.6 30

PE1和CE1之间是建立BGP邻居的,做之前先保证CE1连接PE1的接口,它也是子接口的arp broadcast enable是开启的

[CE1]int g0/0/1.1
[CE1-GigabitEthernet0/0/1.1]dis this
[V200R003C00]
#
interface GigabitEtnerent0/0/1.1dot1q termination vid 10ip address 10.2.11.1 255.255.255.252
#
return
[CE1-GigabitEthernet0/0/1.1]arp broadcast enable
[CE1]int g0/0/1.2
[CE1-GigabitEthernet0/0/1.2]arp broadcast enable

先在CE上做BGP

[CE1]bgp 65000
[CE1-bgp]router-id 172.16.1.1  ##设置路由器ID
[CE1-bgp]peer 10.2.11.2 as-number 100  ##正常建立邻居
[CE1-bgp]peer 10.2.11.6 as-number 100  ##正常建立邻居[CE1]route-policy O-2-B deny node 10
[CE1-route-policy]if-match tag 200[CE1]route-policy O-2-B permit node 20[CE1]bgp 65000
[CE1-bgp]import-route ospf 1 med 0 route-policy O-2-B

保证arp broadcast enable是开启的

[CE2]int g0/0/1.1
[CE2-GigabitEthernet0/0/1.1]arp broadcast enable
[CE2]int g0/0/1.2
[CE2-GigabitEthernet0/0/1.2]arp broadcast enable[CE2]bgp 65000
[CE2-bgp]router-id 172.16.1.2  ##设置路由器ID
[CE2-bgp]peer 10.2.22.2 as-number 100  ##正常建立邻居
[CE2-bgp]peer 10.2.22.6 as-number 100  ##正常建立邻居[CE2]route-policy O-2-B deny node 10
[CE2-route-policy]if-match tag 100    ##过滤tag 100[CE2]route-policy O-2-B permit node 20[CE2]bgp 65000
[CE2-bgp]import-route ospf 1 med 0 route-policy O-2-B

在PE上做配置

[PE1]bgp 100
[PE1-bgp]router-id 172.16.1.1  ##设置路由器ID
[PE1-bgp]ipv4-family vpn-innstance VPN1_IN            ##和CE建立邻居
[PE1-bgp-VPN1_IN]peer 10.2.11.1 as-number 65000[PE1-bgp]ipv4-family vpn-innstance VPN1_OUT
[PE1-bgp-VPN1_OUT]peer 10.2.11.5 as-number 65000

查看邻居

[PE1]display bgp vpnv4 vpn-instance VPN1_IN peer  ##10.2.11.1[PE1]display bgp vpnv4 vpn-instance VPN1_OUT peer  ##10.2.11.5
[PE2]ip vpn-instance VPN_IN
[PE2-vpn-instance-VPN_IN]route-distinguisher 100:11
[PE2-vpn-instance-VPN_IN-af-ipv4]vpn-target 100:1 import-extcommuunity  ##导入
[PE2-vpn-instance-VPN_IN-af-ipv4]vpn-target 400:1 export-extcommuunity  ##导出[PE2]ip vpn-instance VPN_OUT
[PE2-vpn-instance-VPN_OUT]route-distinguisher 100:15
[PE2-vpn-instance-VPN_OUT-af-ipv4]vpn-target 200:1 export-extcommuunity  ##导出
[PE2-vpn-instance-VPN_OUT-af-ipv4]vpn-target 300:1 export-extcommuunity  ##导出[PE2]display ip int b      ##查看接口[PE2]interface GigabitEthernet0/0/1.1
[PE2-GigabitEthernet0/0/1.1]ip binding vpn-instance VPN_IN
[PE2-GigabitEthernet0/0/1.1]ip add 10.2.22.2 30
[PE2-GigabitEthernet0/0/1.1]arp broadcast enable[PE2]interface GigabitEthernet0/0/1.2
[PE2-GigabitEthernet0/0/1.2]ip binding vpn-instance VPN_OUT
[PE2-GigabitEthernet0/0/1.2]ip add 10.2.22.6 30
[PE2-GigabitEthernet0/0/1.2]arp broadcast enable

PE2直接和CE2建立BGP邻居

[PE2]bgp 100
[PE2-bgp]router-id 172.16.1.20
[PE2-bgp]ipv4-family vpn-innnstance VPN1_IN
[PE2-bgp-VPN1_IN]peer 10.2.22.1 as-number 65000
[PE2-bgp-VPN1_IN]display ip int b[PE2-bgp]ipv4-family vpn-innnstance VPN1_OUT
[PE2-bgp-VPN1_OUT]peer 10.2.22.5 as-number 65000

查看邻居

[PE2]display bgp vpnv4 vpnn-instance VPN1_IN peer ##收到5条路由[PE2]display bgp vpnv4 vpnn-instance VPN1_OUT peer ##收到5条路由[PE2-bgp]ping -vpn -instance VPN

4.如图4,CE1通过GE0/0/1.1和GE0/0/1.2建立直连EBGP邻居,接入PE1。CE1通过GE0/0/0.2,向PE1通告的BGP update中,某些路由的AS-Path中有200。在CE1上将OSPF路由导入BGP。(2分)

5.CE2通过GE0/0/1.1和GE0/0/1.2建立直连EBGP邻居,接入PE2。CE2通过GE0/0/0.2,向PE2通告的BGP update中,某些路由的AS-Path中有200。在CE2上,将OSPF路由导入BGP。(2分)

[PE1]bgp 100
[PE1-bgp]ipv4-family vpn-innnstance VPN1_OUT
[PE1-bgp-VPN1_OUT]peer 10.1.11.5 allow-as-loop[PE2]bgp 100
[PE2-bgp]ipv4-family vpn-innnstance VPN1_OUT
[PE2-bgp-VPN1_OUT]peer 10.1.22.5 allow-as-loop

6.CE3通过OSPF区域1接入PE3,通过PE3—CE3的逻辑接口互通,通告CE3的各环回口;CE4通过OSPF区域0接入PE4,通过PE4—CE4的GE0/0/1接口互通,通告CE4的各环回口。(2分)

[PE3]display ip vpn-instance
[PE3]ip vpn-instance VPN1
[PE3-vpn-instance-VPN1]route-distinguisher 100:13
[PE3-vpn-instance-VPN-af-ipv4]vpn-target 100:1 export-extcommunity
[PE3-vpn-instance-VPN-af-ipv4]vpn-target 200:1 import-extcommunity
接下来关联接口
[PE3]interface Mp-group 0/0/1
[PE3-Mp-group0/0/1]dis this
[PE3-Mp-group0/0/1]ip binding vpn-instance VPN1
[PE3-Mp-group0/0/1]ip add 10.2.33.0 30         ##ip地址重新再敲一下
接下来进入ospf
[PE3]ospf 2 vpn-instance VPN1
[PE3-ospf-2]area 0
[PE3-ospf-2-area-0.0.0.0]network 10.2.33.2 0.0.0.0

CE3是一个普通CE,直接敲OSPF

[CE3]ospf 2
[CE3-ospf-2]area 1
[CE3-ospf-2-area-0.0.0.1]network 10.2.33.1 0.0.0.0
[CE3-ospf-2-area-0.0.0.1]network 10.3.3.3 0.0.0.0
[CE3-ospf-2-area-0.0.0.1]network 172.17.1.3 0.0.0.0

在PE3上display一下

[PE3]display ip routing-table vpn-instance VPN1
###会收到10.3.3.3/32 172.17.1.3/32 255.255.255.255/32 的环回口路由

然后我们再看一下PE3有没有BGP的配置

[PE3]display current-configuration section bgp
###有bgp的路由,但是没有VPNv4的配置
做重分发
[PE3]ospf 2 vpn-instance VPN1
[PE3-ospf-2]import-route bgp
[PE3]bgp 200
[PE3-bgp]ipv4-family vpn-instance VPN1
[PE3-bgp-VPN1]import-route ospf 2
[PE4]display ip vpn-instance   ##查看配置
[PE4]ip vpn-instance VPN1
[PE4-vpn-instance-VPN1]route-distinguisher 100:14
[PE4-vpn-instance-VPN1-af-ipv4]vpn-target 100:1 export-extcommunity ##导出
EVT Assignment result:
Info:VPN-Target assignment is successful.
[PE4-vpn-instance-VPN1-af-ipv4]vpn-target 200:1 import-extcommunity ##导入
TVT Assignment result:
Info:VPN-Target assignment is successful.[PE4]interface GigabitEthernet 0/0/1
[PE4-GigabitEthernet0/0/1]ip binding vpn-instance VPN1
[PE4-GigabitEthernet0/0/1]ip add 10.2.41.2 30
运行OSPF
[PE4]ospf 2 vpn-instance VPN1
[PE4-ospf-2]area 0
[PE4-ospf-2-area-0.0.0.0]network 10.2.41.2 0.0.0.0

接下来是CE4

[CE4]ospf 2 vpn-instance VPN1
[CE4-ospf-2]vpn-instance-capability simple ##默认是undo掉的,把自己当做PE,但其实它是个CE,通过这条命令让它理解到自己是个CE
[CE4-ospf-2]area 0
[CE4-ospf-2-area-0.0.0.0]display ip int b  ##查看路由表,准备在area0里宣告三个接口[CE4-ospf-2-area-0.0.0.0]net 10.2.41.1 0.0.0.0    ##在area0里宣告三个接口
[CE4-ospf-2-area-0.0.0.0]net 172.17.1.4 0.0.0.0
[CE4-ospf-2-area-0.0.0.0]net 10.3.3.4 0.0.0.0

在PE4上display一下

[PE4-ospf-2]display ip routing-table vpn-instance VPN1
## 10.3.3.4/32 172.17.1.4/32255.255.255.255/32  路由表收到这些OSPF的路由接下来PE4也需要做重分发
[PE4-ospf-2]import-route bgp[PE4]bgp 200
[PE4-bgp]ipv4-family vpn-instance VPN1
[PE4-bgp-VPN1]import-route ospf 2

7.如图4,在AS100、AS200内建立IBGP Ipv4邻居关系:RR1是PE1、PE2、P1、ASBR1、ASBR2的反射器,RR2是PE3、PE4、P2、ASBR3、ASBR4的反射器。ASBR1—ASBR3、ASBR2—ASBR4建立EBGP Ipv4邻居关系。(已预配)

在RR1上查看一下BGP

[RR1]display current-configuration configuration bgp## 172.16.1.1 172.16.1.4172.16.1.5172.16.1.6172.16.1.20##反射器也都指好了##光做这些还不够,因为要做Option C的话,BGP之间需要能够通告标签[RR1]bgp 100
[RR1-bgp]peer 172.16.1.1 label-route-capability
[RR1-bgp]peer 172.16.1.4 label-route-capability
[RR1-bgp]peer 172.16.1.5 label-route-capability
[RR1-bgp]peer 172.16.1.6 label-route-capability
[RR1-bgp]peer 172.16.1.20 label-route-capability光开启完这个还不够,还需要建立VPNv4的BGP邻居关系
[RR1-bgp]ipv4-family vpnv4
[RR1-bgp-af-vpnv4]peer 172.16.1.1 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.1 reflect-client
[RR1-bgp-af-vpnv4]peer 172.16.1.4 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.4 reflect-client
[RR1-bgp-af-vpnv4]peer 172.16.1.5 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.5 reflect-client
[RR1-bgp-af-vpnv4]peer 172.16.1.6 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.6 reflect-client
[RR1-bgp-af-vpnv4]peer 172.16.1.20 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.20 reflect-client要保证这个配置,接下来我们需要在RR之间,两个AS,RR之间来建立VPNv4 BGP邻居,但是默认情况下,你enable一个邻居之后,你们之间会默认建立IPV4邻居,为了避免ipv4邻居建立,我们需要敲
undo default ipv4-unicast [RR1-bgp]undo default ipv4-unicast接下来在我们左边这个域内还有一个问题,PE1和RR1 之间这个链路是新建的,这个新建的链路的MPLS LDP肯定还没有启,其他链路都是默认启好的,只有这条链路需要自己手工启用[PE1]interface ip-Trunk 1
[PE1-ip-Trunk1]mpls
[PE1-ip-Trunk1]mpls ldp            ##这条必须启用##RR1上也必须启用MPLS
[RR1]interface ip-Trunk 1
[RR1-ip-Trunk1]mpls
[RR1-ip-Trunk1]mpls ldp  接下来在ASBR1,ASBR2上连接ASBR3和ASBR4上也需要启用
[ASBR1]int g0/0/2
[ASBR1-GigabieThernet0/0/2]mpls      ##不需要启用mpls,只要启MPLS让带标签的报文能过就好了[ASBR2]int g0/0/2
[ASBR2-GigabieThernet0/0/2]mpls      ##不需要启用mpls,只要启MPLS让带标签的报文能过就好了AS100内所有路由器要对RR1指VPNv4邻居,并且IPV4邻居里面要指[PE1]bgp 100
[PE1-bgp]peer 172.16.1.3 label-route-capability
[PE1-bgp]ipv4-family vpnv4 unicast
[PE1-bgp-af-vpnv4]peer 172.16.1.3 enable  ##激活邻接关系[PE2]bgp 100
[PE2-bgp]peer 172.16.1.3 label-route-capability
[PE2-bgp]ipv4-family vpnv4 unicast
[PE2-bgp-af-vpnv4]peer 172.16.1.3 enable[P1]bgp 100
[P1-bgp]peer 172.16.1.3 label-route-capability
[P1-bgp]vpls-family    ##不知道为什么
[P1-bgp]ipv4-family vpnv4 unicast
[P1-bgp-af-vpnv4]peer 172.16.1.3 enable[ASBR1]bgp 100
[ASBR1-BGP]peer 172.16.1.3 label-route-capability
[ASBR1-BGP]ipv4-family vpnv4 unicast
[ASBR1-BGP-af-VPNv4]peer 172.16.1.3 enable[ASBR2]bgp 100
[ASBR2-BGP]peer 172.16.1.3 label-route-capability
[ASBR2-BGP]ipv4-family vpnv4 unicast
[ASBR2-BGP-af-VPNv4]peer 172.16.1.3 enable在RR2上需要做相同一样的配置,在AS200 里面[RR2]bgp 200
[RR2-bgp]peer 172.16.1.2 label-route-capability
[RR2-bgp]peer 172.16.1.7 label-route-capability
[RR2-bgp]peer 172.16.1.8 label-route-capability
[RR2-bgp]peer 172.16.1.10 label-route-capability
[RR2-bgp]peer 172.16.1.11 label-route-capability[RR2-bgp]ipv4-family vpnv4 unicast
[RR2-BGP-af-VPNv4]peer 172.16.1.2 enable
[RR2-BGP-af-VPNv4]peer 172.16.1.2 reflect-client
[RR2-BGP-af-VPNv4]peer 172.16.1.7 enable
[RR2-BGP-af-VPNv4]peer 172.16.1.7 reflect-client
[RR2-BGP-af-VPNv4]peer 172.16.1.8 enable
[RR2-BGP-af-VPNv4]peer 172.16.1.8 reflect-client
[RR2-BGP-af-VPNv4]peer 172.16.1.10 enable
[RR2-BGP-af-VPNv4]peer 172.16.1.10 reflect-client
[RR2-BGP-af-VPNv4]peer 172.16.1.11 enable
[RR2-BGP-af-VPNv4]peer 172.16.1.11 reflect-client然后退出来之后别忘记了undo default ipv4-unicast 为了避免ipv4邻居建立
接下来可以先在RR1和RR2提前把vpnv4邻居建立起来[RR1]bgp 100
[RR1-bgp]peer 172.16.1.9 as-number 200
[RR1-bgp]peer 172.16.1.9 connect-interface Loopback 0
[RR1-bgp]peer 172.16.1.9 ebgp-max-hop   ##ebgp多跳
[RR1-bgp]ipv4-family vpnv4 unicast
[RR1-bgp-af-vpnv4]peer 172.16.1.9 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.9 next-hop-invariable[RR1-bgp]dis th  ##查看一下现象然后在RR2上
[RR2]bgp 100
[RR2-bgp]peer 172.16.1.3 as-number 100
[RR2-bgp]peer 172.16.1.3 connect-interface Loopback 0
[RR2-bgp]peer 172.16.1.3 ebgp-max-hop   ##ebgp多跳
[RR2-bgp]ipv4-family vpnv4 unicast
[RR2-bgp-af-vpnv4]peer 172.16.1.3 enable
[RR2-bgp-af-vpnv4]peer 172.16.1.3  next-hop-invariable##########################################################################
[ASBR3]int GigabitEthernet0/0/2
[ASBR3-GigabitEthernet0/0/2]mpls[ASBR3]bgp 200
[ASBR3-BGP]peer 172.16.1.9 label-route-capability
[ASBR3-BGP]ipv4-family vpnv4 unicast
[ASBR3-BGP-af-VPNv4]peer 172.16.1.9 enable[ASBR4]int GigabitEthernet0/0/2
[ASBR4-GigabitEthernet0/0/2]mpls[ASBR4]bgp 200
[ASBR4-BGP]peer 172.16.1.9 label-route-capability
[ASBR4-BGP]ipv4-family vpnv4 unicast
[ASBR4-BGP-af-VPNv4]peer 172.16.1.9 enable[P2]bgp 200
[P2-bgp]peer 172.16.1.9 label-route-capability
[P2-bgp]ipv4-family vpnv4 unicast
[P2-bgp-af-vpnv4]peer 172.16.1.9 enable
接下来PE3,PE4
[PE3]bgp 200
[PE3-bgp]peer 172.16.1.9 label-route-capability
[PE3-bgp]ipv4-family vpnv4 unicast
[PE3-bgp-af-vpnv4]peer 172.16.1.9 enable  ##激活邻接关系[PE4]bgp 200
[PE4-bgp]peer 172.16.1.9 label-route-capability
[PE4-bgp]ipv4-family vpnv4 unicast
[PE4-bgp-af-vpnv4]peer 172.16.1.9 enable  ##激活邻接关系[RR1]display current-configuration configuration bgp## 172.16.1.1 172.16.1.4172.16.1.5172.16.1.6172.16.1.20##反射器也都指好了##光做这些还不够,因为要做Option C的话,BGP之间需要能够通告标签[RR1]bgp 100
[RR1-bgp]peer 172.16.1.1 label-route-capability
[RR1-bgp]peer 172.16.1.4 label-route-capability
[RR1-bgp]peer 172.16.1.5 label-route-capability
[RR1-bgp]peer 172.16.1.6 label-route-capability
[RR1-bgp]peer 172.16.1.20 label-route-capability光开启完这个还不够,还需要建立VPNv4的BGP邻居关系
[RR1-bgp]ipv4-family vpnv4
[RR1-bgp-af-vpnv4]peer 172.16.1.1 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.1 reflect-client
[RR1-bgp-af-vpnv4]peer 172.16.1.4 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.4 reflect-client
[RR1-bgp-af-vpnv4]peer 172.16.1.5 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.5 reflect-client
[RR1-bgp-af-vpnv4]peer 172.16.1.6 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.6 reflect-client
[RR1-bgp-af-vpnv4]peer 172.16.1.20 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.20 reflect-client要保证这个配置,接下来我们需要在RR之间,两个AS,RR之间来建立VPNv4 BGP邻居,但是默认情况下,你enable一个邻居之后,你们之间会默认建立IPV4邻居,为了避免ipv4邻居建立,我们需要敲
undo default ipv4-unicast [RR1-bgp]undo default ipv4-unicast接下来在我们左边这个域内还有一个问题,PE1和RR1 之间这个链路是新建的,这个新建的链路的MPLS LDP肯定还没有启,其他链路都是默认启好的,只有这条链路需要自己手工启用[PE1]interface ip-Trunk 1
[PE1-ip-Trunk1]mpls
[PE1-ip-Trunk1]mpls ldp            ##这条必须启用##RR1上也必须启用MPLS
[RR1]interface ip-Trunk 1
[RR1-ip-Trunk1]mpls
[RR1-ip-Trunk1]mpls ldp  接下来在ASBR1,ASBR2上连接ASBR3和ASBR4上也需要启用
[ASBR1]int g0/0/2
[ASBR1-GigabieThernet0/0/2]mpls      ##不需要启用mpls,只要启MPLS让带标签的报文能过就好了[ASBR2]int g0/0/2
[ASBR2-GigabieThernet0/0/2]mpls      ##不需要启用mpls,只要启MPLS让带标签的报文能过就好了AS100内所有路由器要对RR1指VPNv4邻居,并且IPV4邻居里面要指[PE1]bgp 100
[PE1-bgp]peer 172.16.1.3 label-route-capability
[PE1-bgp]ipv4-family vpnv4 unicast
[PE1-bgp-af-vpnv4]peer 172.16.1.3 enable  ##激活邻接关系[PE2]bgp 100
[PE2-bgp]peer 172.16.1.3 label-route-capability
[PE2-bgp]ipv4-family vpnv4 unicast
[PE2-bgp-af-vpnv4]peer 172.16.1.3 enable[P1]bgp 100
[P1-bgp]peer 172.16.1.3 label-route-capability
[P1-bgp]vpls-family    ##不知道为什么
[P1-bgp]ipv4-family vpnv4 unicast
[P1-bgp-af-vpnv4]peer 172.16.1.3 enable[ASBR1]bgp 100
[ASBR1-BGP]peer 172.16.1.3 label-route-capability
[ASBR1-BGP]ipv4-family vpnv4 unicast
[ASBR1-BGP-af-VPNv4]peer 172.16.1.3 enable[ASBR2]bgp 100
[ASBR2-BGP]peer 172.16.1.3 label-route-capability
[ASBR2-BGP]ipv4-family vpnv4 unicast
[ASBR2-BGP-af-VPNv4]peer 172.16.1.3 enable在RR2上需要做相同一样的配置,在AS200 里面[RR2]bgp 200
[RR2-bgp]peer 172.16.1.2 label-route-capability
[RR2-bgp]peer 172.16.1.7 label-route-capability
[RR2-bgp]peer 172.16.1.8 label-route-capability
[RR2-bgp]peer 172.16.1.10 label-route-capability
[RR2-bgp]peer 172.16.1.11 label-route-capability[RR2-bgp]ipv4-family vpnv4 unicast
[RR2-BGP-af-VPNv4]peer 172.16.1.2 enable
[RR2-BGP-af-VPNv4]peer 172.16.1.2 reflect-client
[RR2-BGP-af-VPNv4]peer 172.16.1.7 enable
[RR2-BGP-af-VPNv4]peer 172.16.1.7 reflect-client
[RR2-BGP-af-VPNv4]peer 172.16.1.8 enable
[RR2-BGP-af-VPNv4]peer 172.16.1.8 reflect-client
[RR2-BGP-af-VPNv4]peer 172.16.1.10 enable
[RR2-BGP-af-VPNv4]peer 172.16.1.10 reflect-client
[RR2-BGP-af-VPNv4]peer 172.16.1.11 enable
[RR2-BGP-af-VPNv4]peer 172.16.1.11 reflect-client然后退出来之后别忘记了undo default ipv4-unicast 为了避免ipv4邻居建立
接下来可以先在RR1和RR2提前把vpnv4邻居建立起来[RR1]bgp 100
[RR1-bgp]peer 172.16.1.9 as-number 200
[RR1-bgp]peer 172.16.1.9 connect-interface Loopback 0
[RR1-bgp]peer 172.16.1.9 ebgp-max-hop   ##ebgp多跳
[RR1-bgp]ipv4-family vpnv4 unicast
[RR1-bgp-af-vpnv4]peer 172.16.1.9 enable
[RR1-bgp-af-vpnv4]peer 172.16.1.9 next-hop-invariable[RR1-bgp]dis th  ##查看一下现象然后在RR2上
[RR2]bgp 100
[RR2-bgp]peer 172.16.1.3 as-number 100
[RR2-bgp]peer 172.16.1.3 connect-interface Loopback 0
[RR2-bgp]peer 172.16.1.3 ebgp-max-hop   ##ebgp多跳
[RR2-bgp]ipv4-family vpnv4 unicast
[RR2-bgp-af-vpnv4]peer 172.16.1.3 enable
[RR2-bgp-af-vpnv4]peer 172.16.1.3  next-hop-invariable##########################################################################
[ASBR3]int GigabitEthernet0/0/2
[ASBR3-GigabitEthernet0/0/2]mpls[ASBR3]bgp 200
[ASBR3-BGP]peer 172.16.1.9 label-route-capability
[ASBR3-BGP]ipv4-family vpnv4 unicast
[ASBR3-BGP-af-VPNv4]peer 172.16.1.9 enable[ASBR4]int GigabitEthernet0/0/2
[ASBR4-GigabitEthernet0/0/2]mpls[ASBR4]bgp 200
[ASBR4-BGP]peer 172.16.1.9 label-route-capability
[ASBR4-BGP]ipv4-family vpnv4 unicast
[ASBR4-BGP-af-VPNv4]peer 172.16.1.9 enable[P2]bgp 200
[P2-bgp]peer 172.16.1.9 label-route-capability
[P2-bgp]ipv4-family vpnv4 unicast
[P2-bgp-af-vpnv4]peer 172.16.1.9 enable
接下来PE3,PE4
[PE3]bgp 200
[PE3-bgp]peer 172.16.1.9 label-route-capability
[PE3-bgp]ipv4-family vpnv4 unicast
[PE3-bgp-af-vpnv4]peer 172.16.1.9 enable  ##激活邻接关系[PE4]bgp 200
[PE4-bgp]peer 172.16.1.9 label-route-capability
[PE4-bgp]ipv4-family vpnv4 unicast
[PE4-bgp-af-vpnv4]peer 172.16.1.9 enable  ##激活邻接关系

查看路由

[RR2]display bgp vpnv4 all peer
##收到 172.16.1.2 172.16.1.3172.16.1.7172.16.1.8172.16.1.10172.16.1.11 的邻接关系  Established  172.16.1.3没有很正常除了对面RR没有,其他都会收到
[RR1]display bgp vpnv4 all peer
##收到 172.16.1.2 172.16.1.4172.16.1.5172.16.1.6172.16.1.9172.16.1.20 的邻接关系  Established  172.16.1.9没有很正常除了对面RR没有,其他都会收到

总结一下:

左右两边两个域。RR都是绝对的RR,它既是ipv4 RR又是VPNV4 RR。AS域内的所有路由器都要和RR建立ipv4邻居关系又要建立VPNv4邻居。OptionC里面建立ipv4邻居的时候要开启通告路由时携带标签的功能。建立VPNv4的时候,路由器可以和RR直接建立,RR对路由器指反射器,它们之间要建立VPNv4 EBGP邻居。

记得要关闭RT过滤器

[RR2-bgp-af-vpnv4]undo policy vpn-target  [RR2-bgp-af-vpnv4]undo policy vpn-target  

特别注意:RR1和PE1之间的链路是新建的。新建的链路没有MPLS,需要启用

ASBR之间的链路需要把MPLS启用起来,不要启用LDP,保证之后的数据层面没有问题

8.在ASBR上,将ISIS的Loopback0路由引入BGP。(2分)

在ASBR上创建一个前缀列表

[ASBR1]ip ip-prefix Loopbacks index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32
##主要作用就是抓环回口路由
[ASBR1]route-policy Loopacks permit node 10
[ASBR1-route-policy]if-match ip-prefix Loopbacks[ASBR1]bgp 100
[ASBR1-bgp]import-route isis 1 route-policy Loopbacks
##############################################################
[ASBR2]ip ip-prefix Loopbacks index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32
##主要作用就是抓环回口路由
[ASBR2]route-policy Loopacks permit node 10
[ASBR2-route-policy]if-match ip-prefix Loopbacks[ASBR2]bgp 100
[ASBR2-bgp]import-route isis 1 route-policy Loopbacks
##############################################################
[ASBR3]ip ip-prefix Loopbacks index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32
##主要作用就是抓环回口路由
[ASBR3]route-policy Loopacks permit node 10
[ASBR3-route-policy]if-match ip-prefix Loopbacks[ASBR3]bgp 200
[ASBR3-bgp]import-route isis 1 route-policy Loopbacks
#################################################################
[ASBR4]ip ip-prefix Loopbacks index 10 permit 172.16.0.0 16 greater-equal 32 less-equal 32
##主要作用就是抓环回口路由
[ASBR4]route-policy Loopacks permit node 10
[ASBR4-route-policy]if-match ip-prefix Loopbacks[ASBR4]bgp 200
[ASBR4-bgp]import-route isis 1 route-policy Loopbacks##做好之后路由都会有了[ASBR1]display ip routing-table protocol bgp
##会收到 172.16.1.2/32172.16.1.7/32172.16.1.8/32172.16.1.9/32172.16.1.10/32172.16.1.11/32但是这些路由当前是没有带标签的
[ASBR1]route-policy ASBR permit node 10
[ASBR1-route-policy]apply mpls-label[ASBR1]route-policy RR permit node 10
[ASBR1-route-policy]if-match mpls-label
[ASBR1-route-policy]apply mpls-label[ASBR1]bgp 100
[ASBR1-bgp]peer 10.1.57.2 label-route-capability
[ASBR1-bgp]peer 10.1.57.2 route-policy ASBR export
[ASBR1-bgp]peer 172.16.1.3 route-policy RR export只有这样配置才能保证给EBGP邻居发送路由的时候携带标签,并且通过EBGP邻居收到带标签的路由之后,能够让这个标签继续携带在路由中给RR发送走[ASBR2]route-policy ASBR permit node 10
[ASBR2-route-policy]apply mpls-label[ASBR2]route-policy RR permit node 10
[ASBR2-route-policy]if-match mpls-label
[ASBR2-route-policy]apply mpls-label[ASBR2]bgp 100
[ASBR2-bgp]peer 10.1.68.2 label-route-capability
[ASBR2-bgp]peer 10.1.68.2 route-policy ASBR export
[ASBR2-bgp]peer 172.16.1.3 route-policy RR export
#################################################################
[ASBR3]route-policy ASBR permit node 10
[ASBR3-route-policy]apply mpls-label[ASBR3]route-policy RR permit node 10
[ASBR3-route-policy]if-match mpls-label
[ASBR3-route-policy]apply mpls-label[ASBR3]bgp 200
[ASBR3-bgp]peer 10.1.57.1 label-route-capability
[ASBR3-bgp]peer 10.1.57.1 route-policy ASBR export
[ASBR3-bgp]peer 172.16.1.9 route-policy RR export
#################################################################
[ASBR4]route-policy ASBR permit node 10
[ASBR4-route-policy]apply mpls-label[ASBR4]route-policy RR permit node 10
[ASBR4-route-policy]if-match mpls-label
[ASBR4-route-policy]apply mpls-label[ASBR4]bgp 200
[ASBR4-bgp]peer 10.1.68.1 label-route-capability
[ASBR4-bgp]peer 10.1.68.1 route-policy ASBR export
[ASBR4-bgp]peer 172.16.1.9 route-policy RR export必须要这么做

查看路由是否携带标签

[RR1]display bgp routing-table label
##172.16.1.2172.16.1.7172.16.1.8172.16.1.9172.16.1.10172.16.1.11 路由都携带标签[RR1]display bgp vpnv4 all peer
## 172.16.1.1172.16.1.4172.16.1.5172.16.1.6172.16.1.9172.16.1.20路由都起来了          Established## 华为两台路由器建立VPNv4邻居有个前提,前提是需要拥有去往对方的32位的lsp,只要lsp(标签交换路径)建立了,这块vpnv4邻居就可以建立了 
[RR2]display bgp routing-table label [RR2]display bgp vpnv4 all peer##同上

配置逻辑:在配置BGP的时候,可以想一下BGP的IPv4要不要加标签,VPNv4怎么去建立。想到标签过后不要忘了ASBR之间的标签问题,针对ASBR开启通告路由携带标签的功能,并且要结合route-policy,让标签真的能够携带,并且你给对方发送路由携带标签,对方再给IBGP传递的时候标签是否存在,(答案是不能有的),每个ASBR都要创建两个route-policy。一个用来给EBGP发送路由的时候携带标签。一个用来给RR转发路由的时候,让标签保持。这就是两个route-policy的作用。    接下来该启用MPLS的接口需要启用mpls。该启用LDP的要启用LDP。然后接下来RR之间要建立VPNv4邻居,下一跳不要改变。这就是PE的路由传递给对方,下一跳是PE,而不是我。然后接下来要关闭他们两个默认建立IPv4 BGP的功能,让你们之间peer对方的时候不会默认建立ipv4邻居,并且你们vpnv4的邻居里面VPNv4的RT过滤器要关闭掉。

在两个RR上,RR1和RR2上

[RR1]bgp 100
[RR1-bgp]ipv4-family vpnv4 unicast
[RR1-bgp-af-vpnv4]peer 172.16.1.1 next-hop-invariable
[RR1-bgp-af-vpnv4]peer 172.16.1.4 next-hop-invariable
[RR1-bgp-af-vpnv4]peer 172.16.1.5 next-hop-invariable
[RR1-bgp-af-vpnv4]peer 172.16.1.6 next-hop-invariable
[RR1-bgp-af-vpnv4]peer 172.16.1.20 next-hop-invariable
[RR2]bgp 200
[RR2-bgp]ipv4-family vpnv4 unicast
[RR2-bgp-af-vpnv4]peer 172.16.1.2 next-hop-invariable
[RR2-bgp-af-vpnv4]peer 172.16.1.7 next-hop-invariable
[RR2-bgp-af-vpnv4]peer 172.16.1.8 next-hop-invariable
[RR2-bgp-af-vpnv4]peer 172.16.1.10 next-hop-invariable
[RR2-bgp-af-vpnv4]peer 172.16.1.11 next-hop-invariable

题目第七项是需要自己检查一下。

第八项做一个环回口引入(前缀列表,一个route-policy,在重分发的时候调用route-policy。

第九项检查MPLS(PE1和RR1的域内链路,还有ASBR之间的链路。在域内既要启用MPLS和LDP,在域间的话只要启用MPLS就好了

[RR2-bgp-af-vpnv4]peer 172.16.1.3 allow-as-loop

11.CE1—PE1之间链路断,CE1设备上仍可学到Spoke业务网段;当CE2—PE2之间链路断,CE2仍可学习到Spoke业务网段。配置保证有最好的扩展性。(6分)

[CE1]ospf 1
[CE1-ospf-1]import-route bgp tag 100[CE2]ospf 1
[CE2-ospf-1]import-route bgp tag 200

第11项做完之后,大家可以做一个分析,现在对于CE1而言,我们收到spoke的路由,可以通过PE1的BGP进程收到,也可以通过CE2的ospf重分发收到,ospf的外部管理距离是150 ,但是BGP的管理距离是255 ,这是华为的默认值 。

12.在拓扑正常的情况下,要求CE1、CE2访问Spoke业务网段时,不从本AS内部绕行。(1分)

第12大项要求我们做一个修正,这个需求需要我们修改EBGP的管理距离。把ebgp的管理距离改的比OSPF外部路由小一点就好了。

[CE1]bgp 65000
[CE1-bgp]preference 149 255    ##EBGP改成149,IBGP改成255,本地产生的255[CE2]bgp 65000
[CE2-bgp]preference 149 255    ##EBGP改成149,IBGP改成255,本地产生的255

13.在PE3/PE4上修改BGP Local-preference属性,实现CE3/CE4访问非直连的10.3.X.0/24网段时,若X为奇数,PE3/PE4优选的下一跳为PE1;若X为偶数,PE3/PE4优选的下一跳为PE2.不用考虑来回路径是否一致。(3分)

解法逻辑:在PE3和PE4上,所有的VPNv4路由都是通过RR收到的,RR发送的路由肯定有PE1发的PE2发的(PE1和PE2发送的路由携带的RD是不一样的,RD不一样,就算路由的前缀和掩码都相同,也不算是相同路由,就算不是相同路由,也都能收到),当收到这些路由,根据选路原则,会选择最优路由。

最简单的方式是抓取PE1和PE2的更新源地址,使用前缀列表来抓。

用ACL来抓第三段为奇数和偶数的路由,接下来做一个route-policy

route-policy抓奇数路由,抓取PE1为下一跳的这些路径,把优先级local-preference改高一些。改成100以上。

然后针对第三段为偶数,下一跳为PE2的路由,把优先级local-preference给改大

通过这些修改的话可以实现我们的功能。因为通过PE1和PE2 既能收到第三段为奇数又能收到第三段为偶数的路由。默认情况下是根据十三条选路原则来确定到底使用哪一条来转发数据,会通过选路原则来实现。现在就是去往第三段为奇数的,并且下一跳为PE1的被优选,第三段为偶数的,下一跳为PE2的被优选,通过这种组合就能实现

ip ip-prefix PE1 index 10 permit 172.16.1.1 32 greater-equal 32 less-equal 32ip ip-prefix PE2 index 10 permit 172.16.1.20 32 greater-equal 32 less-equal 32acl number 2000
rule 5 permit source 10.3.1.0 0.0.254.0acl number 2001
rule 5 permit source 10.3.0.0 0.0.254.0route-policy local-prf permit node 10
if-match acl 2000
if-match ip next-hop ip-prefix PE1
apply local-preference 101route-policy local-prf permit node 20
if-match acl 1000
if-match ip next-hop ip-prefix PE2
apply local-preference 101bgp 200
ipv4-family vpnv4
peer 172.16.1.9 route-policy local-prf import

需要注意的是,做完这些配置之后,一定要放行所有其他路由,(其他路由都被过滤掉了 其他就是第三段为奇数,来自于PE2的路由就不接收了。第三段为偶数,来自于PE1的也不接收了。最后在针对RR在接收路由的时候调用route-policy

4、Feature(17分)

4.1 HA(8分)高可用性

1.CE1配置静态的默认路由访问ISP,下一跳IP为100.0.1.2。该默认路由要与CE1—ISP链路的BFD状态绑定(CE1的对端设备不支持BFD),感知故障的时间要小于150ms。(2分)

one-arm-echo

discriminator local 1  本地标识

detect-multiplier 4   4次发送HELLO ,如果没有收到回应,就会认为邻接关系down了

min-echo-rx-interval 30   HELLO ,30毫秒发一次

commit  命令生效

ip route-static 0.0.0.0 100.0.1.2 track bfd-session isp 静态路由绑定bfd

[CE1]bfd         ##全局开启bfd
[CE1-bfd][CE1]bfd isp bind peer-ip 100.0.1.2 interface GigabitEthernet 2/0/1 one-arm-echo                  单臂回升功能
[CE1-bfd-session-isp]discriminator local 1   本地标识
[CE1-bfd-session-isp]detect-multiplier 4
[CE1-bfd-session-isp]min-echo-rx-interval 30
[CE1-bfd-session-isp]commit  命令生效
测试
[CE1]display bfd session all
100.0.1.2                       State 状态 为 UP[CE1]ping 100.0.1.2  能通接下来写静态默认
[CE1]ip route-static 0.0.0.0 100.0.1.2 track bfd-session isp 静态路由绑定bfd              ###递归表查询2次路由表才能 发包

2.CE2配置静态的默认路由访问ISP,下一跳IP为200.0.2.2。默认路由要与CE2—ISP链路的NQA ICMP测试绑定,每隔3s测试例执行1次。(2分)

解法:NQA的做法

nqa test-instance admin icmp ##admin 是管理员的名字 icmp是进程的名字

test-type icmp ##探针类型 是icmp

destination-address ipv4 200.0.2.2 ##测试200.0.2.2之间的连通性

frequency 3 ##3秒一次

start now ##现在开始立刻执行操作

ip route-static 0.0.0.0 0.0.0.0 200.0.2.2 track nqa admin icmp 写静态默认的时候 绑定nqa

[CE2]nqa test-instance admin icmp          ##admin 是管理员的名字 icmp是进程的名字
[CE2-nqa-admin-icmp]test-type icmp        ##探针类型 是icmp
[CE2-nqa-admin-icmp]destination-address ipv4 200.0.2.2        ##测试200.0.2.2之间的连通性
[CE2-nqa-admin-icmp]frequency 3             ##3秒一次
[CE2-nqa-admin-icmp]start now              ##现在开始立刻执行操作
测试
[CE2]display nqa historyStatus  为 success  就代表nqa没有问题  [CE2]ip route-static 0.0.0.0 0.0.0.0 200.0.2.2 track nqa admin icmp  写静态默认的时候 绑定nqa测试
[CE2]display ip routing-table protocol static
0.0.0.0/0  静态默认存在就没有问题CE1和CE2现在都有能力通过静态默认来访问lsp运营商,接下来通过OSPF来下放

3.CE3、CE4能够通过默认路由访问ISP。CE1—ISP的链路断开时,CE1仍能访问ISP;CE2—ISP的链路断开时,CE2仍能访问ISP。(4分)

解法:默认路由要通过OSPF下放

[CE1]ospf 1
[CE1-ospf-1]default-route-advertise[CE2]ospf 1
[CE2-ospf-1]default-route-advertise

测试一下

[CE2]display ospf peer brief
0.0.0.0 邻居收到了[CE2]display ospf lsdb
External   0.0.0.0      172.17.1.2
External   0.0.0.0      172.17.1.1
收到默认路由就Ok了
[CE1]display ospf lsdb
External   0.0.0.0      172.17.1.1
External   0.0.0.0      172.17.1.2

接下来要在BGP中把路由给通告走

[CE1]bgp 65000
[CE1-bgp]peer 10.2.11.6 default-route-advertise conditional-route-match-all 0.0.0.0 0在PE1上测试一下<PE1>display ip routing-table vpn-instance VPN1_OUT protocol bgp
0.0.0.0  默认路由收到就ok[CE1]interface GigabitEthernet 0/0/2.10
[CE1-GigabitEthernet0/0/2.10]vrrp vrid 1 track GigabitEthernet 2/0/1 reduced 15
[CE1-GigabitEthernet0/0/2.10]vrrp vrid 1 track GigabitEthernet 0/0/0 reduced 15
##这两个 track 跟踪两个接口 两个接口都挂了,优先级减30,减完之后,优先级比对方小,对方就能抢占你的位置

CE2的配置

[CE2]route-policy org permit node 10
[CE2-route-policy]apply origin incomplete[CE2]bgp 65000
[CE2-bgp]peer 10.2.22.6 default-route-advertise org conditional-route-match--all 0.0.0.0 0测试
<PE2>display ip routing-table vpn-instance VPN1_OUT protocol bgp
0.0.0.0  收到默认路由就OK设置接口[CE2]interface GigabitEthernet 0/0/2.20
[CE2-GigabitEthernet0/0/2.20]vrrp vrid 2 track GigabitEthernet 2/0/2 reduced 15
[CE2-GigabitEthernet0/0/2.20]vrrp vrid 1 track GigabitEthernet 0/0/0 reduced 15

接下来在PE3和PE4上的ospf进程中做默认路由下放,不做的话,CE3和CE4是收不到默认路由的

[PE3]ospf 2 vpn-instance VPN1
[PE3-ospf-2]default-route-advertise[PE4]ospf 2 vpn-instance VPN1
[PE4-ospf-2]default-route-advertise测试<CE3>display ip routing-table
0.0.0.0 O_ASE  收到默认就ok<CE4>display ip routing-table vpn-instance VPN1
0.0.0.0 O_ASE  收到默认就ok都有默认之后,我们就可以通过默认来访问lsp了

4.2 NAT(2分)

1.在CE1上,10.3.0.0/16(不含10.3.2.10)的内网地址转换为102.0.1.2—102.0.1.6,通过GE2/0/1访问ISP。在CE2上,10.3.0.0/16(不含10.3.2.10)的内网地址转换为102.0.1.2—102.0.1.6,通过GE2/0/2访问ISP。Server1拥有单独的公网地址102.0.1.1,对ISP提供FTP和HTTP服务。(2分)

解法:做NAT和PVT

[CE1]nat address-group 1 102.0.1.2 102.0.1.6[CE1]acl number 2000
[CE1-acl-basic-2000]rule 10 deny source 10.3.2.10 0.0.0.0
[CE1-acl-basic-2000]rule 20 deny source 10.3.0.0 0.0.255.255
接下来在外网接口
[CE1]interface GigabitEthernet 2/0/1
[CE1-GigabitEthernet2/0/1]nat outbound 2000 address-group 1
[CE1-GigabitEthernet2/0/1]nat sever protocol tcp global 102.0.1.1 www inside 10.3.2.10 www
[CE1-GigabitEthernet2/0/1]nat sever protocol tcp global 102.0.1.1 ftp inside 10.3.2.10 ftp
[CE2]nat address-group 1 102.0.1.2 102.0.1.6[CE2]acl number 2000
[CE2-acl-basic-2000]rule 10 deny source 10.3.2.10 0.0.0.0
[CE2-acl-basic-2000]rule 20 deny source 10.3.0.0 0.0.255.255[CE2]interface GigabitEthernet 2/0/2
[CE2-GigabitEthernet2/0/1]nat outbound 2000 address-group 1
[CE2-GigabitEthernet2/0/1]nat sever protocol tcp global 102.0.1.1 www inside 10.3.2.10 www
[CE2-GigabitEthernet2/0/1]nat sever protocol tcp global 102.0.1.1 ftp inside 10.3.2.10 ftp

这个做完之后可以去PC上面ping

PC1>ping 100.0.1.2
可以ping通
PC1>ping 200.0.2.2
可以ping通测试<CE3>ping -a 10.3.3.3 100.0.1.2
可以ping通<CE4>ping -vpn-instance VPN1 -a 10.3.3.3 100.0.1.2
可以ping通

4.3 QoS(7分)

1.在CE1的GE2/0/1、CE2的GE2/0/2的出方向、周一至周五的8:00—18:00点,对TCP目的端口号6881—6999的流量,承诺的平均速率为1Mbps。(3分)

[CE1]time-range work 08:00 to 18:00 working-day
[CE1]acl number 3000
[CE1-acl-adv-3000]rule 10 permit tcp destination-port range 6881 6999 time-range work
做好了直接调用
[CE1]interface GigabitEthernet 2/0/1
[CE1-GigabitEthernet2/0/1]qos car outbound acl 3000 cir 1024 [CE2]time-range work 08:00 to 18:00 working-day
[CE2]acl number 3000
[CE2-acl-adv-3000]rule 10 permit tcp destination-port range 6881 6999 time-range work
做好了直接调用
[CE2]interface GigabitEthernet 2/0/2
[CE2-GigabitEthernet2/0/1]qos car outbound acl 3000 cir 1024 

2.

[CE4]display acl all                     ##先查看
[CE4]acl name Office                     ##acl起名 Office
[CE4-acl-adv-Office]rule 10 permit ip destination 10.3.4.0 0.0.0.255[CE4]acl name Monitor
[CE4-acl-adv-Monitor]rule 10 permit ip destination 10.3.3.0 0.0.0.255[CE4]acl name Signal
[CE4-acl-adv-Signal]rule 10 permit ip destination 10.3.2.0 0.0.0.255[CE4]acl name RealTime
[CE4-acl-adv-RealTime]rule 10 permit ip destination 10.3.1.0 0.0.0.255接下来做traffic classifier
[CE4]traffic classifier Office
[CE4-classifier-Office]if-match acl Office[CE4]traffic classifier Monitor
[CE4-classifier-Monitor]if-match acl Monitor[CE4]traffic classifier Signal
[CE4-classifier-Signal]if-match acl Signal[CE4]traffic classifier RealTime
[CE4-classifier-RealTime]if-match acl RealTime接下来做 traffic behavior
[CE4]traffic behavior Other
[CE4-behavior-Other]remark 8021p 0[CE4]traffic behavior Office
[CE4-behavior-Office]remark 8021p 2[CE4]traffic behavior Monitor
[CE4-behavior-Monitor]remark 8021p 3[CE4]traffic behavior Signal
[CE4-behavior-Signal]remark 8021p 4[CE4]traffic behavior Signal RealTime
[CE4-behavior-RealTime]remark 8021p 5接下来做traffic policy
[CE4]raffic policy Remark
[CE4-trafficpolicy-Remark]classifier RealTime behavior RealTime
[CE4-trafficpolicy-Remark]classifier Signal behavior Signal
[CE4-trafficpolicy-Remark]classifier Monitor behavior Monitor
[CE4-trafficpolicy-Remark]classifier Office behavior Office
[CE4-trafficpolicy-Remark]classifier default-class behavior Other
[CE4-trafficpolicy-Remark]display this接下来去g0/0/1
[CE4]interface GigabiteThernet 0/0/1
[CE4-GigabiteThernet0/0/1]traffic-policy Remark outbound在PE4上收到8021p的流量之后要做一个映射[PE4]qos map-table dot1q-dscp
[PE4-maptbl-dot1q-dscp]input 5 output 46
[PE4-maptbl-dot1q-dscp]input 4 output 32
[PE4-maptbl-dot1q-dscp]input 3 output 24
[PE4-maptbl-dot1q-dscp]input 2 output 16
[PE4-maptbl-dot1q-dscp]input 0 output 0[PE4]interface GigabiteThernet 0/0/1
[PE4-GigabiteThernet0/0/1]trust 8021p override ##做一个重新覆盖接下来做一个队列,随机做检测[PE4]drop-profile CS4
[PE4-drop-profile-CS4]wred dscp
[PE4-drop-profile-CS4]dscp cs4 low-limit 70 high-limit 100 discard-percentage 50[PE4]drop-profile CS3
[PE4-drop-profile-CS3]wred dscp
[PE4-drop-profile-CS3]dscp cs3 low-limit 50 high-limit 90 discard-percentage 50[PE4]drop-profile CS2
[PE4-drop-profile-CS2]wred dscp
[PE4-drop-profile-CS2]dscp cs2 low-limit 50 high-limit 80 discard-percentage 50[PE4]drop-profile default
[PE4-drop-profile-default]wred dscp
[PE4-drop-profile-default]dscp default low-limit 50 high-limit 80 discard-percentage 50接下来要做一个queue-profile
[PE4]qos queue-profile HCIE
[PE4-qos-queue-profile-HCIE]schedule wfd 0 to 4 pq 5  ##先修改队列的类型
[PE4-qos-queue-profile-HCIE]queue 0 weight 1          ##权重是1
[PE4-qos-queue-profile-HCIE]queue 2 weight 9          ##权重是9
[PE4-qos-queue-profile-HCIE]queue 3 weight 21         ##权重是21
[PE4-qos-queue-profile-HCIE]queue 4 weight 63         ##权重是63接下来携带wred 做一个关联
[PE4-qos-queue-profile-HCIE]queue 0 drop-profile default
[PE4-qos-queue-profile-HCIE]queue 2 drop-profile CS2
[PE4-qos-queue-profile-HCIE]queue 3 drop-profile CS3
[PE4-qos-queue-profile-HCIE]queue 4 drop-profile CS4
[PE4-qos-queue-profile-HCIE]display this接下来调用对列在我们的出接口 [PE4]interface GigabiteThernet 0/0/0
[PE4-GigabiteThernet0/0/0]qos queue-profile HCIE
[PE4]interface GigabiteThernet 0/0/2
[PE4-GigabiteThernet0/0/2]qos queue-profile HCIE
做好之后就ok了

5,Ipv6(14分)

1.所有设备的接口Ipv6地址,按照图5配置。(除PE1—RR1的逻辑接口之外,已预配置)

先查看一下

[RR1]display ipv6 interface brief
2000:EAD8:99EF:CC3E:B2AD:9EFF:32DD:1301 Loopback 0[PE1]display ipv6 interface brief
2000:EAD8:99EF:CC3E:B2AD:9EFF:32DD:1300 Loopback 0

4.2 Ipv6 ISIS(3分)

1.如图6,PE1、PE2、RR1、P1、ASBR1、ASBR2运行ISIS协议。各直连网段通过入ISIS,配置各链路cost。(3分)

解法:在一台路由器上启用ISIS ,既为IPv4又为IPv6做路由。这个时候需要修改一下拓扑类型。isis的拓扑类型有两种:一种是 ipv4和ipv6共用一拓扑,一种是IPv4一个拓扑,IPv6一个拓扑 。

[PE1]isis 1
[PE1-isis-1]ipv6 enable topology ipv6
[PE1-isis-1]interface Loopback 0
[PE1-Loopback0]isis ipv6 enable 1
[PE1-Loopback0]interface GigabitEthernet0/0/0
[PE1-GigabitEthernet0/0/0]isis ipv6 enable 1
[PE1-GigabitEthernet0/0/0]isis ipv6 cost 20
[PE1-GigabitEthernet0/0/0]interface Ip-Trunk1
[PE1-Ip-Trunk1]isis ipv6 enable 1
[PE1-Ip-Trunk1]isis ipv6 cost 1550[PE2]isis 1
[PE2-isis-1]ipv6 enable topology ipv6
[PE2-isis-1]interface Loopback 0
[PE2-Loopback0]isis ipv6 enable 1
[PE2-Loopback0]interface GigabitEthernet0/0/0
[PE2-GigabitEthernet0/0/0]isis ipv6 enable 1
[PE2-GigabitEthernet0/0/0]isis ipv6 cost 20
[PE2-GigabitEthernet0/0/0]interface GigabitEthernet0/0/2
[PE2-GigabitEthernet0/0/2]isis ipv6 enable 1
[PE2-GigabitEthernet0/0/2]isis ipv6 cost 1550[RR1]isis 1
[RR1-isis-1]ipv6 enable topology ipv6
[RR1-isis-1]interface Loopback 0
[RR1-Loopback0]isis ipv6 enable 1
[RR1-Loopback0]interface GigabitEthernet0/0/0
[RR1-GigabitEthernet0/0/0]isis ipv6 enable 1
[RR1-GigabitEthernet0/0/0]isis ipv6 cost 80
[RR1-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[RR1-GigabitEthernet0/0/1]isis ipv6 enable 1
[RR1-GigabitEthernet0/0/1]isis ipv6 cost 860
[RR1-GigabitEthernet0/0/1]interface Ip-Trunk1
[RR1-Ip-Trunk1]isis ipv6 enable 1
[RR1-Ip-Trunk1]isis ipv6 cost 1550[P1]isis 1
[P1-isis-1]ipv6 enable topology ipv6
[P1-isis-1]interface Loopback 0
[P1-Loopback0]isis ipv6 enable 1
[P1-Loopback0]interface GigabitEthernet0/0/0
[P1-GigabitEthernet0/0/0]isis ipv6 enable 1
[P1-GigabitEthernet0/0/0]isis ipv6 cost 80
[P1-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[P1-GigabitEthernet0/0/1]isis ipv6 enable 1
[P1-GigabitEthernet0/0/1]isis ipv6 cost 1000
[P1-GigabitEthernet0/0/1]interface GigabitEthernet0/0/2
[P1-GigabitEthernet0/0/2]isis ipv6 enable 1
[P1-GigabitEthernet0/0/2]isis ipv6 cost 1500[ASBR1]isis 1
[ASBR1-isis-1]ipv6 enable topology ipv6
[ASBR1-isis-1]interface Loopback 0
[ASBR1-Loopback0]isis ipv6 enable 1
[ASBR1-Loopback0]interface GigabitEthernet0/0/0
[ASBR1-GigabitEthernet0/0/0]isis ipv6 enable 1
[ASBR1-GigabitEthernet0/0/0]isis ipv6 cost 100
[ASBR1-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[ASBR1-GigabitEthernet0/0/1]isis ipv6 enable 1
[ASBR1-GigabitEthernet0/0/1]isis ipv6 cost 860[ASBR2]isis 1
[ASBR2-isis-1]ipv6 enable topology ipv6
[ASBR2-isis-1]interface Loopback 0
[ASBR2-Loopback0]isis ipv6 enable 1
[ASBR2-Loopback0]interface GigabitEthernet0/0/0
[ASBR2-GigabitEthernet0/0/0]isis ipv6 enable 1
[ASBR2-GigabitEthernet0/0/0]isis ipv6 cost 100
[ASBR2-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[ASBR2-GigabitEthernet0/0/1]isis ipv6 enable 1
[ASBR2-GigabitEthernet0/0/1]isis ipv6 cost 1000

在RR1上做路由泄露

[RR1]isis 1
[RR1-isis-1]ipv6 import-route isis level-2 into level-1

在P1上做路由泄露

[P1]isis 1
[P1-isis-1]ipv6 import-route isis level-2 into level-1

测试

[PE1]display ipv6 routing-table protocol isis
##找到ASBR1的路由地址

4.3 Ipv6 BGP(11分)

1.如图7,ASBR1—ASBR3通过直连链路建立EBGP4+邻居。PE1、PE2、P1是RR1的IBGP4+客户端。(已预配置)

RR1跟5和6在ipv6-family里面激活邻接关系 。然后指client

然后5和6进行回指

2.在ASBR1上将ISIS Ipv6的路由导入BGP4+,只向ASBR3通告前缀为2000:EAD8:99EF:CC3E:B2AD:9EFF:32DD:DC00/120的路由(不能使用Route-policy)。将ASBR3的Loopback0通告入BGP4+。(4分)

3.PE1、PE2学习到ASBR3 Loopback0的BGP4+明细路由。(3分)

4.请在PE1使能某特性,以确保PE1在启动过程(从物理接口up,到各协议邻居建立)中,PE2—ASBR3的Ipv6 ping无丢包。(4分)

3.0-LAB1-C1 实验相关推荐

  1. EFR32MG21 zigbee 3.0 OTA 升级实验

    EFR32MG21 zigbee 3.0 OTA 升级实验 参考文档:AN728 https://www.sekorm.com/doc/1607600.html 芯片:EFR32MG21A010F76 ...

  2. 【伊利丹】Hadoop-2.5.0-CDH5.2.0 RM HA实验记录

    引言 以前写了一个关于Hadoop2.0 NN HA实验记录博客,其中记录了hadoop中NameNode出现故障时可以自动切换主备节点,现在hadoop2.5.0版本中实现了RescoureMang ...

  3. MIT6.830 lab1 SimpleDb 实验报告

    一.环境搭建 1.课程官网:6.830/6.814: Database Systems 2.Github地址:simple-db-hw-2021 3.安装配置ant 二.实验概览 SimpleDB c ...

  4. 模拟电梯2.0(继承机制实验)

    浙江理工大学信息学院 实验指导书 实验名称:类的继承机制的实现 学时安排:3 实验类别:设计性实验 实验要求:1人1组  ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ...

  5. Packet Tracer 5.0建构CCNA实验攻略——帧中继Frame Relay

    Packet Tracer 5.0是一款非常不错的Cisco(思科)网络设备模拟器,对于想考思科初级认证(如CCNA)的朋友们来说,Packet Tracer 5.0是非常不错的选择.通常我们周围并没 ...

  6. Packet Tracer 5.0建构CCNA实验攻略(12)——PPP

    PPP(Point to Point Protocol)数据链路层协议.两种认证方式:一种是PAP,一种是CHAP.相对来说PAP的认证方式安全性没有CHAP高.PAP在传输password是明文的, ...

  7. 【伊利丹】Hadoop2.0 NN HA实验记录

    1.关于Hadoop2.2.0中HA的介绍 NameNode 简称: NN DateNode 简称: DN JournalNode  简称: JN Zookeeper  简称: ZK 从上面的图里,我 ...

  8. Packet Tracer 5.0建构CCNA实验攻略(3)——Cisco VTP

    VTP(Vlan Trunk Protocol)即VLAN中继协议.VTP通过网络(ISL帧或cisco私有DTP帧)保持VLAN配置统一性.VTP在系统级管理增加,删除,调整的VLAN,自动地将信息 ...

  9. Packet Tracer 5.0 建构 CCNA 实验攻略——路由器实现 Vlan 间通信

    一.网络拓扑结构如下: 二.为六台PC分别配置IP地址.子网掩码和默认网关 其余五台PC的配置与上图类似. 三.为路由器0创建g0/0.1逻辑子接口和g0/0.2逻辑子接口,并 设置g0/0.1逻辑子 ...

  10. Packet Tracer 5.0 建构 CCNA 实验攻略——配置单区域 OSPF

    一.拓扑结构如下: 二.分别为PC0.PC1配置IP地址,子网掩码和默认网关. 三.分别为路由器0.路由器1和路由器2各个接口配置IP地址和子网掩码,并将路由器的开关打开. 注意:可以通过命令show ...

最新文章

  1. ReentrantLock实现原理分析
  2. web安全攻防演练网站 靶机 测试环境 收集
  3. 光伏价格趋势:中美因素汇聚 市场需求向7月延伸
  4. webpack.DefinePlugin使用介绍
  5. 中石油训练赛 - Swapity Swap(矩阵快速幂)
  6. docker基础应用
  7. 34. 二分查找左右边界
  8. ubuntu 安装 man 查看函数原型
  9. objective-c中@autoreleasepool的用法
  10. js获取当前url路径
  11. STC12C5A60S2独立PWM
  12. Libero Soc 安装和License申请
  13. 你好,C++(2)1.3 C++世界版图1.4 如何学好C++
  14. 贺新春丨大年初六 六六大顺
  15. css3实现3d效果的立方体动画
  16. 使用ASP.NET Core和Hangfire实现HTTP异步化方案
  17. 敏捷开发中如何写好用户故事?
  18. 精确拐点交易体系之追涨停策略
  19. Python爬虫之scrapy框架介绍
  20. DirectX简介 第三篇 DirectSound简介

热门文章

  1. html iframe自动高度,iframe高度自适应撑开
  2. Flutter系列(二)flutter项目打安装包
  3. Git使用技巧--详细教程
  4. iphone来电铃声小 - MTK物联网在线解答 - 技术论坛
  5. 自然语言处理和编译器的对比
  6. Python基础+进阶(万字总结,基础案例+执行结果)
  7. 即食水产消费品公司“不等食品”获千万元级A轮融资,险峰长青领投
  8. 【接口测试】Http请求各内容说明
  9. 线程死锁 导致 服务器cpu负载过高
  10. Android 学习资料收集 1