Monday 18 March 2019

EIGRP STUB and Configuration


EIGRP STUB

Stub routing is one way to limit queries. A stub router is one that is connected to on more than two neighbors and should be a transit router. 


The EIGRP stub routing feature improve network stability, reduces resource utilization, and simplifies remote router (spoke) configuration. Stub routing is commonly used in a Hub-and-Spoke topology.


Here is the command:

R1(config-router)#EIGRP STUB ?
  connected       Do advertise connected routes
  leak-map        Allow dynamic prefixes based on the leak-map
  receive-only    Set receive only neighbor
  redistributed   Do advertise redistributed routes
  static                 Do advertise static routes
  summary         Do advertise summary routes


  • Connected means the router advertise connected routes only for those interfaces which matched with a network command.
  •  Leak-map means the router advertise only which is specified by a leak-map
  •  Receive-only means the router do not advertise any routes. And this option can be used with any other option.
  • Redistribution means the router advertise only the redistributed routes.
  • Static means the router advertise only the static routes with redistributed static command configured.
  • Summary means the router advertise only auto summarized or statically configured summary routes
NOTE: By default is connected and summary.

Before we start  EIGRP configuration check out some important  of EIGRP CCIE exam topics.

Here is the lists of all EIGRP labs and theories CCNA to CCIE

1.Enhanced Interior Gateway Routing Protocol (EIGRP)

2.Stuck In Active (EIGRP)

3.EIGRP Equal-Cost and Unequal-Cost load balancing

4.Route filtering passive interface

5.Route summarization

6.EIGRP STUB and Configuration

7. Routing Protocol Authentication (EIGRP ) and configuration

let's see the configuration for a better understanding: -

Topology:


 Goal:
  • configure the topology as per the diagram.
  • configure EIGRP 650001 advertise interfaces and disable auto-summary.
  • make sure only one route advertises to router 1 and router 2 from router 3
  • after verifying the summary now configure EIGRP STUB on router 1 preventing sending any routes to router 2 make sure router 2 receives routes only from router 2.

R1#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        10.1.1.1        YES manual up                    up
Serial3/0                     1.1.1.1         YES manual up                    up
Loopback0              11.0.0.1        YES manual up                    up
Loopback1              11.0.1.1        YES manual up                    up
Loopback2              11.0.2.1        YES manual up                    up
Loopback3              11.0.3.1        YES manual up                    up


R2#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        20.1.1.1        YES manual up                    up
Serial3/0                    1.1.1.2         YES manual up                    up
Serial3/1                    2.1.1.1         YES manual up                    up
Serial3/2                    3.1.1.1         YES manual up                    up
Loopback0              12.0.0.1        YES manual up                    up
Loopback1              12.0.1.1        YES manual up                    up
Loopback2              12.0.2.1        YES manual up                    up
Loopback3              12.0.3.1        YES manual up                    up


R3#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        30.1.1.1        YES manual up                    up
Serial3/1                    2.1.1.2         YES manual up                    up
Loopback0              13.0.0.1        YES manual up                    up
Loopback1              13.0.1.1        YES manual up                    up
Loopback2              13.0.2.1        YES manual up                    up
Loopback3              13.0.3.1        YES manual up                    up




R1(config)#router eigrp 65001
R1(config-router)#network 1.0.0.0
R1(config-router)#network 10.0.0.0
R1(config-router)#no auto-summary
R1(config-router)#exit


R2(config)#router eigrp 65001
R2(config-router)#network 1.0.0.0
R2(config-router)#network 1.0.0.0

*Mar 18 12:25:38.567: %DUAL-5-NBRCHANGE: EIGRP-IPv4 65001: Neighbor 1.1.1.1 (Serial3/0) is up: new adjacency

R2(config-router)#network 2.0.0.0
R2(config-router)#network 20.0.0.0
R2(config-router)#no auto-summary
R2(config-router)#exit

R3(config)#router eigrp 65001
R3(config-router)#network 2.0.0.0

*Mar 18 12:26:16.707: %DUAL-5-NBRCHANGE: EIGRP-IPv4 65001: Neighbor 2.1.1.1 (Serial3/1) is up: new adjacency

R3(config-router)#network 13.0.0.0
R3(config-router)#network 30.0.0.0
R3(config-router)#no auto-summary
R3(config-router)#exit

