Thursday, December 6, 2018

Configuring Distribute List, Prefix List and Route Map to Control Routing Updates

The main technical reason for needing redistribution is straightforward: An internetwork uses more than one routing protocol, and the routes need to be exchanged between those routing domains, at least temporarily. The business reasons vary widely but include the following:

* Mergers when different IGPs are used.

* Mergers when the same IGP is used.

* Momentum (The enterprise has been using multiple routing protocols for a long time.)

* Different company divisions are under separate control for business or political reasons.

* Connections between partners.

* Between IGPs and BGP when BGP is used between large segments of a multinational company.

* Layer 3 WAN (Multiprotocol Label Switching [MPLS]).


EIGRP redistribute Command

The following lines show the generic syntax of the redistribute command
when used as a router eigrp subcommand. Note that the syntax differs slightly
depending on the routing protocol into which routes will be redistributed.

redistribute <protocol> [ process-id | as-number ] [ metric <bw> <delay> <reliability> <load>
<mtu> ] [ match { internal | nssa-external | external 1 | external 2 }] [ tag <tag-value> ]
[ route-map <name> ]



OSPF redistribute Command

The following lines show the generic syntax of the redistribute command
when used as a router ospf subcommand. Note that the syntax differs slightly
depending on the routing protocol into which routes will be redistributed.

redistribute <protocol> [ process-id | as-number ] [ metric <metric-value> ] [ metric-type
<type-value> ] [ match { internal | external 1 | external 2 | nssa-external }] [ tag <tagvalue>
] [ route-map <map-tag> ] [ subnets ]



This is a continuation and using the same topology from the previous Redistribution lab.



R1#show run interface serial 2/0
Building configuration...

Current configuration : 144 bytes
!
interface Serial2/0
 ip address 172.16.12.1 255.255.255.0
 ip summary-address eigrp 1 192.168.48.0 255.255.254.0
 serial restart-delay 0
end

R1#
R1#show run | sec router eigrp 1
router eigrp 1
 network 172.16.0.0
 network 192.168.0.0 0.0.255.255


R3#show run | sec router ospf 1
router ospf 1
 area 20 range 192.168.8.0 255.255.252.0
 network 172.16.0.0 0.0.255.255 area 0
 network 192.168.8.0 0.0.3.255 area 20
 network 192.168.0.0 0.0.255.255 area 0


R2#show run | sec router eigrp 1
router eigrp 1
 network 172.16.0.0
 redistribute ospf 1 metric 10000 100 255 1 1500
R2#
R2#show run | sec ospf 1       
 redistribute ospf 1 metric 10000 100 255 1 1500
router ospf 1
 summary-address 192.168.48.0 255.255.252.0
 redistribute eigrp 1 subnets
 network 172.16.23.0 0.0.0.255 area 0
 network 172.16.100.0 0.0.0.255 area 10


R2#show ip route eigrp | beg Gateway     // VERIFY EIGRP AND OSPF ROUTES IN REDISTRIBUTION ROUTER
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 10 subnets, 2 masks
D        172.16.1.0/24 [90/2297856] via 172.16.12.1, 3d00h, Serial2/0
D     192.168.48.0/23 [90/2297856] via 172.16.12.1, 3d00h, Serial2/0
D     192.168.50.0/24 [90/2297856] via 172.16.12.1, 2d23h, Serial2/0
D     192.168.51.0/24 [90/2297856] via 172.16.12.1, 3d00h, Serial2/0
D     192.168.70.0/24 [90/2297856] via 172.16.12.1, 3d00h, Serial2/0
R2#
R2#show ip route ospf | beg Gate
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 10 subnets, 2 masks
O        172.16.3.0/24 [110/65] via 172.16.23.3, 3d00h, Serial2/1
O IA  192.168.8.0/22 [110/65] via 172.16.23.3, 3d00h, Serial2/1
O     192.168.20.0/24 [110/65] via 172.16.23.3, 3d00h, Serial2/1
O     192.168.25.0/24 [110/65] via 172.16.23.3, 3d00h, Serial2/1
O     192.168.30.0/24 [110/65] via 172.16.23.3, 3d00h, Serial2/1
O     192.168.35.0/24 [110/65] via 172.16.23.3, 3d00h, Serial2/1
O     192.168.40.0/24 [110/65] via 172.16.23.3, 3d00h, Serial2/1
O     192.168.48.0/22 is a summary, 2d23h, Null0


