LabV2
1. L2+VRRP
1.1 链路聚合
- 假设S1不支持LACP,S1和S2互联的接口需要合成一个二层逻辑接口,逻辑接口的成员链路根据源-目的MAC进行负载分担
# SW1/SW2
int eth-trunk 12
load-balance src-dst-mac
trunkport g0/0/23 0/0/24
1.2 Link-type
- S1、S2、S3、S4互联接口的链路类型为trunk,允许除VLAN1外的所有vlan通过
# SW1/SW:SW3/SW4
port-group group-member g0/0/1 g0/0/12 eth 12:g0/0/1 g0/0/2
port link-type trunk
port trunk allow-pass vlan all
undo port trunk allow-pass vlan 1
- CE1、CE2的VRRP虚拟IP地址10.3.1.254,为PC1的网关,CE1会周期性发送Sender IP为10.3.1.254,源MAC为00-00-5E-00-01-01的免费ARP。PC1与网关之间的数据包封装在VLAN10中
- CE1、CE2的VRRP虚拟IP地址10.3.2.254,为PC2的网关,CE2会周期性发送Sender IP为10.3.2.254,源MAC为00-00-5E-00-01-02的免费ARP。PC2与网关之间的数据包封装在VLAN20中
- VRRP的master设备重启时,在g0/0/2变为up 1分钟后,才能重新成为master
# CE1
int g0/0/2.10
vrrp vrid 1 virtual-ip 10.3.1.254
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode timer delay 60
arp broadcast enable
int g0/0/2.20
vrrp vrid 2 virtual-ip 10.3.2.254
arp broadcast enable
# CE2
int g0/0/2.10
vrrp vrid 1 virtual-ip 10.3.1.254
arp broadcast enable
int g0/0/2.20
vrrp vrid 2 virtual-ip 10.3.2.254
vrrp vrid 2 priority 120
vrrp vrid 2 preempt-mode timer delay 60
arp broadcast enable
# SW1/SW2 : 放行除vlan1所有vlan
vlan batch 10 20
int g0/0/2
port link-type trunk
port trunk allow-pass vlan all
undo port trunk allow-pass vlan 1
# SW3:SW4
vlan batch 10 20
int e0/0/1
port link access
port default vlan 10:20
# 测试------------------
# CE1/2
dis vrrp bri
# PC1/2
ping 10.3.2.254
ping 10.3.1.254
1.3 MSTP
- S1、S2、S3、S4都运行MSTP。Vlan 10在instance 10,S1作为primary root,S2作为secondary root。Vlan 20在instance 20,S2作为primary root,S1作为secondary root。MSTP的region name是HUAWEI,Revision-level 12。
# SW1/SW2/SW3/SW4
stp mode mstp
stp region-configuration
instance 10 vlan 10
instance 20 vlan 20
region-name HUAWEI
revision-level 12
active region-configuration
# SW1
stp instance 10 root primary
stp instance 20 secondary primary
# SW2
stp instance 10 root secondary
stp instance 20 root primary
- 除了交换机的互联端口,其他端口要确保不参与MSTP计算,由disabled会直接转到Forwarding状态。
# SW1/SW2:SW3/SW4
stp edged-port default
port-group group-member eth 12 g0/0/1 g0/0/12:g0/0/1 g0/0/2
stp edged-port disable
# 检查
# SW1/2/3/4
dis stp bri
# sw1端口均是forwarding,eth12为vlan20的root
# sw2端口均是forwarding,eth12为vlan10的root
# sw3端口g0/0/1是vlan10的root,g0/0/2是vlan20的root
# sw4端口g0/0/1是vlan20的root,g0/0/2是vlan10的root
1.4 WAN
- PE1-RR1的互联Serial接口,绑定为一个逻辑接口,成员链路采用HDLC,逻辑接口的IPv4地址、IPv6地址请按照图1、图5配置
#PE1/RR1
ipv6
int ip-trunk 1
ipv6 enable
ip addr 10.1.13.1/2 30
ipv6 addr 2000:EAD8:99EF:CC3E:B2AD:9EFF:A2DD:1300/1 127
int s0/0/1
link-protocol hdlc
ip-trunk 1
int s0/0/2
link-protocol hdlc
ip-trunk 1
# 测试-----------------------
# RR1
ping 10.1.13.1
ping ipv6 2000:EAD8:99EF:CC3E:B2AD:9EFF:A2DD:1300
- PE3-CE3的互联POS接口,绑定为一个逻辑接口,成员链路采用PPP,逻辑接口的IPv4地址,请按照图1配置
注意PE3的mp接口需要先绑定VPN1
# PE3/CE3
int mp-group 0/0/1
dis cu conf vpn
ip binding vpn-instance VPN1 # CE3不需要配置
ip add 10.2.33.1/2 30
q
int p4/0/0
ppp mp mp-group 0/0/1
int p6/0/0
ppp mp mp-group 0/0/1
# 测试
# CE3
ping 10.2.33.1
2. IPv4 IGP
2.1 基本配置
- 所有设备的接口IPv4地址按照图1配置(除PE1-RR1的逻辑接口外,已预配置)
- Route-id与loopback0的IPv4地址相同。MPLS域各设备的loopback0为172.16.0.0/16的32位主机地址(已预配置),未来扩容的MPLS域各设备的loopback0,从172.16.0.0/16去可用的主机地址,比如172.16.1.21/32可能分布在AS100,也可能分布在AS200。
# CE1/CE2/CE3/CE4
router id 172.17.1.1/2/3/4
# PE1/PE2/RR1/P1/ASBR1/ASBR2/ASBR3/ASBR4/RR2/P2/PE3/PE4
router id 172.16.1.1/20/3/4/5/6/7/8/9/10/11/2
2.2 OSPF
- CE1和CE2之间的链路,及该两台设备的loopback0通告入OSPF区域0(已预配置)
- CE1的g0/0/2.10和g0/0/2.20、CE2的g0/0/2.10和g0/0/2.20,直连网段通告入OSPF区域0,这些接口不能收发OSPF报文
# CE1/CE2
int g0/0/2.10
ospf enable 1 a 0
int g0/0/2.20
ospf enable 1 a 0
ospf 1 router-id 172.17.1.1/2
a 0
network 172.17.1.1/2 0.0.0.0
network 10.2.12.1/2 0.0.0.0
network 10.3.1.1/2 0.0.0.0
network 10.3.2.1/2 0.0.0.0
q
silent-int g0/0/2.10
silent-int g0/0/2.20
# 检查-------------------
# CE1/2
dis ospf peer bri
dis ospf int
- RR2、P2、PE3、PE4在OSPF区域0中,cost如图2配置(已预配置)
PE4不能宣告lo0,原因为次优路径,涉及考点5
# RR2/P2/PE3/PE4
ospf 1 router-id 172.16.1.9/10/11/12
a 0
network 172.16.1.9/10/11 0.0.0.0 # PE4不能宣告lo0
network 10.1.91/112.1/2 0.0.0.0
network 10.1.119/102.1/2 0.0.0.0
- PE3-PE4的OSPF链路类型为P2P
# PE3/PE4
int g0/0/0
ospf network-type p2p
# 检查-----------------
# 所有设备
dis ospf int
dis ospf peer bri
- PE4上将loopback0地址引入OSPF。AS200中,各OSPF网元到PE4 loopback0的路由,要累加内部cost
# PE4
ip ip-prefix L0 permit 172.16.1.2 32
route-policy L0 permit node 10
if-match ip-prefix L0
apply tag 2
ospf 1
import-route direct type 1 route-policy L0
# 检查-----------------
# P2
dis ip rou 172.16.1.2 verbose # 172.16.1.2的cost变为1501,tag为2
# RR2
dis ip rou 172.16.1.2 verbose # 172.16.1.2的cost变为1511,tag为2
2.3 ISIS
- AS100内loopback0和互联网接口全部开启ISIS协议,其中PE1、PE2的路由类型为L1,区域号为49.0001,RR1、P1路由类型为L12,区域号为49.0001,ASBR1、ASBR2路由类型为L2,区域号为49.0002。各网元system-id唯一,cost-style为wide,cost值如图2配置(除PE1-RR1之外的逻辑接口外,已预配置)
- AS200内,RR2、P2、ASBR3、ASBR4的loopback0和互联接口全部开启isis协议,IS类型为L2,区域号为49.0003。各网元system-id唯一,cost-style为wide,cost值如图2配置(已预配置)
# PE1/PE2/RR1/P1/ASBR1/ASBR2/ASBR3/ASBR4/RR2/P2
int loo 0
isis enable
int ip 1:g0/0/0:g0/0/1:g0/0/2
isis enable
isis cost xxxx
# 检查-----------------
dis isis int
dis isis peer
# RR1
dis ip rou pro isis # 有1/20/4/5/6的路由
# ASBR3
dis ip rou pro isis # 有8/9/10的路由
- RR2-P2的ISIS链路类型为P2P
# RR2/P2
int g0/0/0
isis circuit-type p2p
- P1的ISIS进程,产生LSP的最大延迟时间是1S,初始延迟为50ms,递增时间为50ms。使能LSP的快速扩散特性。SPF计算间隔为1s,初始延迟为100ms,递增时间为100ms。
# P1
isis 1
timer lsp-generation 1 50 50
flash-flood
timer spf 1 100 100
3. MPLS VPN
- CE1、CE2为VPN1的Hub-CE,PE1、PE2为Hub-CE,CE3、CE4为VPN1的spoke站点,PE3、PE4为SpokePE
- CE4位Multi-VPN-instance CE,CE4的VPN实例VPN1,通过g0/0/1连接PE4
CE4的OSPF需要做vrf-lite
# CE4
ospf 1 router-id 172.17.1.4 vpn-instance VPN1
vpn-instance-capability simple
- 合理设置VPN1参数,使得Spoke站点互访的数据必须经过Hub-CE设备,当CE1-PE1链路断开的情况下,PE1仍然可以学习到CE1的业务路由(PE3上VPN1的RD为100:13,ExportRT为100:1,ImportRT为200:1)
#PE1/PE2
ip vpn-instance HUB
# 如果没有配置RD,则需要自行配置:
# route-distinguisher 100:134/234
vpn-target 200:1 export
ip vpn-instance VPN1
# 如果没有配置RD,则需要自行配置:
route-distinguisher 100:11/12
vpn-target 100:1 200:1 import
# PE3/PE4
ip vpn-instance VPN1
# 如果没有配置RD,则需要自行配置:
# route-distinguisher 100:13/14
vpn-target 100:1 export
vpn-target 200:1 import
# CE4的RD值和PE4相同
- 如图4,CE1通过g0/0/1.1和g0/0/1.2建立直连EBGP邻居接入PE1,CE1通过g0/0/1.2向PE1通告的BGP update中,某些路由的as path中有200。在CE1上,将OSPF路由导入BGP
- 如图4,CE2通过g0/0/1.1和g0/0/1.2建立直连EBGP邻居接入PE2,CE2通过g0/0/1.2向PE2通告的BGP update中,某些路由的as path中有200。在CE2上,将OSPF路由导入BGP
#CE1/CE2
bgp 65000
router-id 172.17.1.1/2
peer 10.2.11/22.2 as 100
peer 10.2.11/22.6 as 100
import ospf 1
#PE1/PE2
bgp 100
router-id 172.16.1.1/20
ipv4-family vpn-instance VPN1
peer 10.2.11/22.1 as 65000
ipv4-family vpn-instance HUB
peer 10.2.11/22.5 as 65000
peer 10.2.11/22.5 allow-as-loop
# 检查-----------------
# 所有设备
dis bgp vpnv4 all peer
- CE3通过OSPF区域1接入PE3通过PE3-CE3的逻辑接口互通,通告CE3的各环回口;CE4通过OSPF区域0接入PE4,通过PE4-CE4的g0/0/1.1接口互通,通告CE4的各环回口
# PE3
ospf 2 vpn-instance VPN1
a 1
network 10.2.33.1 0.0.0.0
# CE3
ospf 1 router-id 172.17.1.3 #不需要绑定VPN
area 1
net 10.2.33.2 0.0.0.0
net 172.17.1.3 0.0.0.0
net 10.3.3.3 0.0.0.0
# PE4
ospf 2 vpn-instance VPN1
a 0
net 10.2.44.1 0.0.0.0
# CE4
ospf 1 vpn-instance VPN1
area 0
net 10.2.44.2 0.0.0.0
net 172.17.1.4 0.0.0.0
net 10.4.4.4 0.0.0.0
# 检查-----------------
# 所有设备
dis ospf peer bri
- 如图3,AS100、AS200内各网元配置MPLS LSR ID,全局使能MPLS,MPLS LDP(已预配置)。AS100、AS200内各直连链路建立LDP邻居。(除PE1-RR1之外的逻辑链路外,已预配置)
如图4,在AS100、AS200内建立IBGP IPv4邻居关系,RR1是PE1、PE2、P1、ASBR1、ASBR2的反射器,RR2是PE3、PE4、P2、ASBR3、ASBR4的反射器。ASBR1-ASBR3、ASBR2-ASBR4建立EBGP IPv4邻居关系(已预配置)。
# MPLS--------------------
# AS100和AS200内所有设备
mpls lsr-id 172.16.1.1/20/3/4/5/6/7/8/9/10/11/2
mpls
mpls ldp
int ip 1:g0/0/0:g0/0/1:g0/0/2 # AS之间的接口只开启mpls
mpls
mpls ldp
# 检查------
dis mpls int
dis mpls ldp int
dis mpls ldp peer
# BGP------------------------
# ---------IBGP
# PE1/PE2/P1/ASBR1/ASBR2:ASBR3/ASBR4/P2/PE3/PE4
bgp 100:200 # 只需要配置RR更新源
router-id 172.16.1.1/20/4/5/6:7/8/10/11/2
peer 172.16.1.3:9 as 100:200
peer 172.16.1.3:9 connect lo 0
# RR1:RR2
bgp 100 # 需要更新源+反射
router-id 172.16.1.3:9
peer 172.16.1.1/20/4/5/6:7/8/10/11/12 as 100:200 # 配置邻居
peer 172.16.1.1/20/4/5/6:7/8/10/11/12 co lo 0 # 配置更新源
peer 172.16.1.1/20/4/5/6:7/8/10/11/12 re # 配置反射器
# ASBR1/ASBR2:ASBR3/ASBR4
bgp 100:200 # ASBR针对RR的下一跳自我
peer 172.16.1.3:9 next-hop-local
# ----------EBGP
# ASBR1/ASBR2/ASBR3/ASBR4
bgp 100/200 # 只需要指定AS号
peer 10.1.57/68.2/1 as 200/100
# RR1/2
bgp 100/200
# 更新源 + ebgp多跳
# 关闭ipv4中的邻居 + vpnv4中undo policy、下一跳不变
peer 172.16.1.9/3 as 200/100
peer 172.16.1.9/3 co lo 0
peer 172.16.1.9/3 ebgp-max-hop # 配置EBGP多跳
ipv4-family unicast
undo peer 172.16.1.9/3 enable # 关闭RR之间的ipv4邻居
ipv4-family vpnv4
undo policy vpn-target # 这个必须undo掉
peer 172.16.1.9/3 enable # RR之间
peer 172.16.1.9/3 next-hop-invariable
# ----------RR2:允许4、5要求中的路由回去
bgp 100/200
ipv4-family vpnv4
peer 172.16.1.3 allow-as-loop # 允许路由回去
# 检查-----------------
# RR1/2:ASBR1/2/3/4
dis bgp peer # 5个邻居建立
- ASBR1-ASBR3,ASBR2-ASBR4之间通过直连接口建立BGP邻居关系。在ASBR上,将ISIS的loopback0路由引入BGP。假设AS100和AS200中的loopback0地址为172.16.1.Y/32。当Y为奇数时,对端设备访问本AS设备的loopback0,优选ASBR1-ASBR3;当Y为偶数时,对端设备访问本AS设备的loopback0,优选ASBR2-ASBR4.保证配有有最好的扩展性
做本题之前先做第9题
# ASBR1/ASBR2/ASBR3/ASBR4
acl 2000
rule permit source 172.16.1.0 0.0.0.254
acl 2001
rule permit source 172.16.1.1 0.0.0.254
# ASBR1/ASBR3
route-policy AB permit node 10
if-match acl 2000
apply cost 200
route-policy AB permit node 20
if-match acl 2001
apply cost 100
bgp 100/200
import-route isis 1 route-policy AB
# ASBR2/ASBR4
route-policy AB permit node 10
if-match acl 2000
apply cost 100
route-policy AB permit node 20
if-match acl 2001
apply cost 200
bgp 100/200
import-route isis 1 route-policy AB
# 检查-----------------
# 4台ASBR
dis bgp rou # 奇数路由走1/3,反之亦然。例如ASBR1上172.16.1.1的下一跳0.0.0.0(默认为ASBR3),172.16.1.2的下一跳就是172.16.1.6
- 在RR2、P2上,ISIS和OSPF双向引入前缀为172.16.0.0/16的主机路由。被引入的协议的cost要继承到引入后的协议中,P2和PE4的loopback0互访走最优路径。配置要求有最好的扩展性
# RR2/P2
ip ip-prefix 172 permit 172.16.0.0 16 greater-equal 32
# RR2
route-policy O2I deny node 10
if-match tag 100
route-policy O2I permit node 20
if-match ip-prefix 172
apply tag 200
route-policy I2O deny node 10
if-match tag 101
route-policy I2O permit node 20
if-match ip-prefix 172
apply cost-type type-1
apply tag 201
route-policy OASE permit node 10
if-match tag 2
apply preference 14
# P2
route-policy O2I deny node 10
if-match tag 201
route-policy O2I permit node 20
if-match ip-prefix 172
apply tag 101
route-policy I2O deny node 10
if-match tag 200
route-policy I2O permit node 20
if-match ip-prefix 172
apply cost-type type-1
apply tag 100
route-policy OASE permit node 10
if-match tag 2
apply preference 14
# RR2/P2
ospf 1
default cost inherit-metric
import-route isis 1 type 1 route-policy I2O
preference ase route-policy OASE
isis 1
import-route ospf 1 inherit-cost route-policy O2I
# 检查-----------------
# RR2/P2
dis route-policy # 此时匹配的路由条数不应该有0
# P2
dis ip rou # 到达PE4(172.16.1.2)的路由应该为O_ASE,接口为g0/0/2,即OSPF的外部路由而不是ISIS的路由
# PE4
dis ip rou pro ospf # 到达P2(172.16.1.10)为g0/0/2接口
- 如图4,各站点通过MPLS BGP VPN 跨域 Option C 方案二,能够相互学习路由。PE1-RR1、PE2-RR1、PE3-RR2、PE4-RR2之间建立MP-IBGP连接的源接口为loopback0。RR1-RR2之间建立MP-EBGP邻居的源接口为loopback0。
# --------路由处理
# RR1/P1:isis的路由泄露
ip ip-prefix 172 permit 172.16.0.0 16 gr 32
isis 1
import isis level-2 into level-1 filter-policy ip-prefix 172
# PE3/PE4:vpn路由的相互引入
bgp 200
ipv4-family vpn-instance VPN1
import ospf 2
ospf 2
import bgp type 1
# ASBR1/2/3/4:将bgp路由导入IGP同时优选IGP,修改bgp优先级
ip ip-prefix 172 permit 172.16.0.0 16 great 32
route-policy 172 permit node 10
if-match ip-prefix 172
apply tag 1234
route-policy AB deny node 5 # 重要
if-match tag 1234
isis
import-route bgp inherit-cost route-policy 172
bgp 100/200
preference 12 255 255
# -------vpnv4邻居
# PE1/2/3/4
bgp 100 # PE上只需要en
ipv4-family vpnv4
peer 172.16.1.3/9 enable
# RR1:RR2
bgp 100/200 # RR上需要en + re + ne
ipv4-family vpnv4
peer 172.16.1.1/20:11/2 enable # RR和PE之间
peer 172.16.1.1/20:11/2 re
peer 172.16.1.1/20:11/2 next-hop-invariable
# -----------标签能力(只在ASBR之间)
# ASBR1/2/3/4
mpls
lsp-trigger bgp-label-route ip-prefix 172
route-policy MPLS permit no 10
apply mpls-label
bgp 100/200 # ASBR之间
peer 10.1.57/68.2/1 route-policy MPLS export
peer 10.1.57/68.2/1 label-route-capability
# 检查-----------------
# RR1/P1
dis ip rou pro isis # 是否学习到isis level2的路由,主要是192.168.1.11/2
# RR1/2
dis bgp vpnv4 all peer #各有3个邻居
dis bgp peer # 查看两个RR之间的邻居
# RR2/PE3/PE4:RR1/PE1/PE2
dis bgp vpnv4 all rou # 是否学到CE1/2/3/4上的路由10.3.1.0、10.3.2.0、10.3.3.3、10.4.4.4
- 在CE1、CE2上配置EBGP的协议优先级为120
- 在CE1、CE2上面,将BGP导入OSPF。保证配置有最好的扩展性
# CE1/2:修改eBGP的优先级
bgp 65000
preference 120 255 255
ospf 1
import bgp type 1 # 引入之前先做PE1/2上面的soo
# PE1/PE2:为了防环,需要配置soo属性
bgp 100
ipv4-family vpn-instance HUB
peer 10.2.11/22.5 soo 100:12
ipv4-family vpn-instance VPN1
peer 10.2.11/22.1 soo 100:12
- 在PE3、PE4上修改BGP local preference属性。实现CE3、CE4访问直连的10.3.x.0/24网段时,若x为奇数,PE3、PE4优选下一跳为PE1,若x为偶数,PE3、PE4优选下一跳为PE2,不用考虑来回路径是否一致
# PE3/4
acl 2000
rule permit source 10.3.0.0 0.0.254.0
acl 2001
rule permit source 10.3.1.0 0.0.254.0
ip ip-prefix NH-PE1 permit 172.16.1.1 32
ip ip-prefix NH-PE2 permit 172.16.1.20 32
route-policy AB permit node 10
if-match acl 2000
if-match ip next-hop ip-prefix NH-PE2
apply local-preference 200 # 本地优先级越大越优,cost越小越优
route-policy AB permit node 20
if-match acl 2001
if-match ip next-hop ip-prefix NH-PE1
apply local-preference 200
route-policy AB permit node 30 # 放行其他路由
bgp 200
ipv4-family vpnv4
peer 172.16.1.9 route-policy AB import # 从反射器来的路由应用上面的条件
# 检查-----------------
# PE3/4
dis bgp vpnv4 all rou #10.3.1.0下一跳为172.16.1.1,本地优先级为200;10.3.2.0下一条为172.16.1.20,本地优先级为200
# 整个大题最后的测试
# CE3/4
tracert -a 10.3.3.3 10.4.4.4 # CE4:9hop
tracert -a 10.3.3.3 10.3.1.10 # PC1:8hop
tracert -a 10.3.3.3 10.3.2.20 # PC2:8hop
# CE4
tracert -vpn-instance VPN1 -a 10.4.4.4 10.3.3.3 # CE3:9hop
tracert -vpn-instance VPN1 -a 10.4.4.4 10.3.1.10 # PC1:8hop
tracert -vpn-instance VPN1 -a 10.4.4.4 10.3.2.20 # PC2:8hop
4. Feature
4.1 HA
- CE1配置静态的默认路由访问ISP,下一跳IP为100.0.1.2.该默认路由要与CE1-ISP链路的BFD状态绑定(CE1的对端设备不支持BFD),感知故障的时间要小于150ms
# CE1
bfd # 开启全局bfd
bfd huawei bind peer-ip 100.0.1.2 int g2/0/1 one-arm-echo
discriminator local 1 # 配置本地设备标示为1
min-echo-rx-interval 40 # 40的3倍小于150
commit
q
ip route-static 0.0.0.0 0.0.0.0 100.0.1.2 track bfd-session huawei
# 检测---------
dis bfd session all
- CE2配置静态的默认路由访问ISP,下一跳IP为200.0.2.2.该默认路由要与CE2-ISP链路的NQA ICMP测试绑定,间隔5S测试执行1次
# CE2
nqa test-instance huawei huawei
test-type icmp
destination-address ipv4 200.0.2.2
frequency 5
start now
ip route-static 0.0.0.0 0.0.0.0 200.0.2.2 track nqa huawei huawei
# 检测---------
dis nqa history
- CE3、CE4能够通过默认路由访问ISP。CE1-ISP的链路断开时,CE1仍能访问ISP;CE2-ISP的链路断开时,CE2仍能访问ISP
# CE1:CE2
ospf 1
default-route-advertise
bgp 65000
network 0.0.0.0
int g0/0/2.10:20
# 分别在自己的master VRRP上针对去往ISP和对方的链路开启track
vrrp vrid 1:2 track int g0/0/0 reduced 15
vrrp vrid 1:2 track int g2/0/1:2 reduced 15
# PE3/PE4
ospf 2
default-route-advertise
# 检测--------
# CE3
dis ip rou # 查看是否有默认路由
# CE4
dis ip rou vpn-instance VPN1 # 查看是否有默认路由
4.2 NAT
- 在CE1上,10.3.0.0/16(不含10.3.2.10)的内网地址转换为102.0.1.2-102.0.1.6,通过g2/0/1访问ISP。 在CE2上,10.3.0.0/16(不含10.3.2.10)的内网地址转换为102.0.1.2-102.0.1.6,通过g2/0/2访问ISP。 Server1拥有单独的公网地址102.0.1.1,对ISP提供FTP和HTTP服务。
# CE1/CE2
acl 2000
rule deny source 10.3.2.10 0
rule permit source 10.3.0.0 0.0.255.255
nat address-group 1 102.0.1.2 102.0.1.6
int g2/0/1:2
nat outbound 2000 address-group 1
nat server protocol tcp global 102.0.1.1 www inside 10.3.2.10 www
nat server protocol tcp global 102.0.1.1 ftp inside 10.3.2.10 ftp
4.3 Qos
- 在CE1的g2/0/1、CE2的g2/0/2的出方向,周一至周五的8:00-18:00,对TCP目的端口号为6881-6999的流量,承诺的平均速率为1Mbps
# CE1/CE2
time-range WORKING 8:00 to 18:00 working-day
acl 3000
rule permit tcp desination-port range 6881 6999 timer-range WORKING
traffic classifiter HUAWEI
if-match acl 3000
traffic behavior HUAWEI
car cir 1000
traffic policy HUAWEI
classifier HUAWEI behavior HUAWEI
interface g2/0/1:2
traffic-policy HUAWEI outbound
# 检查-----
dis traffic policy user-defied
5. IPv6
5.1 基本配置
- 所有相关设备接口的IPv6地址,按照图6配置(除PE1-RR1的逻辑接口外,已预配置)
在WAN那道题中已经配置
5.2 IPv6 ISIS
- 如图6,PE1、PE2、RR1、P1、ASBR1、ASBR2运行isis协议,各直连网段通告入isis,配置各链路cost
# PE1/PE2/RR1/P1/ASBR1/ASBR2
ipv6
isis
ipv6 enable topology ipv6
int loo 0
isis ipv6 enable
int ip 1:g0/0/0:g0/0/2
isis ipv6 enable
isis ipv6 cost xx
# RR1/P1:ISIS路由渗透
ip ip-prefix 66 permit 2000:EAD8:99EF:CC3E:B2AD:9EFF:A2DD:DCA0 128 gr 128
isis 1
ipv6 import-route isis level-2 into level-1 filter-policy ipv6-prefix 66
# 检查---------
dis ipv6 rou pro isis # 可以查看到AS100内所有其他设备环回口路由,建议在PE2上查看
5.3 IPv6 Multicast
- 如图7,AS100中,相邻设备建立PIM IPv6 SM的邻居关系。PE1的E0/0/0静态加入组FF1E::AA
# PE1/PE2/RR1/P1/ASBR1/ASBR2
multicast ipv6 routing-enabel
int loo 0
pim ipv6 sm
int ip 1:g0/0/1:g0/0/2:g0/0/3
ipv6 enable
pim ipv6 sm
# PE1
int E0/0/0
ipv6 enable
ipv6 addr 3000:E85A:8CA2:BF40:C45A:89EE:CBDF:ADD1/112
isis ipv6 enable
pim ipv6 sm # 先开启
pim ipv6 silent # 保障安全
mld enable # 后开启
mld static-group FF1E::AA # 静态加组
- ASBR1的loopback0、ASBR2的loopback0为C-BSR且都为FF1E::/112的C-RP。ASBR1的loopback0成为BSR,ASBR2的loopback0成为FF1E::/112的RP
# ASBR1/ASBR2
acl ipv6 2000
rule permit source FF1E::AA/112 # 定义RP的服务组范围
acl ipv6 3000
rule permit ipv6 source 2000:EAD8:99EF:CC3E:B2AD:9EFF:A2DD:DCA5/128 destination FF1E::AA/112
rule permit ipv6 source 2000:EAD8:99EF:CC3E:B2AD:9EFF:A2DD:DCA6/128 destination FF1E::AA/112
# ASBR1/ASBR2 :bsr优先级是越大越优 rp优先级是越小越优
pim-ipv6
c-bsr priority 200/100
c-bsr 2000:EAD8:99EF:CC3E:B2AD:9EFF:A2DD:DCA5/6
c-rp 2000:EAD8:99EF:CC3E:B2AD:9EFF:A2DD:DCA5/6 group-po 2000 pri 200/100
crp-policy 3000
# 检查--------------
# PE1
dis pim ipv6 bsr-info # BSR地址为xxxxxxDCA5,优先级为200,C-RP数量2个
dis pim ipv6 rp-info # RP地址为xxxxxxDCA5,优先级为200;下一个RP地址为xxxxxxDCA6,优先级为100
- 无论哪个C-RP成为RP,都要确保PIM IPv6域生成(*,G)表项无次优路径
# PE1
pim-ipv6
spt-switch-threshold infinity
#ASBR1/2
dis pim ipv6 rou # 只有(*,FF1E::AA)