R2#show ip eigrp neighbors
EIGRP-IPv4 Neighbors for AS(65001)
H   Address                 Interface              Hold Uptime   SRTT   RTO  Q  Seq
                                                                  (sec)             (ms)       Cnt Num
1   2.1.1.2                 Se3/1                    12 00:08:12   73   438  0  6
0   1.1.1.1                 Se3/0                    14 00:08:50   67   402  0  6


R1#show ip route eigrp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

D     2.0.0.0/8 [90/2681856] via 1.1.1.2, 00:10:28, Serial3/0
      13.0.0.0/24 is subnetted, 4 subnets
D        13.0.0.0 [90/2809856] via 1.1.1.2, 00:02:34, Serial3/0
D        13.0.1.0 [90/2809856] via 1.1.1.2, 00:02:34, Serial3/0
D        13.0.2.0 [90/2809856] via 1.1.1.2, 00:02:34, Serial3/0
D        13.0.3.0 [90/2809856] via 1.1.1.2, 00:02:34, Serial3/0
D     20.0.0.0/8 [90/2172416] via 1.1.1.2, 00:06:46, Serial3/0
D     30.0.0.0/8 [90/2684416] via 1.1.1.2, 00:05:52, Serial3/0


R2#show ip route eigrp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

D     10.0.0.0/8 [90/2172416] via 1.1.1.1, 00:09:56, Serial3/0
      13.0.0.0/24 is subnetted, 4 subnets
D        13.0.0.0 [90/2297856] via 2.1.1.2, 00:01:57, Serial3/1
D        13.0.1.0 [90/2297856] via 2.1.1.2, 00:01:57, Serial3/1
D        13.0.2.0 [90/2297856] via 2.1.1.2, 00:01:57, Serial3/1
D        13.0.3.0 [90/2297856] via 2.1.1.2, 00:01:57, Serial3/1
D     30.0.0.0/8 [90/2172416] via 2.1.1.2, 00:05:15, Serial3/1



(now we are going to configure summary route)

R3(config)#interface serial 3/1
R3(config-if)#ip summary-address eigrp 65001 13.0.0.0 255.255.252.0

*Mar 18 12:39:48.235: %DUAL-5-NBRCHANGE: EIGRP-IPv4 65001: Neighbor 2.1.1.1 (Serial3/1) is resync: summary configured


R3(config)#router eigrp 65001
R3(config-router)#eigrp stub ?
  connected      Do advertise connected routes
  leak-map       Allow dynamic prefixes based on the leak-map
  receive-only   Set receive only neighbor
  redistributed  Do advertise redistributed routes
  static         Do advertise static routes
  summary        Do advertise summary routes
  <cr>
R3(config-router)#eigrp stub summary

*Mar 18 12:42:36.931: %DUAL-5-NBRCHANGE: EIGRP-IPv4 65001: Neighbor 2.1.1.1 (Serial3/1) is down: peer info changed

*Mar 18 12:42:37.375: %DUAL-5-NBRCHANGE: EIGRP-IPv4 65001: Neighbor 2.1.1.1 (Serial3/1) is up: new adjacency
R3(config-router)#end

R2#show ip route eigrp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

D     10.0.0.0/8 [90/2172416] via 1.1.1.1, 00:17:21, Serial3/0
      13.0.0.0/22 is subnetted, 1 subnets
D        13.0.0.0 [90/2297856] via 2.1.1.2, 00:00:22, Serial3/1



R1#show ip route eigrp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set


D     2.0.0.0/8 [90/2681856] via 1.1.1.2, 00:19:02, Serial3/0
      13.0.0.0/22 is subnetted, 1 subnets
D        13.0.0.0 [90/2809856] via 1.1.1.2, 00:02:07, Serial3/0
D     20.0.0.0/8 [90/2172416] via 1.1.1.2, 00:15:20, Serial3/0




R1(config)#router eigrp 65001
R1(config-router)#eigrp stub ?
  connected      Do advertise connected routes
  leak-map       Allow dynamic prefixes based on the leak-map
  receive-only   Set receive only neighbor
  redistributed  Do advertise redistributed routes
  static         Do advertise static routes
  summary        Do advertise summary routes
  <cr>


R1(config-router)#eigrp stub receive-only
*Mar 18 12:52:06.603: %DUAL-5-NBRCHANGE: EIGRP-IPv4 65001: Neighbor 1.1.1.2 (Serial3/0) is down: peer info changed


