Showing posts with label IOS-XR. Show all posts
Showing posts with label IOS-XR. Show all posts

29 June 2015

BGP Backdoor Networks

BGP uses an administrative distance (AD) of 20 for eBGP routes and 200 for iBGP routes and works well in almost all network designs. Occasionally, a route learned via an interior gateway protocol (IGP) needs to take preference over a route learned via eBGP. This can be accomplished using the BGP backdoor network feature. A BGP backdoor network is treated as a local network and raises the AD for the eBGP-learned route from 20 to 200, and the router prohibits the advertisement of the backdoor network to eBGP peers.

BGP backdoor networks use the BGP address family configuration command network network mask subnet-mask backdoor on IOS routers, and the command network network/prefix-length backdoor on IOS XR routers. The following scenario provides a use case for the BGP backdoor network feature.

Figure below illustrates a topology where AS200 and AS 400 connect via AS300 and are mutually redistributing OSPF into BGP. AS200 and AS300 plan to connect to each other through AS300 so that servers in the 10.1.1.0/24 network can communicate with servers in the 10.5.5.0/24 network.


AS200 and AS 400 Connectivity


The throughput between the AS200 and AS 400 is insufficient, so a dedicated link (10.24.1.0/24) between XR2 and R4 is established, as shown in Figure below. Packets between AS200 and AS 400 still route through AS300 because AS200 routes are learned via eBGP with an AD of 20, which is lower than the AD advertised by the OSPF direct path. The AD for routes is shown in brackets.

Suboptimal Routing Between AS200 and AS 400


XR2 and R4 configure the remote networks as BGP backdoor networks. This raises the AD of the backdoor networks to 200, which is higher than the AD of OSPF. XR2 and R4 then install the remote networks into the RIB with the OSPF path. Figure below provides the topology and routing table for XR2 and R4. Notice that the next hop for the remote networks uses the 10.24.1.0/24 network instead of routing traffic through AS300.


BGP Backdoor Network Topology


The example demonstrates the BGP backdoor network configuration. XR2 configures the AS 400 networks (10.45.1.0/24 and 10.5.5.0/24) and R4 configures AS200 networks (10.1.1.0/24 and 10.12.1.0/24) as BGP backdoor networks.


XR2
router bgp 200
 bgp router-id 192.168.2.2
 address-family ipv4 unicast
  network 10.1.1.0/24
  network 10.5.5.0/24 backdoor
  network 10.12.1.0/24
  network 10.45.1.0/24 backdoor
  redistribute ospf 1
!
neighbor 10.23.1.3
 remote-as 300
 address-family ipv4 unicast
  route-policy PASSALL in
  route-policy PASSALL out

R4
router bgp 400
 bgp log-neighbor-changes
 neighbor 10.34.1.3 remote-as 300
!
address-family ipv4
 network 10.1.1.0 mask 255.255.255.0 backdoor
 network 10.5.5.0 mask 255.255.255.0
 network 10.12.1.0 mask 255.255.255.0 backdoor
 network 10.45.1.0 mask 255.255.255.0
 redistribute ospf 1
 neighbor 10.34.1.3 activate
exit-address-family




biOos

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

15 February 2015

IOS XR - EIGRP IPV6 Overview


[IOS-XR config]

hostname XRv.lab.com
domain name lab.com
!
interface GigabitEthernet0/0/0/0
 ipv6 address 2001:db8:6783:88::1/64
 negotiation auto
!
router eigrp 1
 address-family ipv6
  router-id 5.5.5.5
  log-neighbor-changes
  interface GigabitEthernet0/0/0/0
  !
 !
!
end

RP/0/0/CPU0:XRv.lab.com# show ipv6 neighbors
IPv6 Address                              Age Link-layer Addr State Interface            Location
2001:db8:6783:88::2                      83   cc01.1638.0000 REACH Gi0/0/0/0            0/0/CPU0
fe80::ce01:16ff:fe38:0                   73   cc01.1638.0000 REACH Gi0/0/0/0            0/0/CPU0
[Mcast adjacency]                           - 0000.0000.0000 REACH Gi0/0/0/0            0/0/CPU0

RP/0/0/CPU0:XRv.lab.com# show protocols ipv6
Routing Protocol: EIGRP, instance 1
 Default context AS: 1, Router ID: 5.5.5.5
  Address Family: IPv6
   Logging neighbor changes
   Default networks not flagged in outgoing updates
   Default networks not accepted from incoming updates
   Distance: internal 90, external 170
   Maximum paths: 4
   EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0, K6=0
   EIGRP metric rib scale 128
   EIGRP metric version 64-bit
   EIGRP maximum hopcount 100
   EIGRP maximum metric variance 1
   EIGRP NSF: enabled
    NSF-aware route hold timer is 480s
    NSF signal timer is 20s
    NSF converge timer is 300s
    Time since last restart is 00:02:57
   SIA Active timer is 180s
   Interfaces:
    GigabitEthernet0/0/0/0

RP/0/0/CPU0:XRv.lab.com# show route ipv6
...
C    2001:db8:6783:88::/64 is directly connected,
      00:07:30, GigabitEthernet0/0/0/0
L    2001:db8:6783:88::1/128 is directly connected,
      00:07:30, GigabitEthernet0/0/0/0
D    2001:db8:6783:100::/64
      [90/1029120] via fe80::c001:2bff:fe44:0, 00:00:10, GigabitEthernet0/0/0/0

RP/0/0/CPU0:XRv.lab.com# show eigrp ipv6 neighbors
IPv6-EIGRP Neighbors for AS(1) VRF default

H   Address                 Interface       Hold Uptime   SRTT   RTO  Q  Seq
                                            (sec)         (ms)       Cnt Num
0   Link Local Address:     Gi0/0/0/0         13 00:00:52 1602  5000  0  3
    fe80::c001:2bff:fe44:0

RP/0/0/CPU0:XRv.lab.com# ping 2001:db8:6783:88::2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2001:db8:6783:88::2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/11/19 ms

[IOS config]

RX# show run | s router eigrp
ipv6 router eigrp 1
 router-id 1.1.1.1
 no shutdown

RX# sh run int f0/0
!
interface FastEthernet0/0
 no ip address
 duplex auto
 speed auto
 ipv6 address 2001:DB8:6783:88::2/64
 ipv6 enable
 ipv6 eigrp 1
end




biOos