一、组网
二、要求
PC6(vlan 10内PC)访问1.1.1.1走JR-1——CORE1——MSR到1.1.1.1
PC7(vlan 20内PC)访问1.1.1.1走JR-2——CORE2——MSR到1.1.1.1
链路故障时切换路线,来回路径一致
三、配置步骤
SR
bfd echo-source-ip 10.10.10.10
#
track 1 bfd echo interface GigabitEthernet0/0 remote ip 172.16.1.2 local ip 172.16.1.1
#
track 2 bfd echo interface GigabitEthernet0/1 remote ip 172.16.1.6 local ip 172.16.1.5
ip unreachables enable
ip ttl-expires enable
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
interface GigabitEthernet0/0
port link-mode route
combo enable copper
ip address 172.16.1.1 255.255.255.252
#
interface GigabitEthernet0/1
port link-mode route
combo enable copper
ip address 172.16.1.5 255.255.255.252
ip route-static 10.133.10.0 24 172.16.1.2 track 1
ip route-static 10.133.10.0 24 172.16.1.6 preference 65
ip route-static 10.133.20.0 24 172.16.1.6 track 2
ip route-static 10.133.20.0 24 172.16.1.2 preference 65
CORE1
bfd echo-source-ip 10.10.10.10
#
track 1 bfd echo interface GigabitEthernet1/0/5 remote ip 172.16.1.1 local ip 172.16.1.2
ip unreachables enable
ip ttl-expires enable
#
dhcp enable
vlan 10
#
vlan 20
#
stp region-configuration
region-name h3c
revision-level 10
instance 10 vlan 10
instance 20 vlan 20
active region-configuration
#
stp instance 10 root primary
stp instance 20 root secondary
stp global enable
#
dhcp server ip-pool 13310
gateway-list 10.133.10.254
network 10.133.10.0 mask 255.255.255.0
address range 10.133.10.1 10.133.10.125
dns-list 223.5.5.5
expired day 0 hour 6
#
dhcp server ip-pool 13320
gateway-list 10.133.20.254
network 10.133.20.0 mask 255.255.255.0
address range 10.133.20.1 10.133.20.125
dns-list 223.5.5.5
expired day 0 hour 6
#
interface Bridge-Aggregation1
port link-type trunk
port trunk permit vlan all
interface Vlan-interface10
ip address 10.133.10.252 255.255.255.0
vrrp vrid 1 virtual-ip 10.133.10.254
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode delay 5
vrrp vrid 1 track 1 priority reduced 40
dhcp server apply ip-pool 13310
#
interface Vlan-interface20
ip address 10.133.20.252 255.255.255.0
vrrp vrid 1 virtual-ip 10.133.20.254
vrrp vrid 1 preempt-mode delay 5
dhcp server apply ip-pool 13320
interface GigabitEthernet1/0/5
port link-mode route
combo enable fiber
ip address 172.16.1.2 255.255.255.252
#
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
port link-aggregation group 1
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
port link-aggregation group 1
interface GigabitEthernet1/0/3
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
#
interface GigabitEthernet1/0/4
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
CORE2
bfd echo-source-ip 11.11.11.11
#
track 1 bfd echo interface GigabitEthernet1/0/5 remote ip 172.16.1.5 local ip 172.16.1.6
#
ip unreachables enable
ip ttl-expires enable
#
dhcp enable
vlan 10
#
vlan 20
#
stp region-configuration
region-name h3c
revision-level 10
instance 10 vlan 10
instance 20 vlan 20
active region-configuration
#
stp instance 10 root secondary
stp instance 20 root primary
stp global enable
#
dhcp server ip-pool 13310
gateway-list 10.133.10.254
network 10.133.10.0 mask 255.255.255.0
address range 10.133.10.126 10.133.10.250
dns-list 223.5.5.5
expired day 0 hour 6
#
dhcp server ip-pool 13320
gateway-list 10.133.20.254
network 10.133.20.0 mask 255.255.255.0
address range 10.133.20.126 10.133.20.250
dns-list 223.5.5.5
expired day 0 hour 6
#
interface Bridge-Aggregation1
port link-type trunk
port trunk permit vlan all
#
interface Vlan-interface10
ip address 10.133.10.253 255.255.255.0
vrrp vrid 1 virtual-ip 10.133.10.254
vrrp vrid 1 preempt-mode delay 5
dhcp server apply ip-pool 13310
#
interface Vlan-interface20
ip address 10.133.20.253 255.255.255.0
vrrp vrid 1 virtual-ip 10.133.20.254
vrrp vrid 1 priority 120
vrrp vrid 1 preempt-mode delay 5
vrrp vrid 1 track 1 priority reduced 40
dhcp server apply ip-pool 13320
#
interface GigabitEthernet1/0/5
port link-mode route
combo enable fiber
ip address 172.16.1.6 255.255.255.252
#
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
port link-aggregation group 1
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
port link-aggregation group 1
#
interface GigabitEthernet1/0/3
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
#
interface GigabitEthernet1/0/4
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
JR-1
#
ip unreachables enable
ip ttl-expires enable
vlan 10
#
vlan 20
#
stp region-configuration
region-name h3c
revision-level 10
instance 10 vlan 10
instance 20 vlan 20
active region-configuration
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
#
interface GigabitEthernet1/0/3
port link-mode bridge
port access vlan 10
combo enable fiber
stp edged-port
JR-2
#
ip unreachables enable
ip ttl-expires enable
vlan 10
#
vlan 20
#
stp region-configuration
region-name h3c
revision-level 10
instance 10 vlan 10
instance 20 vlan 20
active region-configuration
#
stp global enable
#
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
#
interface GigabitEthernet1/0/2
port link-mode bridge
port link-type trunk
port trunk permit vlan all
combo enable fiber
#
interface GigabitEthernet1/0/3
port link-mode bridge
port access vlan 20
combo enable fiber
stp edged-port
四、查看
PC6 IP地址
PC6访问1.1.1.1
关闭核心交换机的1/0/5
线路已切换
五、注意点
# 配置 BFD echo 报文方式的 Source IP,IP 地址可以任意指定,不要与实际接口地址相同。
bfd echo-source-ip 10.10.10.10