*Mar 18 12:52:06.959: %DUAL-5-NBRCHANGE: EIGRP-IPv4 65001: Neighbor 1.1.1.2 (Serial3/0) is up: new adjacency
R1(config-router)#end

R2#show ip route eigrp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override


Gateway of last resort is not set

      13.0.0.0/22 is subnetted, 1 subnets
D        13.0.0.0 [90/2297856] via 2.1.1.2, 00:11:12, Serial3/1


R3#show ip route eigrp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

D     1.0.0.0/8 [90/2681856] via 2.1.1.1, 00:11:55, Serial3/1
      13.0.0.0/8 is variably subnetted, 9 subnets, 3 masks
D        13.0.0.0/22 is a summary, 00:14:44, Null0
D     20.0.0.0/8 [90/2172416] via 2.1.1.1, 00:11:55, Serial3/1

(after configure EIGRP STUB receive only on route 1. router 1 preventing all the routes
but router 3 learn all the routes from route 2)

Wednesday 13 March 2019

BGP AS Path Prepending


AS Path is the fourth BGP attribute, and AS Path is a well-known, mandatory attribute. BGP prefers the shortest AS path to get to the destination. In other words, a path with the shortest AS path list is more desirable.




You can manipulate this by using AS path prepending. Manual manipulation of AS path length is called AS path prepending.  The AS path should be extended with multiple copies of the AS number of the sender.

AS path prepending is used to:
1.      

  1.             Ensure proper return path selection.
  2.        .    Distribution of the traffic load for multi-homed customers.


Results of AS path prepending can be observed on the receiving router.
let see the configuration :-

Topology:


Goal:

  • configure the topology as per the diagram and assign the IP address as per the topology.
  • configure IBGP and EBGP.
  • configure AS 650014 to ensure that all routes in AS 650014 should exit router_1 to reach AS 650003 (30.0.0.0) prefix.
  • configure AS 650014 to ensure that the traffic from 30.0.0.0 to 10.0.0.0 return traffic should use the same path as forwarding traffic routers_1_2_3.



R1#show ip interface brief

Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        10.1.1.1        YES manual up                    up
Serial3/0                    1.1.1.1         YES manual up                    up
Serial3/3                    4.1.1.2         YES manual up                    up
Loopback0               11.0.0.1        YES manual up                    up


R2#show ip interface brief

Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        20.1.1.1        YES manual up                    up
Serial3/0                    1.1.1.2         YES manual up                    up
Serial3/1                    2.1.1.1         YES manual up                    up
Loopback0               12.0.0.1        YES manual up                    up


R3#show ip interface brief


Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        30.1.1.1        YES manual up                    up
Serial3/1                    2.1.1.2         YES manual up                    up
Serial3/2                    3.1.1.1         YES manual up                    up
Loopback0               13.0.0.1        YES manual up                    up

R4#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        40.1.1.1        YES manual up                    up
Serial3/2                    3.1.1.2         YES manual up                    up
Serial3/3                    4.1.1.1         YES manual up                    up
Loopback0               14.0.0.1        YES manual up                    up




R1(config)#router bgp 650014
R1(config-router)#neighbor 4.1.1.1 remote-as 650014
R1(config-router)#neighbor 1.1.1.2 remote-as 650002
R1(config-router)#network 10.0.0.0
R1(config-router)#network 1.0.0.0
R1(config-router)#network 4.0.0.0
R1(config-router)#network 11.0.0.0 mask 255.255.255.0
R1(config-router)#exit

R2(config)#router bgp 650002
R2(config-router)#neighbor 1.1.1.1 remote-as 650014

*Mar 13 12:23:30.111: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up

R2(config-router)#neighbor 2.1.1.2 remote-as 650003
R2(config-router)#network 20.0.0.0
R2(config-router)#network 1.0.0.0
R2(config-router)#network 2.0.0.0
R2(config-router)#network 12.0.0.0 mask 255.255.255.0
R2(config-router)#exit

R3(config)#router bgp 650003
R3(config-router)#neighbor 2.1.1.1 remote-as 650002

*Mar 13 12:25:42.495: %BGP-5-ADJCHANGE: neighbor 2.1.1.1 Up

R3(config-router)#neighbor 3.1.1.2 remote-as 650014
R3(config-router)#network 30.0.0.0
R3(config-router)#network 3.0.0.0
R3(config-router)#network 2.0.0.0
R3(config-router)#network 13.0.0.0 mask 255.255.255.0
R3(config-router)#exit

R4(config)#router bgp 650014
R4(config-router)#neighbor 3.1.1.1 remote-as 650003

*Mar 13 12:27:46.807: %BGP-5-ADJCHANGE: neighbor 3.1.1.1 Up

R4(config-router)#neighbor 4.1.1.2 remote-as 650014

*Mar 13 12:28:10.663: %BGP-5-ADJCHANGE: neighbor 4.1.1.2 Up

R4(config-router)#network 40.0.0.0
R4(config-router)#network 4.0.0.0
R4(config-router)#network 3.0.0.0
R4(config-router)#network 14.0.0.0 mask 255.255.255.0
R4(config-router)#exit

R1#show ip bgp summary
BGP router identifier 11.0.0.1, local AS number 650014
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.2         4       650002      14      16       21    0    0 00:08:00        7
4.1.1.1         4       650014      14      13       21    0    0 00:03:19        7

R2#show ip bgp summary
BGP router identifier 12.0.0.1, local AS number 650002
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4       650014      17      15       14    0    0 00:09:06        9
2.1.1.2         4       650003      12      15       14    0    0 00:06:54        9

R3#show ip bgp summary
BGP router identifier 13.0.0.1, local AS number 650003
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
2.1.1.1         4       650002      16      13       18    0    0 00:07:58        9
3.1.1.2         4       650014      12      16       18    0    0 00:05:54        9

R4#sh ip bgp summary
BGP router identifier 14.0.0.1, local AS number 650014
Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
3.1.1.1         4       650003      17      12       18    0    0 00:06:20        7
4.1.1.2         4       650014      15      17       18    0    0 00:05:56        7

R3#show ip bgp
BGP table version is 18, local router ID is 13.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *   1.0.0.0          3.1.1.2                                0 650014 i
 *>                   2.1.1.1                  0             0 650002 i
 *>  2.0.0.0          0.0.0.0                  0         32768 i
 *                    2.1.1.1                  0             0 650002 i
 *   3.0.0.0          3.1.1.2                  0             0 650014 i
 *>                   0.0.0.0                  0         32768 i
 *>  4.0.0.0          3.1.1.2                  0             0 650014 i
 *                    2.1.1.1                                0 650002 650014 i
 *>  10.0.0.0         3.1.1.2                                0 650014 i
 *                    2.1.1.1                                0 650002 650014 i
 *>  11.0.0.0/24      3.1.1.2                                0 650014 i
 *                    2.1.1.1                                0 650002 650014 i
 *   12.0.0.0/24      3.1.1.2                                0 650014 650002 i
 *>                   2.1.1.1                  0             0 650002 i
     Network          Next Hop            Metric LocPrf Weight Path
 *>  13.0.0.0/24      0.0.0.0                  0         32768 i
 *   14.0.0.0/24      2.1.1.1                                0 650002 650014 i
 *>                   3.1.1.2                  0             0 650014 i
 *   20.0.0.0         3.1.1.2                                0 650014 650002 i
 *>                   2.1.1.1                  0             0 650002 i
 *>  30.0.0.0         0.0.0.0                  0         32768 i
 *>  40.0.0.0         3.1.1.2                  0             0 650014 i
 *                    2.1.1.1                                0 650002 650014 i

R1#show ip bgp
BGP table version is 21, local router ID is 11.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *   1.0.0.0          1.1.1.2                  0             0 650002 i
 *>                   0.0.0.0                  0         32768 i
 * i 2.0.0.0          3.1.1.1                  0    100      0 650003 i
 *>                   1.1.1.2                  0             0 650002 i
 *>i 3.0.0.0          4.1.1.1                  0    100      0 i
 *                    1.1.1.2                                0 650002 650003 i
 * i 4.0.0.0          4.1.1.1                  0    100      0 i
 *>                   0.0.0.0                  0         32768 i
 *>  10.0.0.0         0.0.0.0                  0         32768 i
 *>  11.0.0.0/24      0.0.0.0                  0         32768 i
 *>  12.0.0.0/24      1.1.1.2                  0             0 650002 i
 *>i 13.0.0.0/24      3.1.1.1                  0    100      0 650003 i
 *                    1.1.1.2                                0 650002 650003 i
 *>i 14.0.0.0/24      4.1.1.1                  0    100      0 i
     Network          Next Hop            Metric LocPrf Weight Path
 *>  20.0.0.0         1.1.1.2                  0             0 650002 i
 *>i 30.0.0.0         3.1.1.1                  0    100      0 650003 i
 *                    1.1.1.2                                0 650002 650003 i
 *>i 40.0.0.0         4.1.1.1                  0    100      0 i

