21 February 2015

IOS-XR Basic Routing

+=== create a IPv4 static route

XRX(config)# router static
XRX(config-static)# address-family ipv4 unicast
XRX(config-static-afi)# 10.0.0.0/24 11.0.0.1
XRX(config-static-afi)# commit

XRX# show route
XRX# show run router static

+=== create a IPv6 static route

XRX(config)# router static
XRX(config-static)# address-family ipv6 unicast
XRX(config-static-afi)# fec0:11::/64 fec0:11::1
XRX(config-static-afi)# commit

XRX# show route ipv6
XRX# show run router static

+=== OSPF configuration

XRX(config)# router ospf 1
XRX(config-ospf)# area 0
XRX(config-ospf-ar)# interface lo0
XRX(config-ospf-ar-if)# interface gi 0/0/0/0
XRX(config-ospf-ar-if)# interface gi 0/0/0/1
XRX(config-ospf-ar-if)# area 1
XRX(config-ospf-ar)# interface lo1

XRX# show ospf interface brief
XRX# show ospf neigh
XRX# show route ospf

IOS XR’s configuration is 100% hierarchical. For example, all features and options for a routing protocol reside within the routing protocol configuration. Parameters that are set at the global process for the routing protocol are inherited by the more specific components of the protocol. Setting the OSPF cost parameter globally will set the cost for all interfaces on a router.

XRX(config)# router ospf 1
XRX(config-ospf)# cost 100
XRX(config-ospf)# commit

[*] Area Cost Configuration

XRX(config)# router ospf 1
XRX(config-ospf)# area 0
XRX(config-ospf-ar)# cost 50
XRX(config-ospf-ar)# commit

XRX# show ospf interface brief


+=== iBGP configuration

XRX(config)# router bgp 200
XRX(config-bgp)# address-family ipv4 unicast
XRX(config-bgp-af)# network 19.18.1.1/32
XRX(config-bgp-af)# exit
XRX(config-bgp)# neighbor 100.0.0.1
XRX(config-bgp-nbr)# remote-as 200
XRX(config-bgp-nbr)# update-source lo0
XRX(config-bgp-nbr)# address-family ipv4 unicast
XRX(config-bgp-nbr-af)# next-hop self

XRX# show bgp ipv4 unicast summary
XRX# show bgp ipv4 unicast

+=== eBGP configuration

XRX(config)# router bgp 100
XRX(config-bgp)# neighbor 172.16.14.4
XRX(config-bgp-nbr)# remote-as 200
XRX(config-bgp-nbr)# address-family ipv4 unicast

XRX# show bgp ipv4 unicast summary
XRX# show bgp neighbor 172.16.14.4

Note: With the above configuration, you will be able to bring the eBGP neighborship up but there will be no route exchange between the two peers. The reason behind this is, In IOS XR External BGP (eBGP) neighbors must have an inbound and outbound policy configured. If no policy is configured, no routes are accepted from the neighbor, nor are any routes advertised to it. This added security measure ensures that routes cannot accidentally be accepted or advertised in the case of a configuration omission error.

XRX(config)# route-policy PASS-ALL
XRX(config-rpl)# pass
XRX(config-rpl)# end-policy
XRX(config)# router bgp 100
XRX(config-bgp)# neighbor 172.16.14.4
XRX(config-bgp-nbr)# address-family ipv4 unicast
XRX(config-bgp-nbr-af)# route-policy PASS-ALL in
XRX(config-bgp-nbr-af)# route-policy PASS-ALL out

XRX# show bgp

IOS XR Route-Policy allows you to perform conditional filtering to help filter the routes. This can be done using the If-Else statement under the route-policy. The if statement matches if there is any prefix which has AS 65000 in the AS-PATH, then it will drop the prefix else will allow the prefix. Example below provides the relevant configuration.

XRX(config)#route-policy BLOCK-AS65000
XRX(config-rpl)# if as-path in (ios-regex '_65000_') then
XRX(config-rpl-if)# drop
XRX(config-rpl-if)# else
XRX(config-rpl-else)# pass
XRX(config-rpl-else)# endif
XRX(config-rpl)# end-policy
XRX(config)# router bgp 100
XRX(config-bgp)# neighbor 172.16.14.4
XRX(config-bgp-nbr)# address-family ipv4 unicast
XRX(config-bgp-nbr-af)# route-policy BLOCK-AS65000 in

IOS-XR Config Guides

biOos

No comments: