![Huawei S6700 Series Скачать руководство пользователя страница 187](http://html.mh-extra.com/html/huawei/s6700-series/s6700-series_configuration-manual_169517187.webp)
[SwitchE]
bgp 20
[SwitchE-bgp]
peer 10.2.1.1 as-number 10
[SwitchE-bgp]
ipv4-family unicast
[SwitchE-bgp-af-ipv4]
network 10.3.1.0 30
[SwitchE-bgp-af-ipv4]
quit
Step 6
Set the cost of OSPF on Switch C.
[SwitchC]
interface vlanif 30
[SwitchC-Vlanif30]
ospf cost 2
[SwitchC-Vlanif30]
quit
[SwitchC]
interface vlanif 20
[SwitchC-Vlanif20]
ospf cost 2
[SwitchC-Vlanif20]
quit
NOTE
After the cost of OSPF on Switch C is set to 2, Switch A chooses only Switch B as the intermediate router
to the network segment 10.2.1.0. Switch C becomes the backup router of Switch B.
# View the routing table of Switch A. As shown in the routing table, the route to the network
segment 10.3.1.0 can be learned through BGP, and the outgoing interface is Vlanif10.
[SwitchA]
display ip routing-table
Route Flags: R - relied, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 16 Routes : 17
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
2.2.2.2/32 OSPF 10 3 D 10.1.1.2 Vlanif10
4.4.4.0/24 BGP 255 0 RD 4.4.4.4 Vlanif10
4.4.4.4/32 OSPF 10 3 D 10.1.1.2 Vlanif10
5.5.5.0/24 BGP 255 0 RD 10.2.1.2 Vlanif10
10.1.1.0/30 Direct 0 0 D 10.1.1.1 Vlanif10
10.1.1.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.1.1.2/32 Direct 0 0 D 10.1.1.2 Vlanif10
10.1.2.0/30 Direct 0 0 D 10.1.2.1 Vlanif20
10.1.2.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.1.2.2/32 Direct 0 0 D 10.1.2.2 Vlanif20
10.1.3.0/30
OSPF
10
2
D
10.1.1.2
Vlanif10
10.1.3.1/32 BGP 255 0 RD 4.4.4.4 Vlanif10
10.1.4.0/30 OSPF 10 3 D 10.1.1.2 Vlanif10
OSPF 10 3 D 10.1.2.2 Vlanif20
10.1.4.1/32 BGP 255 0 RD 4.4.4.4 Vlanif10
10.2.1.0/30 BGP 255 0 RD 4.4.4.4 Vlanif10
10.2.1.2/32 BGP 255 0 RD 4.4.4.4 Vlanif10
10.3.1.0/30 BGP 255 0 RD 4.4.4.4 Vlanif10
# View the routing table of Switch B.
[SwitchB]
display ip routing-table
Route Flags: R - relied, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 15 Routes : 15
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
1.1.1.1/32 OSPF 10 2 D 10.1.1.1 Vlanif10
4.4.4.0/24 BGP 255 0 RD 10.1.3.2 Vlanif40
4.4.4.4/32 OSPF 10 2 D 10.1.3.2 Vlanif40
5.5.5.0/24 BGP 255 0 RD 10.2.1.2 Vlanif40
10.1.1.0/30 Direct 0 0 D 10.1.1.2 Vlanif10
10.1.1.1/32 Direct 0 0 D 10.1.1.1 Vlanif10
10.1.1.2/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.1.2.0/30 OSPF 10 2 D 10.1.1.1 Vlanif10
10.1.3.0/30 Direct 0 0 D 10.1.3.1 Vlanif40
10.1.3.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
10.1.3.2/32 Direct 0 0 D 10.1.3.2 Vlanif40
10.1.4.0/30 OSPF 10 2 D 10.1.3.2 Vlanif40
10.1.4.1/32 BGP 255 0 RD 10.1.3.2 Vlanif40
S6700 Series Ethernet Switches
Configuration Guide - IP Routing
4 OSPF Configuration
Issue 01 (2012-03-15)
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
168