R1#show ip route eigrp | b Gate
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks
D        172.16.2.0/24 [90/2297856] via 172.16.12.2, 3d00h, Serial2/0
D EX     172.16.3.0/24 [170/2195456] via 172.16.12.2, 2d23h, Serial2/0
D        172.16.23.0/24 [90/2681856] via 172.16.12.2, 3d00h, Serial2/0
D        172.16.100.0/24 [90/2297856] via 172.16.12.2, 3d00h, Serial2/0
D EX  192.168.8.0/22 [170/2195456] via 172.16.12.2, 2d23h, Serial2/0
D EX  192.168.20.0/24 [170/2195456] via 172.16.12.2, 2d23h, Serial2/0
D EX  192.168.25.0/24 [170/2195456] via 172.16.12.2, 2d23h, Serial2/0
D EX  192.168.30.0/24 [170/2195456] via 172.16.12.2, 2d23h, Serial2/0
D EX  192.168.35.0/24 [170/2195456] via 172.16.12.2, 2d23h, Serial2/0
D EX  192.168.40.0/24 [170/2195456] via 172.16.12.2, 2d23h, Serial2/0
D EX  192.168.48.0/22 [170/2195456] via 172.16.12.2, 2d23h, Serial2/0
D     192.168.48.0/23 is a summary, 3d00h, Null0


R3#show ip route ospf | b Gate
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks
O E2     172.16.1.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1
O E2     172.16.2.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1
O E2     172.16.12.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1
O IA     172.16.100.0/24 [110/65] via 172.16.23.2, 3d00h, Serial2/1
O     192.168.8.0/22 is a summary, 3d00h, Null0
O E2  192.168.48.0/22 [110/20] via 172.16.23.2, 2d23h, Serial2/1
O E2  192.168.70.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1


R3#tclsh      // VERIFY R3 HAS CONNECTIVITY TO ALL NETWORKS
R3(tcl)#foreach address {
+>(tcl)#172.16.1.1
+>(tcl)#192.168.48.1
+>(tcl)#192.168.49.1
+>(tcl)#192.168.50.1
+>(tcl)#192.168.51.1
+>(tcl)#192.168.70.1
+>(tcl)#172.16.12.1
+>(tcl)#172.16.12.2
+>(tcl)#172.16.2.1
+>(tcl)#172.16.100.1
+>(tcl)#172.16.23.2
+>(tcl)#172.16.23.3
+>(tcl)#172.16.3.1
+>(tcl)#192.168.8.1
+>(tcl)#192.168.9.1
+>(tcl)#192.168.10.1
+>(tcl)#192.168.11.1
+>(tcl)#192.168.20.1
+>(tcl)#192.168.25.1
+>(tcl)#192.168.30.1
+>(tcl)#192.168.35.1
+>(tcl)#192.168.40.1
+>(tcl)#} { ping $address }
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/20/24 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.48.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/15/20 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.49.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/18/24 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.50.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/16/20 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.51.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/15/20 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.70.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/20/32 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/15/24 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/11/16 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/8/12 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.100.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/10/12 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.23.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/9/12 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.23.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/20/28 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.8.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.9.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.11.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.25.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.30.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.35.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.40.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms


R1#show ip route 192.168.8.0
Routing entry for 192.168.8.0/22, supernet
  Known via "eigrp 1", distance 170, metric 2195456, type external
  Redistributing via eigrp 1
  Last update from 172.16.12.2 on Serial2/0, 3d00h ago
  Routing Descriptor Blocks:
  * 172.16.12.2, from 172.16.12.2, 3d00h ago, via Serial2/0
      Route metric is 2195456, traffic share count is 1
      Total delay is 21000 microseconds, minimum bandwidth is 1544 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 1


R2#conf t     // IT'S BEST TO FILTER ROUTES ON A REDISTRIBUTING ROUTER
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#ip access-list standard OSPF-FILTER-192.168.0/22   // FILTER REDISTRIBUTED ROUTES USING DISTRIBUTE LIST AND ACL
R2(config-std-nacl)#deny 192.168.8.0 0.0.3.255
R2(config-std-nacl)#permit any
R2(config-std-nacl)#exit
R2(config)#router eigrp 1
R2(config-router)#distribute-list ?
  <1-199>      IP access list number
  <1300-2699>  IP expanded access list number
  WORD         Access-list name
  gateway      Filtering incoming address updates based on gateway
  prefix       Filter prefixes in address updates
  route-map    Filter prefixes based on the route-map

R2(config-router)#distribute-list OSPF-FILTER-192.168.0/22 ?
  in   Filter incoming service updates
  out  Filter outgoing service updates

R2(config-router)#distribute-list OSPF-FILTER-192.168.0/22 out ?
  Async              Async interface
  Auto-Template      Auto-Template interface
  BVI                Bridge-Group Virtual Interface
  CDMA-Ix            CDMA Ix interface
  CTunnel            CTunnel interface
  Dialer             Dialer interface
  FastEthernet       FastEthernet IEEE 802.3
  GMPLS              MPLS interface
  LISP               Locator/ID Separation Protocol Virtual Interface
  LongReachEthernet  Long-Reach Ethernet interface
  Loopback           Loopback interface
  MFR                Multilink Frame Relay bundle interface
  Multilink          Multilink-group interface
  Port-channel       Ethernet Channel of interfaces
  Serial             Serial
  Tunnel             Tunnel interface
  Vif                PGM Multicast Host interface
  Virtual-PPP        Virtual PPP interface
  Virtual-Template   Virtual Template interface
  Virtual-TokenRing  Virtual TokenRing
  bgp                Border Gateway Protocol (BGP)
  connected          Connected
  eigrp              Enhanced Interior Gateway Routing Protocol (EIGRP)
  ospf               Open Shortest Path First (OSPF)
  rip                Routing Information Protocol (RIP)
  static             Static routes
  vmi                Virtual Multipoint Interface
  <cr>

R2(config-router)#distribute-list OSPF-FILTER-192.168.0/22 out ospf ?
  <1-65535>  Process ID

R2(config-router)#distribute-list OSPF-FILTER-192.168.0/22 out ospf 1
R2(config-router)#end
R2#
*Jul  5 10:46:58.051: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Jul  5 10:47:04.267: %DUAL-5-NBRCHANGE: EIGRP-IPv4 1: Neighbor 172.16.12.1 (Serial2/0) is resync: route configuration changed


*Jul  5 10:50:00.734: %DUAL-5-NBRCHANGE: EIGRP-IPv4 1: Neighbor 172.16.12.2 (Serial2/0) is resync: peer graceful-restart
R1#
R1#show ip route 192.168.8.0      // VERIFY ROUTE IS FILTERED IN R1
% Network not in table
R1#
R1#show ip route eigrp | b Gate
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks
D        172.16.2.0/24 [90/2297856] via 172.16.12.2, 3d01h, Serial2/0
D EX     172.16.3.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D        172.16.23.0/24 [90/2681856] via 172.16.12.2, 3d00h, Serial2/0
D        172.16.100.0/24 [90/2297856] via 172.16.12.2, 3d01h, Serial2/0
D EX  192.168.20.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D EX  192.168.25.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D EX  192.168.30.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D EX  192.168.35.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D EX  192.168.40.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D EX  192.168.48.0/22 [170/2195456] via 172.16.12.2, 2d23h, Serial2/0
D     192.168.48.0/23 is a summary, 3d00h, Null0


R3#show ip route ospf | inc E2   
       E1 - OSPF external type 1, E2 - OSPF external type 2
O E2     172.16.1.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1
O E2     172.16.2.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1
O E2     172.16.12.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1
O E2  192.168.48.0/22 [110/20] via 172.16.23.2, 2d23h, Serial2/1
O E2  192.168.70.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1


R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#ip prefix-list ?
  WORD             Name of a prefix list
  sequence-number  Include/exclude sequence numbers in NVGEN

R2(config)#ip prefix-list EIGRP-FILTER-192.168.0.0/16 permit 172.16.0.0/16 le 24  // FILTER USING PREFIX LIST; PREFIX LIST IS PREFERRED THAN ACL SINCE ACL CONFIG CAN BE EXTENSIVE AND USES MORE CPU
R2(config)#router ospf 1
R2(config-router)#distribute-list ?
  <1-199>      IP access list number
  <1300-2699>  IP expanded access list number
  WORD         Access-list name
  gateway      Filtering incoming updates based on gateway
  prefix       Filter prefixes in routing updates
  route-map    Filter prefixes based on the route-map

R2(config-router)#distribute-list prefix EIGRP-FILTER-192.168.0.0/16 ?
  gateway  Filtering incoming updates based on gateway
  in       Filter incoming routing updates
  out      Filter outgoing routing updates

R2(config-router)#distribute-list prefix EIGRP-FILTER-192.168.0.0/16 out ?
  Async              Async interface
  Auto-Template      Auto-Template interface
  BVI                Bridge-Group Virtual Interface
  CDMA-Ix            CDMA Ix interface
  CTunnel            CTunnel interface
  Dialer             Dialer interface
  FastEthernet       FastEthernet IEEE 802.3
  GMPLS              MPLS interface
  LongReachEthernet  Long-Reach Ethernet interface
  Loopback           Loopback interface
  MFR                Multilink Frame Relay bundle interface
  Multilink          Multilink-group interface
  Null               Null interface
  Port-channel       Ethernet Channel of interfaces
  Serial             Serial
  Tunnel             Tunnel interface
  Vif                PGM Multicast Host interface
  Virtual-PPP        Virtual PPP interface
  Virtual-Template   Virtual Template interface
  Virtual-TokenRing  Virtual TokenRing
  bgp                Border Gateway Protocol (BGP)
  connected          Connected
  eigrp              Enhanced Interior Gateway Routing Protocol (EIGRP)
  lisp               Locator ID Separation Protocol (LISP)
  ospf               Open Shortest Path First (OSPF)
  ospfv3             OSPFv3
  rip                Routing Information Protocol (RIP)
  static             Static routes
  vmi                Virtual Multipoint Interface
  <cr>

R2(config-router)#distribute-list prefix EIGRP-FILTER-192.168.0.0/16 out eigrp ?      
  <1-65535>  Autonomous system number

R2(config-router)#distribute-list prefix EIGRP-FILTER-192.168.0.0/16 out eigrp 1
R2(config)#end                                                                
R2#


R3#show ip route ospf | inc E2      // VERIFY 192.168.0.0/16 ROUTES ARE FILTERED
       E1 - OSPF external type 1, E2 - OSPF external type 2
O E2     172.16.1.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1
O E2     172.16.2.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1
O E2     172.16.12.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1


R1#show ip route eigrp | b Gate
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks
D        172.16.2.0/24 [90/2297856] via 172.16.12.2, 3d01h, Serial2/0
D EX     172.16.3.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D        172.16.23.0/24 [90/2681856] via 172.16.12.2, 3d00h, Serial2/0
D        172.16.100.0/24 [90/2297856] via 172.16.12.2, 3d01h, Serial2/0
D EX  192.168.20.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D EX  192.168.25.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D EX  192.168.30.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D EX  192.168.35.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D EX  192.168.40.0/24 [170/2195456] via 172.16.12.2, 3d00h, Serial2/0
D     192.168.48.0/23 is a summary, 3d01h, Null0


R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#ip access-list standard R3-ACL-25-30   
R2(config-std-nacl)#permit 192.168.25.0 0.0.0.255
R2(config-std-nacl)#permit 192.168.30.0 0.0.0.255
R2(config-std-nacl)#exit
R2(config)#route-map ?
  WORD  Route map tag

R2(config)#route-map R3-FILTER-25-30 ?
  <0-65535>  Sequence to insert to/delete from existing route-map entry
  deny       Route map denies set operations
  permit     Route map permits set operations
  <cr>

R2(config)#route-map R3-FILTER-25-30 deny ?
  <0-65535>  Sequence to insert to/delete from existing route-map entry
  <cr>

R2(config)#route-map R3-FILTER-25-30 deny 10
R2(config-route-map)#match ?
  as-path           Match BGP AS path list
  clns              CLNS information
  community         Match BGP community list
  extcommunity      Match BGP/VPN extended community list
  interface         Match first hop interface of route
  ip                IP specific information
  ipv6              IPv6 specific information
  length            Packet length
  local-preference  Local preference for route
  mdt-group         Match routes corresponding to MDT group
  metric            Match metric of route
  mpls-label        Match routes which have MPLS labels
  policy-list       Match IP policy list
  route-type        Match route-type of route
  rpki              Match RPKI state of route
  source-protocol   Match source-protocol of route
  tag               Match tag of route

R2(config-route-map)#match ip ?
  address                Match address of route or match packet
  next-hop               Match next-hop address of route
  redistribution-source  route redistribution source (EIGRP only)
  route-source           Match advertising source address of route

