思科路由器BFD配置命令详解.pdf
The BFD - Static Route Support feature enables association of static routes with a static BidirectionalForwarding Detection (BFD) configuration in order to monitor static route reachability using theconfigured BFD session. Depending on status of the BFD session, static routes are added to or removedfrom the Routing Information Base (RIB).Unlike dynamic routing protocols, such as OSPF and BGP, static routing has no method of peerdiscovery. Therefore, when BFD is configured, the reachability of the gateway is completely dependenton the state of the BFD session to the specified neighbor. Unless the BFD session is up, the gateway forthe static route is considered unreachable, and therefore the affected routes will not be installed in theappropriate RIB.For a BFD session to be successfully established, BFD must be configured on the interface on the peerand there must be a BFD client registered on the peer for the address of the BFD neighbor. When aninterface is used by dynamic routing protocols, the latter requirement is usually met by configuring therouting protocol instances on each neighbor for BFD. When an interface is used exclusively for staticrouting, this requirement must be met by configuring static routes on the peers.If a BFD configuration is removed from the remote peer while the BFD session is in the up state, theupdated state of the BFD session is not signaled to IPv4 static. This will cause the static route to remainin the RIB. The only workaround is to remove the IPv4 static BFD neighbor configuration so that the staticroute no longer tracks BFD session state. Also, if you change the encapsulation type on a serial interfaceto one that is unsupported by BFD, BFD will be in a down state on that interface. The workaround is toshut down the interface, change to a supported encapsulation type, and then reconfigure BFD.A single BFD session can be used by an IPv4 static client to track the reachability of next hops through aspecific interface. You can assign a BFD group for a set of BFD-tracked static routes. Each group musthave one active static BFD configuration, one or more passive BFD configurations, and thecorresponding static routes to be BFD-tracked. Nongroup entries are BFD-tracked static routes for whicha BFD group is not assigned. A BFD group must accommodate static BFD configurations that can be partof different VRFs. Effectively, the passive static BFD configurations need not be in the same VRF as thatof the active configuration.For each BFD group, there can be only one active static BFD session. You can configure the active BFDsession by adding a static BFD configuration and a corresponding static route that uses the BFDconfiguration. The BFD session in a group is created only when there is an active static BFDconfiguration and the static route that uses the static BFD configuration. When the active static BFDconfiguration or the active static route is removed from a BFD group, all the passive static routes arewithdrawn from the RIB. Effectively, all the passive static routes are inactive until an active static BFDconfiguration and a static route to be tracked by the active BFD session are configured in the group.Similarly, for each BFD group, there can be one or more passive static BFD configurations and theircorresponding static routes to be BFD-tracked. Passive static session routes take effect only when theactive BFD session state is reachable. Though the active BFD session state of the group is reachable,the passive static route is added to the RIB only if the corresponding interface state is up. When apassive BFD session is removed from a group, it will not affect the active BFD session if one existed, orthe BFD group reachability status.How to Configure BFD - Static Route SupportHow to Configure BFD - Static Route SupportConfiguring BFD - Static Route SupportConfiguring BFD - Static Route SupportConfiguring BFD - Static Route SupportPerform this task to configure BFD support for static routing. Repeat the steps in this procedure on eachBFD neighbor. For more information, see the “Example: Configuring BFD Support for Static Routing”section.SUMMARY STEPSSUMMARY STEPS1. 1.enableenable2. 2.configureconfigure terminalterminal3. 3.interfaceinterface type number4. 4.ipip addressaddress ip-address mask5. 5.bfdbfd intervalinterval milliseconds min_rxmin_rx milliseconds multipliermultiplier interval-multiplier6. 6.exitexit7. 7.ipip routeroute staticstatic bfdbfd interface-type interface-number ip-address groupgroup group-name passipassiveve8. 8.ipip routeroute vrfvrf vrf-name prefix mask ip-address | interface-type interface-number ip-address dhcpdhcp distance namename next-hop-name permanentpermanent | tracktrack number tagtag tag9. 9.exitexit10.10.showshow ipip staticstatic routeroute11.11.showshow ipip staticstatic routeroute bfdbfdDETAILED STEPSDETAILED STEPSCommand or ActionCommand or ActionPurposePurposeSteSteenableenablep 1p 1Example:Example:Enables privileged EXECmode.Device enableSteSteconfigureconfigure terminalterminalp 2p 2Enter yourpassword ifprompted.Enters globalconfiguration mode.Example:Example:Device# configure terminalSteSteinterfaceinterface type numberp 3p 3Example:Example:Configures an interfaceand enters interfaceconfiguration mode.Device(config)# interface serial 2/0SteSteipip addressaddress ip-address maskp 4p 4Example:Example:Configures an IP addressfor the interface.Device(config-if)# ip address10.201.201.1 255.255.255.0SteStebfdbfd intervalinterval milliseconds min_rxmin_rx milliseconds multimultiEnables BFD on thep 5p 5plierplier interval-multiplierinterface.Example:Example:Device(config-if)# bfd interval 500min_rx 500 multiplier 5SteSteexitexitp 6p 6Example:Example:Exits interfaceconfiguration mode andreturns to globalconfiguration mode.Device(config-if)# exitSteSteipip routeroute staticstatic bfdbfd interface-type interface-number iSpecifies a static routep 7p 7p-address groupgroup group-name passivepassiveBFD neighbor.Theinterface-type,interface-number,Example:Example:Device(config)# ip route static bfdserial 2/0 10.1.1.1 group group1and ip-addressarguments arerequired becausepassiveBFD support existsonly for directlyconnectedneighbors.SteSteipip routeroute vrfvrf vrf-name prefix mask ip-address | inteSpecifies a static routep 8p 8rface-type interface-number ip-addressdhcpdhcpBFD neighbor.distancenamename next-hop-namepermanentpermanent | tracktrack number tagtag tagExample:Example:Device(config)# ip route 10.0.0.0255.0.0.0SteSteexitexitp 9p 9Example:Example:Exits global configurationmode and returns toprivileged EXEC mode.Device(config)# exitSteStep 1p 10 0showshow ipip staticstatic routerouteExample:Example:(Optional) Displays staticroute databaseinformation.Device# show ip static routeSteSteshowshow ipip staticstatic routeroute bfdbfdp 11p 11Example:Example:Device# show ip static route bfd(Optional) Displaysinformation about thestatic BFD configurationfrom the configured BFDgroups and nongroupentries.Configuration Examples for BFD - Static Route SupportConfiguration Examples for BFD - Static Route SupportExample: Configuring BFD - Static Route SupportExample: Configuring BFD - Static Route SupportExample: Configuring BFD - Static Route SupportIn the following example, the network consists of Device A and Device B. Serial interface 2/0 on Device Ais connected to the same network as serial interface 2/0 on Device B. In order for the BFD session tocome up, Device B must be configured.Device ADevice Aconfigure terminalinterface Serial 2/0ip address 10.201.201.1 255.255.255.0bfd interval 500 min_rx 500 multiplier 5ip route static bfd Serial 2/0 10.201.201.2ip route 10.0.0.0 255.0.0.0 Serial 2/0 10.201.201.2Device BDevice Bconfigure terminalinterface Serial 2/0ip address 10.201.201.2 255.255.255.0bfd interval 500 min_rx 500 multiplier 5ip route static bfd Serial 2/0 10.201.201.1ip route 10.1.1.1 255.255.255.255 Serial 2/0 10.201.201.1Note that the static route on Device B exists solely to enable the BFD session between 10.201.201.1 and10.201.201.2. If there is no useful static route that needs to be configured, select a prefix that will notaffect packet forwarding, for example, the address of a locally configured loopback interface.In the following example, there is an active static BFD configuration to reach 209.165.200.225 throughEthernet interface 0/0 in the BFD group testgroup. As soon as the static route is configured that is trackedby the configured static BFD, a single hop BFD session is initiated to 209.165.200.225 through Ethernetinterface 0/0. The prefix 10.0.0.0/8 is added to the RIB if a BFD session is successfully established.configure terminalip route static bfd Ethernet 0/0 209.165.200.225 group testgroupip route 10.0.0.0 255.255.255.224 Ethernet 0/0 209.165.200.225In the following example, a BFD session to 209.165.200.226 through Ethernet interface 0/0.1001 ismarked to use the group testgroup. That is, this configuration is a passive static BFD. Though there arestatic routes to be tracked by the second static BFD configuration, a BFD session is not triggered for209.165.200.226 through Ethernet interface 0/0.1001. The existence of the prefixes 10.1.1.1/8 and10.2.2.2/8 is controlled by the active static BFD session (Ethernet interface 0/0 209.165.200.225).configure terminalip route static bfd Ethernet 0/0 209.165.200.225 group testgroupip route 10.0.0.0 255.255.255.224 Ethernet 0/0 209.165.200.225ip route static bfd Ethernet 0/0.1001 209.165.200.226 grouptestgroup passiveip route 10.1.1.1 255.255.255.224 Ethernet 0/0.1001209.165.200.226ip route 10.2.2.2 255.255.255.224 Ethernet 0/0.1001209.165.200.226