R1#show ip bgp 30.1.1.1
BGP routing table entry for 30.0.0.0/8, version 20
Paths: (2 available, best #1, table default)
  Advertised to update-groups:
     1
  Refresh Epoch 1
  650003
    3.1.1.1 from 4.1.1.1 (14.0.0.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best
      rx pathid: 0, tx pathid: 0x0
  Refresh Epoch 1
  650002 650003
    1.1.1.2 from 1.1.1.2 (12.0.0.1)
      Origin IGP, localpref 100, valid, external
      rx pathid: 0, tx pathid: 0

 ( by default AS_650014 EXIT VIA R4 to reach AS 650003 route (30.0.0.0) prefix because of shortest AS-PATH)


R1(config)# access-list 10 permit 30.0.0.0 0.255.255.255

R1(config)#route-map cisco permit 10
R1(config-route-map)#match ip address 10
R1(config-route-map)#set local-preference 300
R1(config-route-map)#exit

R1(config)#route-map cisco permit 20
R1(config-route-map)#exit


R1#show ip bgp 30.1.1.1
BGP routing table entry for 30.0.0.0/8, version 22
Paths: (1 available, best #1, table default)
  Advertised to update-groups:
     2
  Refresh Epoch 2
  650002 650003
    1.1.1.2 from 1.1.1.2 (12.0.0.1)
      Origin IGP, localpref 300, valid, external, best
      rx pathid: 0, tx pathid: 0x0

                                               ( now configure return traffic)

R3#show ip bgp
BGP table version is 18, local router ID is 13.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *   1.0.0.0          3.1.1.2                                0 650014 i
 *>                   2.1.1.1                  0             0 650002 i
 *>  2.0.0.0          0.0.0.0                  0         32768 i
 *                    2.1.1.1                  0             0 650002 i
 *   3.0.0.0          3.1.1.2                  0             0 650014 i
 *>                   0.0.0.0                  0         32768 i
 *>  4.0.0.0          3.1.1.2                  0             0 650014 i
 *                    2.1.1.1                                0 650002 650014 i
 *>  10.0.0.0         3.1.1.2                                0 650014 i
 *                    2.1.1.1                                0 650002 650014 i
 *>  11.0.0.0/24      3.1.1.2                                0 650014 i
 *                    2.1.1.1                                0 650002 650014 i
 *   12.0.0.0/24      3.1.1.2                                0 650014 650002 i
 *>                   2.1.1.1                  0             0 650002 i
     Network          Next Hop            Metric LocPrf Weight Path
 *>  13.0.0.0/24      0.0.0.0                  0         32768 i
 *   14.0.0.0/24      2.1.1.1                                0 650002 650014 i
 *>                   3.1.1.2                  0             0 650014 i
 *   20.0.0.0         3.1.1.2                                0 650014 650002 i
 *>                   2.1.1.1                  0             0 650002 i
 *>  30.0.0.0         0.0.0.0                  0         32768 i
 *>  40.0.0.0         3.1.1.2                  0             0 650014 i
 *                    2.1.1.1                                0 650002 650014 i

R3#show ip bgp 10.1.1.1
BGP routing table entry for 10.0.0.0/8, version 13
Paths: (2 available, best #1, table default)
  Advertised to update-groups:
     1
  Refresh Epoch 1
  650014
    3.1.1.2 from 3.1.1.2 (14.0.0.1)
      Origin IGP, localpref 100, valid, external, best
      rx pathid: 0, tx pathid: 0x0
  Refresh Epoch 2
  650002 650014
    2.1.1.1 from 2.1.1.1 (12.0.0.1)
      Origin IGP, localpref 100, valid, external
      rx pathid: 0, tx pathid: 0

R4(config)#access-list 10 permit 10.0.0.0 0.255.255.255

R4(config)#route-map cisco permit 10
R4(config-route-map)#match ip address 10
R4(config-route-map)#set as-path prepend 650014 650014 650014 650014
R4(config-route-map)#exit

R4(config)#route-map cisco permit 20
R4(config-route-map)#exit

R4(config)#router bgp 650014
R4(config-router)#nei
R4(config-router)#neighbor 3.1.1.1 rou
R4(config-router)#neighbor 3.1.1.1 route-m
R4(config-router)#neighbor 3.1.1.1 route-map cisco out
R4(config-router)#end

R3#show ip bgp
BGP table version is 19, local router ID is 13.0.0.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *   1.0.0.0          3.1.1.2                                0 650014 i
 *>                   2.1.1.1                  0             0 650002 i
 *>  2.0.0.0          0.0.0.0                  0         32768 i
 *                    2.1.1.1                  0             0 650002 i
 *   3.0.0.0          3.1.1.2                  0             0 650014 i
 *>                   0.0.0.0                  0         32768 i
 *>  4.0.0.0          3.1.1.2                  0             0 650014 i
 *                    2.1.1.1                                0 650002 650014 i
 *   10.0.0.0         3.1.1.2                                0 650014 650014 650014 650014 650014 i
 *>                   2.1.1.1                                0 650002 650014 i
 *>  11.0.0.0/24      3.1.1.2                                0 650014 i
 *                    2.1.1.1                                0 650002 650014 i
 *   12.0.0.0/24      3.1.1.2                                0 650014 650002 i
     Network          Next Hop            Metric LocPrf Weight Path
 *>                   2.1.1.1                  0             0 650002 i
 *>  13.0.0.0/24      0.0.0.0                  0         32768 i
 *   14.0.0.0/24      2.1.1.1                                0 650002 650014 i
 *>                   3.1.1.2                  0             0 650014 i
 *   20.0.0.0         3.1.1.2                                0 650014 650002 i
 *>                   2.1.1.1                  0             0 650002 i
 *>  30.0.0.0         0.0.0.0                  0         32768 i
 *>  40.0.0.0         3.1.1.2                  0             0 650014 i
 *                    2.1.1.1                                0 650002 650014 i

R3#show ip bgp 10.1.1.1
BGP routing table entry for 10.0.0.0/8, version 19
Paths: (2 available, best #2, table default)
  Advertised to update-groups:
     1
  Refresh Epoch 3
  650014 650014 650014 650014 650014
    3.1.1.2 from 3.1.1.2 (14.0.0.1)
      Origin IGP, localpref 100, valid, external
      rx pathid: 0, tx pathid: 0
  Refresh Epoch 3
  650002 650014
    2.1.1.1 from 2.1.1.1 (12.0.0.1)
      Origin IGP, localpref 100, valid, external, best
      rx pathid: 0, tx pathid: 0x0


R1#traceroute 30.1.1.1
Type escape sequence to abort.
Tracing the route to 30.1.1.1
VRF info: (vrf in name/id, vrf out name/id)
  1 1.1.1.2 52 msec 56 msec 28 msec
  2 2.1.1.2 [AS 650002] 120 msec 140 msec 176 msec

R3#traceroute 10.1.1.1
Type escape sequence to abort.
Tracing the route to 10.1.1.1
VRF info: (vrf in name/id, vrf out name/id)
  1 2.1.1.1 36 msec 44 msec 64 msec
  2 1.1.1.1 [AS 650002] 112 msec 92 msec 76 msec

Friday 1 March 2019

BGP Route filtering methods


BGP Route filtering methods

 BGP updates can be controlled by using a number of different filtering methods. BGP updates can be filtered based on route information, path information, or on communities. All the methods will achieve the same results choosing one over the other depends on the specific network configuration.


 You might need to control exactly which routes are advertised or redistributed or which paths are chosen. Advertise only some specific routes to neighbors (for security reasons). Redistribute specific routes, preventing routing loops, and Path manipulation of some specific routes.

Changing metric and metric type for specific routes. Changing the administrative distance for specific routes with BGP controlling routes to be advertised to ISP. Control routes to get into routing table Policy-based routing.




lets see the methods of BGP route filtering:





Topology :


Goal: 


  • configure the topology as per the diagram. 
  • configure EBGP as per the topology and advertise directly connected interfaces
  • configure router 2 to block 30.1.1.1/8 networks. make sure router 2 do not install 30.1.1.1/8 network in its routing table.
  • configure distribution list in order to block 30.1.1.1/8 network.

R1#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        10.1.1.1        YES manual up                    up
Serial3/0                    1.1.1.1         YES manual up                    up
Serial3/3                    4.1.1.2         YES manual up                    up
Loopback0              11.0.0.1        YES manual up                    up
Loopback1              11.0.1.1        YES manual up                    up
Loopback2              11.0.2.1        YES manual up                    up
Loopback3              11.0.3.1        YES manual up                    up


R2#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        20.1.1.1        YES manual up                    up
Serial3/0                    1.1.1.2         YES manual up                    up
Serial3/1                    2.1.1.1         YES manual up                    up
Loopback0              12.0.0.1        YES manual up                    up
Loopback1              12.0.1.1        YES manual up                    up
Loopback2              12.0.2.1        YES manual up                    up
Loopback3              12.0.3.1        YES manual up                    up


R3#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        30.1.1.1        YES manual up                    up
Serial3/1                    2.1.1.2         YES manual up                    up
Serial3/2                    3.1.1.1         YES manual up                    up
Loopback0              13.0.0.1        YES manual up                    up
Loopback1              13.0.1.1        YES manual up                    up
Loopback2              13.0.2.1        YES manual up                    up
Loopback3              13.0.3.1        YES manual up                    up

R4#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        40.1.1.1        YES manual up                    up
Serial3/2                    3.1.1.2         YES manual up                    up
Serial3/3                    4.1.1.1         YES manual up                    up
Loopback0              14.0.0.1        YES manual up                    up
Loopback1              14.0.1.1        YES manual up                    up
Loopback2              14.0.2.1        YES manual up                    up
Loopback3              14.0.3.1        YES manual up                    up


R1(config)#router bgp 650001
R1(config-router)#neighbor 1.1.1.2 remote-as 650002
R1(config-router)#neighbor 4.1.1.1 remote-as 650004
R1(config-router)#network 10.0.0.0
R1(config-router)#network 1.0.0.0
R1(config-router)#network 4.0.0.0
R1(config-router)#end

R2(config)#router bgp 650002
R2(config-router)#neighbor 1.1.1.1 remote-as 650001

*Mar  1 14:39:06.207: %BGP-5-ADJCHANGE: neighbor 1.1.1.1 Up

R2(config-router)#neighbor 2.1.1.2 remote-as 650003

*Mar  1 14:39:29.195: %BGP-5-ADJCHANGE: neighbor 2.1.1.2 Up

R2(config-router)#network 20.0.0.0
R2(config-router)#network 2.0.0.0
R2(config-router)#network 1.0.0.0
R2(config-router)#end

R3(config)#router bgp 650003
R3(config-router)#neighbor 2.1.1.1 remote-as 650002
R3(config-router)#neighbor 2.1.1. remote-as 650004

*Mar  1 14:34:49.651: %BGP-5-ADJCHANGE: neighbor 2.1.1.1 Up

R3(config-router)#neighbor 3.1.1.2 remote-as 650004
R3(config-router)#network 30.0.0.0
R3(config-router)#network 3.0.0.0
R3(config-router)#network 2.0.0.0
R3(config-router)#end


R4(config)#router bgp 650004
R4(config-router)#neighbor 3.1.1.1 remote-as 650003

*Mar  1 14:36:26.991: %BGP-5-ADJCHANGE: neighbor 3.1.1.1 Up

R4(config-router)#neighbor 4.1.1.2 remote-as 650001

*Mar  1 14:36:37.771: %BGP-5-ADJCHANGE: neighbor 4.1.1.2 Up

R4(config-router)#network 40.0.0.0
R4(config-router)#network 4.0.0.0
R4(config-router)#network 3.0.0.0
R4(config-router)#end

R1#show ip bgp
BGP table version is 16, local router ID is 11.0.3.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *   1.0.0.0          1.1.1.2                  0             0 650002 i
 *>                   0.0.0.0                  0         32768 i
 *>  2.0.0.0          1.1.1.2                  0             0 650002 i
 *                    4.1.1.1                                0 650004 650003 i
 *   3.0.0.0          1.1.1.2                                0 650002 650003 i
 *>                   4.1.1.1                  0             0 650004 i
 *>  4.0.0.0          0.0.0.0                  0         32768 i
 *>  10.0.0.0         0.0.0.0                  0         32768 i
 *>  20.0.0.0         1.1.1.2                  0             0 650002 i
 *   30.0.0.0         1.1.1.2                                0 650002 650003 i
 *>                   4.1.1.1                                0 650004 650003 i
 *>  40.0.0.0         4.1.1.1                  0             0 650004 i


R2#show ip bgp
BGP table version is 14, local router ID is 12.0.3.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.0.0.0          0.0.0.0                  0         32768 i
 *                    1.1.1.1                  0             0 650001 i
 *>  2.0.0.0          0.0.0.0                  0         32768 i
 *                    2.1.1.2                  0             0 650003 i
 *>  3.0.0.0          2.1.1.2                  0             0 650003 i
 *                    1.1.1.1                                0 650001 650004 i
 *   4.0.0.0          2.1.1.2                                0 650003 650004 650001 i
 *>                   1.1.1.1                  0             0 650001 i
 *   10.0.0.0         2.1.1.2                                0 650003 650004 650001 i
 *>                   1.1.1.1                  0             0 650001 i
 *>  20.0.0.0         0.0.0.0                  0         32768 i
 *>  30.0.0.0         2.1.1.2                  0             0 650003 i
     Network          Next Hop            Metric LocPrf Weight Path
 *                    1.1.1.1                                0 650001 650004 650003 i
 *   40.0.0.0         2.1.1.2                                0 650003 650004 i
 *>                   1.1.1.1                                0 650001 650004 i


R3#show ip bgp
BGP table version is 16, local router ID is 13.0.3.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *>  1.0.0.0          2.1.1.1                  0             0 650002 i
 *                    3.1.1.2                                0 650004 650001 i
 *   2.0.0.0          2.1.1.1                  0             0 650002 i
 *>                   0.0.0.0                  0         32768 i
 *   3.0.0.0          3.1.1.2                  0             0 650004 i
 *>                   0.0.0.0                  0         32768 i
 *   4.0.0.0          2.1.1.1                                0 650002 650001 i
 *>                   3.1.1.2                                0 650004 650001 i
 *   10.0.0.0         2.1.1.1                                0 650002 650001 i
 *>                   3.1.1.2                                0 650004 650001 i
 *   20.0.0.0         3.1.1.2                                0 650004 650001 650002 i
 *>                   2.1.1.1                  0             0 650002 i
 *>  30.0.0.0         0.0.0.0                  0         32768 i
     Network          Next Hop            Metric LocPrf Weight Path
 *   40.0.0.0         2.1.1.1                                0 650002 650001 650004 i
 *>                   3.1.1.2                  0             0 650004 i

R4#show ip bgp
BGP table version is 15, local router ID is 14.0.3.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
              x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

     Network          Next Hop            Metric LocPrf Weight Path
 *   1.0.0.0          3.1.1.1                                0 650003 650002 i
 *>                   4.1.1.2                  0             0 650001 i
 *   2.0.0.0          4.1.1.2                                0 650001 650002 i
 *>                   3.1.1.1                  0             0 650003 i
 *>  3.0.0.0          0.0.0.0                  0         32768 i
 *                    3.1.1.1                  0             0 650003 i
 *>  4.0.0.0          4.1.1.2                  0             0 650001 i
 *>  10.0.0.0         4.1.1.2                  0             0 650001 i
 *   20.0.0.0         3.1.1.1                                0 650003 650002 i
 *>                   4.1.1.2                                0 650001 650002 i
 *>  30.0.0.0         3.1.1.1                  0             0 650003 i
 *>  40.0.0.0         0.0.0.0                  0         32768 i

R2#show ip bgp 30.1.1.1
BGP routing table entry for 30.0.0.0/8, version 9
Paths: (2 available, best #1, table default)
  Advertised to update-groups:
     1
  Refresh Epoch 2
  650003
    2.1.1.2 from 2.1.1.2 (13.0.3.1)
      Origin IGP, metric 0, localpref 100, valid, external, best
      rx pathid: 0, tx pathid: 0x0
  Refresh Epoch 2
  650001 650004 650003
    1.1.1.1 from 1.1.1.1 (11.0.3.1)
      Origin IGP, localpref 100, valid, external
      rx pathid: 0, tx pathid: 0

(we are going block 30.1.1.1/8 network by using distribution list)

R2(config)#access-list 30 deny 30.1.1.1 0.255.255.255
R2(config)#access-list 30 permit any
R2(config)#exit

R2(config)#router bgp 650002
R2(config-router)#neighbor 2.1.1.2 distribute-list 30 in
R2(config-router)#neighbor 1.1.1.1 distribute-list 30 in
R2(config-router)#end

R2#clear ip bgp * soft

R2#show ip bgp 30.1.1.1
% Network not in table

What is Virtual Router Redundancy Protocol (VRRP)? How to configure Virtual Router Redundancy Protocol (VRRP)?

 Virtual Router Redundancy Protocol (VRRP) is a gateway redundancy networking protocol used to create a virtual gateway similar to HSRP . VR...