R2(config-route-map)#match ip address R3-ACL-25-30
R2(config-route-map)#exit
R2(config)#route-map R3-FILTER-25-30 permit 20     // EXPLICIT PERMIT ALL
R2(config-route-map)#exit
R2(config)#router eigrp 1
R2(config-router)#redistribute ospf 1 ?   
  match      Redistribution of OSPF routes
  metric     Metric for redistributed routes
  route-map  Route map reference
  <cr>

R2(config-router)#redistribute ospf 1 route-map ?
  WORD  Pointer to route-map entries

R2(config-router)#redistribute ospf 1 route-map R3-FILTER-25-30 ?
  match   Redistribution of OSPF routes
  metric  Metric for redistributed routes
  <cr>

R2(config-router)#redistribute ospf 1 route-map R3-FILTER-25-30 metric ?
  <1-4294967295>  Bandwidth metric in Kbits per second

R2(config-router)#redistribute ospf 1 route-map R3-FILTER-25-30 metric 64 ?
  <0-4294967295>  EIGRP delay metric, in 10 microsecond units

R2(config-router)#redistribute ospf 1 route-map R3-FILTER-25-30 metric 64 100 ?       
  <0-255>  EIGRP reliability metric where 255 is 100% reliable

R2(config-router)#redistribute ospf 1 route-map R3-FILTER-25-30 metric 64 100 255 ?
  <1-255>  EIGRP Effective bandwidth metric (Loading) where 255 is 100% loaded

R2(config-router)#redistribute ospf 1 route-map R3-FILTER-25-30 metric 64 100 255 1 ?
  <1-65535>  EIGRP MTU of the path

R2(config-router)#redistribute ospf 1 route-map R3-FILTER-25-30 metric 64 100 255 1 1500        


R1#show ip route eigrp | b Gate        // VERIFY 192.168.25.0/24 AND 192.168.30.0/24 ROUTES ARE FILTERED
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks
D        172.16.2.0/24 [90/2297856] via 172.16.12.2, 3d01h, Serial2/0
D EX     172.16.3.0/24 [170/40537600] via 172.16.12.2, 00:03:25, Serial2/0
D        172.16.23.0/24 [90/2681856] via 172.16.12.2, 3d00h, Serial2/0
D        172.16.100.0/24 [90/2297856] via 172.16.12.2, 3d01h, Serial2/0
D EX  192.168.20.0/24 [170/40537600] via 172.16.12.2, 00:03:25, Serial2/0
D EX  192.168.35.0/24 [170/40537600] via 172.16.12.2, 00:03:25, Serial2/0
D EX  192.168.40.0/24 [170/40537600] via 172.16.12.2, 00:03:25, Serial2/0
D     192.168.48.0/23 is a summary, 3d01h, Null0


R3#show ip route ospf | inc E2      // CHANGE METRIC TYPE ON 172.16.12.0/24 ROUTE USING ROUTE MAP; ROUTE MAP IS MORE FLEXIBLE AND COMMONLY USE IN PBR AND BGP
       E1 - OSPF external type 1, E2 - OSPF external type 2
O E2     172.16.1.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1
O E2     172.16.2.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1
O E2     172.16.12.0/24 [110/20] via 172.16.23.2, 3d00h, Serial2/1


R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#ip prefix-list ?
  WORD             Name of a prefix list
  sequence-number  Include/exclude sequence numbers in NVGEN

R2(config)#ip prefix-list R1-172.16.12.0/24-25 ?     
  deny         Specify packets to reject
  description  Prefix-list specific description
  permit       Specify packets to forward
  seq          sequence number of an entry

R2(config)#ip prefix-list R1-172.16.12.0/24-25 permit ?
  A.B.C.D/nn  IP prefix <network>/<length>, e.g., 35.0.0.0/8

R2(config)#ip prefix-list R1-172.16.12.0/24-25 permit 172.16.12.0/24
R2(config)#route-map ?
  WORD  Route map tag

R2(config)#route-map R1-FILTER ?
  <0-65535>  Sequence to insert to/delete from existing route-map entry
  deny       Route map denies set operations
  permit     Route map permits set operations
  <cr>

R2(config)#route-map R1-FILTER permit ?
  <0-65535>  Sequence to insert to/delete from existing route-map entry
  <cr>

