Using EEM and IP sla add the network statement.

Q. R1-host is a server.I want to config R2 such that if icmp to R1-host not work it should stop advertising network 12.x.x.X/29 to nei. I tried using IP SLA but not working.

the solution is VERY easy, in this case I have configured an IP SLA to send ICMP echo messages to 12.1.1.1 and I am also tracking this process. Then I configured an EEM to say if that IP address is not reachable then remove the network statement from EIGRP, then I had to write another EEM to say if the IP address is reachable, add the network statement to the EIGRP. My topology is similar to yours but I used different IP addresses:

R1(S1/2) 12.1.1.1/24 —— 12.1.1.2/24 (S1/1) R2 (S1/3) 23.1.1.2/24 ——

23.1.1.3/24 (S1/2) R3 (S1/4) 34.1.1.3 —– 34.1.1.4/24 (S1/3) R4

On R1:

R1#sh run int s1/2 | B inter

interface Serial1/2

ip address 12.1.1.1 255.255.255.0

clock rate 64000

router eigrp 1

network 12.1.1.1 0.0.0.0

On R2:

R2#sh run int s1/1 | b inter

interface Serial1/1

ip address 12.1.1.2 255.255.255.0

R2#sh run int s1/3 | b inter

interface Serial1/3

ip address 23.1.1.2 255.255.255.0

clock rate 64000

router eigrp 1

network 12.1.1.2 0.0.0.0

network 23.1.1.2 0.0.0.0

On R3:

R3#sh run int s1/2 | b inter

interface Serial1/2

ip address 23.1.1.3 255.255.255.0

R3#sh run int s1/4 | b inter

interface Serial1/4

ip address 34.1.1.3 255.255.255.0

clock rate 64000

R3#sh run | s router eigrp

router eigrp 1

network 23.1.1.3 0.0.0.0

network 34.1.1.3 0.0.0.0

On R4:

R4#sh run int s1/3 | b inter

interface Serial1/3

ip address 34.1.1.4 255.255.255.0

R4#sh run | s router

router eigrp 1

network 34.1.1.4 0.0.0.0

To verify the configuration:

On R4:

R4#Show ip route eigrp | b Gate

Gateway of last resort is not set

12.0.0.0/24 is subnetted, 1 subnets

D       12.1.1.0 [90/21536000] via 34.1.1.3, 00:10:23, Serial1/3

23.0.0.0/24 is subnetted, 1 subnets

D       23.1.1.0 [90/21024000] via 34.1.1.3, 00:15:57, Serial1/3

NOW, let’s configure R2:

We are going to configure an IP SLA to send ICMP echoes to 12.1.1.1, and start the process:

ip sla 1

icmp-echo 12.1.1.1 source-interface Serial1/1

frequency 5

ip sla schedule 1 life forever start-time now

Next let’s track this process:

track 2 ip sla 1 reachability

NOW, let’s configure EEM to instruct the router to remove the network statement if 12.1.1.1 is NOT reachable:

event manager applet tst

event track 2 state down

action 1.1 cli command “en”

action 1.2 cli command “conf t”

action 1.3 cli command “router eigrp 1”

action 1.4 cli command “no netw 12.1.1.2 0.0.0.0”

We need to configure another EEM to instruct the router to add the network statement back when and if the 12.1.1.1 IP address is reachable:

event manager applet tst2

event track 2 state up

action 1.1 cli command “en”

action 1.2 cli command “conf t”

action 1.3 cli command “router eigrp 1”

action 1.4 cli command “netw 12.1.1.2 0.0.0.0”

Cool, let’s test. So far the 12.1.1.1 IP address is reachable so nothing should be done, let’s verify:

On R3:

R3#Show ip route eigrp | b Gate

Gateway of last resort is not set

12.0.0.0/24 is subnetted, 1 subnets

D       12.1.1.0 [90/21024000] via 23.1.1.2, 00:14:15, Serial1/2

Let’s shutdown the S1/2 interface of R1 and verify:

On R1:

R1(config)#int s1/2

R1(config-if)#Shut

To verify:

On R3:

R3#Show ip route eigrp | b Gate

Gateway of last resort is not set

R3#

As we can see the network is no longer advertised, to verify this further let’s go to R2 and check EIGRP’s configuration:

On R2:

R2#sh run | s router

router eigrp 1

network 23.1.1.2 0.0.0.0

Cool, now let’s No shut the S1/2 interface of R1:

On R1:

R1(config)#int s1/2

R1(config-if)#No shut

We can see that R2 has added the network statement back, to verify:

On R2:

R2#sh run | s router

router eigrp 1

network 12.1.1.2 0.0.0.0

network 23.1.1.2 0.0.0.0

As a result R3 should see the network:

On R3:

R3#Show ip route eigrp | b Gate

Gateway of last resort is not set

12.0.0.0/24 is subnetted, 1 subnets

D       12.1.1.0 [90/21024000] via 23.1.1.2, 00:00:49, Serial1/2

Controlling the BGP path

Regular Expression

AS path prepend matching regular Expression: ^([0-9]+)(_\1)*$
Match my own routes: ^$
matches prefixes from AS 51 that is directly connected to our AS : ^51_
matches prefixes that transit AS 51 :  _51_
matches prefixes that originated in AS 51, the $ ensures that it’s the beginning of the AS PATH :  _51$
match all AS: (.*)
^: Beginng of the List
$: End of the list
\: Removes the special meaning
_: white space
-: Matches single character

prefix list: Need to match network + mask
– Permit only default route: 0.0.0.0/0
– Permit anything : 0.0.0.0/0 le 32
– Pemit only defult route: 0.0.0.0/0 ge 32
– Permit class A subnet with mask exact 24: 0.0.0.0/1 ge 1 le 1

BGP Neighbour RESET:
-Soft reconfiguration will consumes memory since it will store the routes in filter.
– Inbound soft reconfiguration you need to configure first then need to apply the command.
– On 12.1 cisco added the ability which saves the memory called as Route Refresh. It will send request to other router to re-send all the routes again. This doesn’t need any pre-requist configuration.

Outbound Route filter(ORF):
-ORF transmits inbound filter to apply it outbound on other end. Neighbour must support ORF filter.
neighbour 1.1.1.1 capability orf prefix-list in/out/both

Communities:
-32 bit long(old format)
– You can use the Regular Expression in extended community.(100-199)