R2(config)#route-map R1-FILTER permit 10
R2(config-route-map)#? 
Route Map configuration commands:
  continue     Continue on a different entry within the route-map
  default      Set a command to its defaults
  description  Route-map comment
  exit         Exit from route-map configuration mode
  help         Description of the interactive help system
  match        Match values from routing table
  no           Negate a command or set its defaults
  set          Set values in destination routing protocol

R2(config-route-map)#match ?
  as-path           Match BGP AS path list
  clns              CLNS information
  community         Match BGP community list
  extcommunity      Match BGP/VPN extended community list
  interface         Match first hop interface of route
  ip                IP specific information
  ipv6              IPv6 specific information
  length            Packet length
  local-preference  Local preference for route
  mdt-group         Match routes corresponding to MDT group
  metric            Match metric of route
  mpls-label        Match routes which have MPLS labels
  policy-list       Match IP policy list
  route-type        Match route-type of route
  rpki              Match RPKI state of route
  source-protocol   Match source-protocol of route
  tag               Match tag of route

R2(config-route-map)#match ip ?
  address                Match address of route or match packet
  next-hop               Match next-hop address of route
  redistribution-source  route redistribution source (EIGRP only)
  route-source           Match advertising source address of route

R2(config-route-map)#match ip address ?
  <1-199>      IP access-list number
  <1300-2699>  IP access-list number (expanded range)
  WORD         IP access-list name
  prefix-list  Match entries of prefix-lists

R2(config-route-map)#match ip address prefix-list ?
  WORD  IP prefix-list name

R2(config-route-map)#match ip address prefix-list R1-172.16.12.0/24-25
R2(config-route-map)#set ?
  as-path           Prepend string for a BGP AS-path attribute
  automatic-tag     Automatically compute TAG value
  clns              OSI summary address
  comm-list         set BGP community list (for deletion)
  community         BGP community attribute
  dampening         Set BGP route flap dampening parameters
  default           Set default information
  extcomm-list      Set BGP/VPN extended community list (for deletion)
  extcommunity      BGP extended community attribute
  global            Set to global routing table
  interface         Output interface
  ip                IP specific information
  ipv6              IPv6 specific information
  level             Where to import route
  local-preference  BGP local preference path attribute
  metric            Metric value for destination routing protocol
  metric-type       Type of metric for destination routing protocol
  mpls-label        Set MPLS label for prefix
  origin            BGP origin code
  tag               Tag value for destination routing protocol
  traffic-index     BGP traffic classification number for accounting
  vrf               Define VRF name
  weight            BGP weight for routing table

R2(config-route-map)#set metric ?
  +/-<metric>     Add or subtract metric
  <0-4294967295>  Metric value or Bandwidth in Kbits per second

R2(config-route-map)#set metric 25
R2(config-route-map)#set metric-type ?
  external  IS-IS external metric
  internal  IS-IS internal metric or Use IGP metric as the MED for BGP
  type-1    OSPF external type 1 metric
  type-2    OSPF external type 2 metric

R2(config-route-map)#set metric-type type-1
R2(config-route-map)#exit
R2(config)#route-map R1-FILTER permit 20         // EXPLICIT PERMIT ALL                  
R2(config-route-map)#exit
R2(config)#router ospf 1
R2(config-router)#redistribute eigrp 1 subnets ?
  metric       Metric for redistributed routes
  metric-type  OSPF/IS-IS exterior metric type for redistributed routes
  nssa-only    Limit redistributed routes to NSSA areas
  route-map    Route map reference
  tag          Set tag for routes redistributed into OSPF
  <cr>

R2(config-router)#redistribute eigrp 1 subnets route-map ?
  WORD  Pointer to route-map entries

R2(config-router)#redistribute eigrp 1 subnets route-map R1-FILTER
R2(config-router)#end
R2#


R3#show ip route ospf | b Gateway
Gateway of last resort is not set

      172.16.0.0/16 is variably subnetted, 8 subnets, 2 masks
O E2     172.16.1.0/24 [110/20] via 172.16.23.2, 00:00:25, Serial2/1
O E2     172.16.2.0/24 [110/20] via 172.16.23.2, 00:00:25, Serial2/1
O E1     172.16.12.0/24 [110/89] via 172.16.23.2, 00:03:20, Serial2/1
O IA     172.16.100.0/24 [110/65] via 172.16.23.2, 3d00h, Serial2/1
O     192.168.8.0/22 is a summary, 3d00h, Null0

No comments:

Post a Comment