Saturday, 3 December 2011

Nugget 20
BGP Routing - Implementing Basic BGP Part 1





The lab is now setup as above, with OSPF being the interior routing protocol and BGP the external ... and well we will configure an internal BGP peering between R4 and R1 later.

Lets check out the commands at our disposal in BGP:


Router-5(config)#router bgp 6500
Router-5(config-router)#neighbor 10.1.45.1 ?
  activate                 Enable the Address Family for this Neighbor
  advertise-map            specify route-map for conditional advertisement
  advertisement-interval   Minimum interval between sending BGP routing updates
  allowas-in               Accept as-path with my AS present in it
  capability               Advertise capability to the peer
  default-originate        Originate default route to this neighbor
  description              Neighbor specific description
  disable-connected-check  One-hop away EBGP peer using loopback address
  distribute-list          Filter updates to/from this neighbor
  dmzlink-bw               Propagate the DMZ link bandwidth
  ebgp-multihop            Allow EBGP neighbors not on directly connected networks
  fall-over                session fall on peer route lost
  filter-list              Establish BGP filters
  inherit                  Inherit a template
  local-as                 Specify a local-as number
  maximum-prefix           Maximum number of prefixes accepted from this peer
  next-hop-self            Disable the next hop calculation for this neighbor
  next-hop-unchanged       Propagate the iBGP paths's next hop unchanged for this neighbor
  password                 Set a password
  peer-group               Member of the peer-group
  prefix-list              Filter updates to/from this neighbor
  remote-as                Specify a BGP neighbor
  remove-private-as        Remove private AS number from outbound updates
  route-map                Apply route map to neighbor
  route-reflector-client   Configure a neighbor as Route Reflector client
  send-community           Send Community attribute to this neighbor
  shutdown                 Administratively shut down this neighbor
  soft-reconfiguration     Per neighbor soft reconfiguration
  timers                   BGP per neighbor timers
  translate-update         Translate Update to MBGP format
  transport                Transport options
  ttl-security             BGP ttl security check
  unsuppress-map           Route-map to selectively unsuppress suppressed routes
  update-source            Source of routing updates
  version                  Set the BGP version to match a neighbor
  weight                   Set default weight for routes from this neighbor


Check out all them options!!! wow boi!
First thing we need to do, in order to get started and get this relationship up and running is the remote-as command, this will get the conversation flowing with OPEN msgs to the neighbour statement we are configuring.

Router-5(config-router)#neighbor 10.1.45.1 remote-as 5500




Router-5#show ip bgp summ
BGP router identifier 109.170.1x7.xx, local AS number 6500
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd <--seq of the DB it has recieved
10.1.45.1       4  5500       0       0        0    0    0 never    Active


Here we can see we have our configured neighbor .... totally dead (Up/Down column) at the moment, no messages sent or recieved.  Notice the state/PfxRcd is set to ACTIVE, this means the exact same thing as in the EIGRP world:

ACTIVE = BAD

It is actively trying to bring the relationship up (whereas EIGRP was actively trying to find a backup route)


Lets configure his buddy;

Router-4(config)#router bgp 5500
Router-4(config-router)#neighbor 10.1.45.2 remote-as 6500


Now, lets see how long it takes for the relationship to come up!.... remember this is a SLOW protocol:



Router-5#show clock
21:48:35.778 GB Sat Nov 19 2011
Router-5#
013151: Nov 19 21:48:50.025: %BGP-5-ADJCHANGE: neighbor 10.1.45.1 Up

Okay, 15 seconds, that came up pretty quick (bit dissapointed in away as jeremy - the instructor was saying it can take as long as 60 seconds!)


Router-4#show ip bgp sum
BGP router identifier 10.1.45.1, local AS number 5500
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
10.1.45.2       4  6500       8       7        1    0    0 00:04:36        0


So notice we have msgs being sent and recieved, BUT the state/PfxRcd column is still 0, thats because with BGP you can establish a neighbour and not send/exchange any routes/information ..... SO different to what we are used to!! (so is statically configuring the neighbours too! lol BUT i guess if it did auto discover neighbours, imagine the issues ISPs would have, peoples home routers bringing up BGP, peering with them and then injecting routes all over the place LOL)


Now for iBGP, there is no funky command or any funny business, it will just be when we enter the remote-as command we enter "our" internal AS and the router will know it will be an iBGP speaker.


As the plan goes, we plan to get a iBGP peering going with routers 1&4, even though, they are not directly connected :0)


First though, we need to setup some loopbacks for the peering of the relationships, as it would be silly peering with x1 of the physical interfaces, as if x1 of those interfaces where to go down, we would loose the BGP peering.
We also then need to advertise the loopbacks into the internal routing protocol (OSPF) so the rest of the network knows about them (otherwise the BGP messages would not make it from either iBGP speaker)



Router-4#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router-4(config)#inter loopback4
Router-4(config-if)#ip address 4.4.4.4 255.255.255.255
Router-4(config-if)#exit
Router-4(config)#router ospf 1
Router-4(config-router)#network 4.4.4.4 0.0.0.0 area 0



lets do the same for Router-1, but first double check he is now seeing this new loopback;

Router-1#show ip route

     4.0.0.0/32 is subnetted, 1 subnets
O       4.4.4.4 [110/75] via 10.1.12.2, 00:01:02, Ethernet0/0
                [110/75] via 10.1.13.2, 00:01:02, Serial0/0



Swweeet, lets do the loopback on this router too;


Router-1(config)#inter loopback1
Router-1(config-if)#ip address 1.1.1.1 255.255.255.255
Router-1(config-if)#exit
Router-1(config)#router ospf 1
Router-1(config-router)#network 1.1.1.1 0.0.0.0 area 0


lets configure the BGP part now on both routers;

Router-4(config)#router bgp 5500
Router-4(config-router)#neighbor 1.1.1.1 remote-as 5500

Router-1(config)#router bgp 5500
Router-1(config-router)#neighbor 4.4.4.4 remote-as 5500


BUT the neighbourship will NEVER form;

Router-1#show ip bgp summary

BGP router identifier 1.1.1.1, local AS number 5500
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
4.4.4.4         4  5500       0       0        0    0    0 never    Active


BECAUSE .... the BGP packets will be hitting the neighbour with a source interface IP address which wont be the loopback (whichever OSPF determines the quicker path to the neighbour), therefore the relationship will not form as the BGP router has no idea who that interface is/belongs too, it wont be the statically configured IP in the neighbour command!!

So to fix this, we can use the update-source command, here we can specify the loopback of Router-4
Router-4(config)#router bgp 5500
Router-4(config-router)#neighbor 1.1.1.1 update-source loopback 4



lets go do the other router:


Router-1(config)#router bgp 5500
Router-1(config-router)#neighbor 4.4.4.4 update-source loopback 1



ah ha ...

Router-1#
000018: *Mar  1 01:52:30.823: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up



Router-1#show ip bgp summ
BGP router identifier 1.1.1.1, local AS number 5500
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
4.4.4.4         4  5500       3       4        1    0    0 00:00:37        0



Notice, we now have no ACTIVE state and a 0 for the revision of the BGP database.

Over on router-4 we have the iBGP and eBGP neighbourships up;

Router-4#show ip bgp summ
BGP router identifier 10.1.45.1, local AS number 5500
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
1.1.1.1         4  5500      10       9        1    0    0 00:06:10        0
10.1.45.2       4  6500      52      51        1    0    0 00:48:19        0


just for clarification and sanity checking:

Router-4#show ip bgp neighbors
BGP neighbor is 1.1.1.1,  remote AS 5500, internal link  <---iBGP

 Index 2, Offset 0, Mask 0x4
  BGP version 4, remote router ID 1.1.1.1
  BGP state = Established, table version = 1, up for 00:08:10
  Last read 00:00:10, hold time is 180, keepalive interval is 60 seconds
  Minimum time between advertisement runs is 5 seconds
  Received 12 messages, 0 notifications, 0 in queue
  Sent 11 messages, 0 notifications, 0 in queue
  Prefix advertised 0, suppressed 0, withdrawn 0
  Connections established 1; dropped 0
  Last reset never
  0 accepted prefixes consume 0 bytes
  0 history paths consume 0 bytes
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 4.4.4.4, Local port: 11012
Foreign host: 1.1.1.1, Foreign port: 179


BGP neighbor is 10.1.45.2,  remote AS 6500, external link  <----eBGP
 Index 1, Offset 0, Mask 0x2

  BGP version 4, remote router ID 109.170.1x7.xx (my public IP range)
  BGP state = Established, table version = 1, up for 00:50:50
  Last read 00:00:50, hold time is 180, keepalive interval is 60 seconds
  Minimum time between advertisement runs is 30 seconds
  Received 54 messages, 0 notifications, 0 in queue
  Sent 53 messages, 0 notifications, 0 in queue
  Prefix advertised 0, suppressed 0, withdrawn 0
  Connections established 1; dropped 0
  Last reset never
  0 accepted prefixes consume 0 bytes
  0 history paths consume 0 bytes


BUT, we still have no BGP routes;

Router-4#show ip bgp

Becuase the neighbours and networks/routes are seperated in BGP unlike other routing protocols, whereby you have neighbours and you are told of the routes they know (via the network command under the routing protocol, which would tell the router what interfaces to advertise on and what networks to advertise into the process) ...

So with BGP, we have neighbour commands to bring up neighbour relationships BUT then to get the routing aspect we have to then apply the network commands, so they are totally seperate with BGP.


Right before we get BGP exchanging routes, lets just look at an example and at the same time tidy up our relationship with Router-5 (lets get it using a loopack interface tooo)



Router-5(config)#interface loopback5
Router-5(config-if)#ip address 5.5.5.5 255.255.255.255

Plus we need a static route to our neighbour, as if we were an ISP, we would not be running an interior routing protocol;
Router-5(config-if)#ip route 4.4.4.4 255.255.255.255 10.1.45.1



test;
Router-5#ping 4.4.4.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms


Now lets set a static on Router-4 to reach Router-5's (the ISP) loopback, as currently this router does not no anything about the 5.5.5.5 network;

Router-4(config)#ip route 5.5.5.5 255.255.255.255 10.1.45.2
Router-4#ping 5.5.5.5


Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms



Lets just say for a moment, that say we had to links (T1 lines) going to the same ISP, we could have another static route on the ISP end and have that point to a 2nd loopback interface and then the cisco router would perform load balancing (see diagram above)


 HOWEVER there is a rule for eBGP, and that is the neighbours MUST BE DIRECTLY CONNECTED, although we may be thinking well, yeah they are, the router has to pass through the routers interface to get to the loopback, and so see's it as being more than 1 hop away ...


SO, this can be fixed by apply the update-source command and setting it to the loopback 4.4.4.4 and then with this command:


Router-4(config-router)#neighbor 5.5.5.5 ebgp-multihop ?
  <1-255>  maximum hop count
  <cr>

Router-4(config-router)#neighbor 5.5.5.5 ebgp-multihop 2


But again, be careful as for routing loops!! recommended is no more than 5!

RIGHT, so lets watch the neighbourship come up after i apply this on both routers;



Router-4(config)#router bgp 5500
Router-4(config-router)#neighbor 5.5.5.5 ebgp-multihop 2
Router-4(config-router)#neighbor 5.5.5.5 update-source loopback 4



Router-5(config)#router bgp 6500
Router-5(config-router)#neighbor 4.4.4.4 ebgp-multihop 2
Router-5(config-router)#neighbor 4.4.4.4 update-source loopback 5
Router-5(config-router)#
013233: Nov 19 23:22:28.467: %BGP-5-ADJCHANGE: neighbor 4.4.4.4 Up


Router-5#show ip bgp summ

BGP router identifier 109.170.1x7.xx, local AS number 6500
BGP table version is 1, main routing table version 1

Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
4.4.4.4         4  5500       3       4        1    0    0 00:00:57        0


SWEEET, without that multihop command this neighbour would never of come up.

RIGHT, lets get on with part 2

Thursday, 1 December 2011

Been prepping the LAB ready for some BGP flavour, broke down my lab from the CCNA, so i have two labs now,

1 x for redistribution and filtering
1 x BGP awesomeness

The BGP lab is now build and IP'd up, just gotta smack OSPF on it then i can run with the BGP lab nuggets ..... wont be studying tonight, got a chinese tonight with the family:0)

Tuesday, 29 November 2011

Nugget 20
BGP Routing - Implementing Basic BGP 1


An Autonomous System (AS) is the foundation of everything ,it represents the networks under
1 authority.


There are public AS's and private AS's

IBGP = a relationship between 2 BGP speakers in the  same AS
EBGP = is used when the two routers are different AS's (like the BGP relationship you would have if you were to peer with your ISP)



NEED to make mind change, as neighbours are now redefined .... as opposed to how we think of them with other routing protocols

Neighbours DONT have to be directly connected! they can form through routers! becuase BGP rides ONTOP of your existing network infastructure...say OSPF/EIGRP etc

USUALLY BGP does NOT REPLACE an internal routing protocol, it really is used to establish relationships with the outside world.



Thru this relationship the ISPs can exchange routes via you, so this means they end up using you as a path to reach each the other ISP (so you are a transit AS)



You can solve this by redistribution, but interior routing protocols are not designed to handle hundreds of megabyte's of routing tables, OSPF wont handle it etc ... so although this is not WISE, you can do this if you redistribute a small subset of networks


You could also bring up a WAN link between these two routers (IBGP) to directly connect them to solve this problem .... or you could run BGP on the other router ... but this needs to be able to support the hardware requirements etc ...


Nugget 19
BGP Routing - Foundation Concepts and Planning

NOTES:
The BGP series - CCIP/CCIE focuses on the cloud in BGP
whereas this series CCNP focuses on us, the customer/corporate SME/SMB

usually when running routing protocols people focus on the routes and traffic
outbound! but with BGP the main concern/focus is inbound

email/web servers , not to worried about peeps surfing web/vpn etc

organisations want redundancy so that people accessing the incoming corporate
infrastructure


How it works
You get a public block
advertise route out to both isps, then that is flooded to rest of community
if isp is unavailble then other isp has peer with with another isp


2 uses
BGP = typical aim is to make ur company redutant
BGP = shortest paths to destinations (even though bandwidth the same, maybe less hops)

Equals multihoming







NOTES ABOUT THE FACTS
Most routing protocols we have looked at so far, OSPF, EIGRP they are their own layer 4 protocol and have own reliability mechanisms ....

BGP runs on top of TCP (port 179) ... TCP already has its own reliability (ACks) so BGP uses these when sending updates, if not recieved, BGP will resend the update ..typical TCP behaviour)

METRIC - compound metric very tuneable - BGP attributes (10 or so) it goes through these attributes looking for something to break the tie.


SLOWEST PROTOCOL to converge (u can but dont!!!... well, you can use iBGP)
why use it, think of how many networks/routers a second go down on the internet ... loads and all the time! this would swarm us in chaos with updates!!!


STYLES of BGP


DEFAULT ROUTE ONLY BGP implementation



PARTIAL routing table BGP implementation


FULL routing table BGP implementation
You need a router beefy enough to hold the full routing table of the internet TWICE! if multihoming with x2 isps (like 100 odd MB each or 300MB if x3 ISPS ... etc)

although only x1 route will go into the routing table, the router still maintains the other routes in the BGP table

This is the most flexible approach and you can really shape your network to how you want it, BUT it is the most resource consuming too!

Sunday, 27 November 2011

STEP 4. Enable filtering using the assigned route tags to ensure redistributed routes do not cause any looping issues.


So, we want to make sure any tags that we sent out via EIGRP do not come back round in via R3 via OSPF

We already have a route-map (EIGRP-TO-OSPF) in place that is marking the routes and setting the metrics



We also want to block the routes with tags 10,20 and 30 coming back in via OSPF into EIGRP.



R2(config)#route-map EIGRP-TO-OSPF deny 5
R2(config-route-map)#match tag 40

R2(config)#route-map OSPF-TO-EIGRP deny 5
R2(config-route-map)#match tag 10 20 30 
(when aligned this acts as OR, when on new line, its AND)




So just to clarify;
route-map OSPF-TO-EIGRP, deny, sequence 5
  Match clauses:
    tag 10 20 30
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
route-map OSPF-TO-EIGRP, permit, sequence 10
  Match clauses:
  Set clauses:
    metric 400 20 255 1 1500
    tag 40


Lets to do the same on R3

route-map EIGRP-TO-OSPF deny 5
match tag 40

route-map OSPF-TO-EIGRP deny 5
match tag 10 20 30




STEP 5.
R3 has the preferred route to reach the 10.1.0.0/24 network. Ensure routers prefer this path over the path from R2.



Lets check which route R4 currently favours for the 10.1.0.0/24;


R4#traceroute 10.1.0.1

Type escape sequence to abort.
Tracing the route to 10.1.0.1

  1 10.1.24.2 4 msec 4 msec 4 msec
  2 10.1.12.1 8 msec 4 msec *


As expected we go to R2, then R1

R4 knows about the route via EIGRP from R2:

R4#show ip route 10.1.0.0
Routing entry for 10.1.0.0/24
  Known via "eigrp 100", distance 170, metric 6430720
  Tag 40, type external
  Redistributing via eigrp 100
  Last update from 10.1.24.2 on FastEthernet0/0, 00:11:24 ago
  Routing Descriptor Blocks:
  * 10.1.24.2, from 10.1.24.2, 00:11:24 ago, via FastEthernet0/0
      Route metric is 6430720, traffic share count is 1
      Total delay is 1200 microseconds, minimum bandwidth is 400 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 1


RIGHT, so we have to make the route from R3 look "better" than the route from R2


Looking at the routing tables, R3 has the route 10.1.0.0/24 with an AD of 170
R2 has the route with an AD of 110 ... so even if we were to play with metrics, it still would NOT matter,

One approach is we could lower the Admin Distance of External routes of EIGRP to say 105 (anything below the AD of OSPF which is 110)



Lets try it;

currently R2's route for 10.1.0.0 is

R2#show ip route | i 10.1.0.0
O       10.1.0.0/24 [110/782] via 10.1.12.1, 00:52:01, Serial0/0



R2(config)#router eigrp 100
R2(config-router)#distance eigrp ?
  <1-255>  Distance for internal routes

R2(config-router)#distance eigrp 90 ?  
  <-- dont need to change internal, keep at default
  <1-255>  Distance for external routes

R2(config-router)#distance eigrp 90 105



00:55:49: %DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 10.1.24.4 (Ethernet0/0) is down: route configuration changed
00:55:49: %DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 10.1.23.3 (Serial0/1) is down: route configuration changed
00:55:51: %DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 10.1.23.3 (Serial0/1) is up: new adjacency
00:55:53: %DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 10.1.24.4 (Ethernet0/0) is up: new adjacency



SO boys n gals, whadda reckon ......

R2#show ip route | i 10.1.0.0
D EX    10.1.0.0/24 [105/6917120] via 10.1.23.3, 00:02:12, Serial0/1


YEAH BOI!!! check that out! R2 is now favouring the route via R3 with the new Admin Distance of 105, which beats the OSPF AD!

lets check the route on R4 again:


R4#tracerou 10.1.0.1

Type escape sequence to abort.
Tracing the route to 10.1.0.1

  1 10.1.24.2 4 msec 4 msec 4 msec
  2 10.1.23.3 8 msec 4 msec 4 msec 
  <---- THEREs our bud, R3!!!
  3 10.1.13.1 4 msec 4 msec *



NOW! that is kool, very kool, BUT we do have to be careful with and where we make these changes, becuase if say we also go and make this change on R3, we would create ourself an infinite loop! as R3 would prefer R2 over R1 to get to 10.1.0.0/24, the packet would go back over to R2, same thing, it is going to prefer R3 ... and round and round we go! ... although split horizon would prolly kick in, but the point is still valid!

Gotta be careful with advanced route redistribution

Saturday, 26 November 2011

18 - IPv4 Redistribution - Implementing Advanced Redistribution

Lets get basic routing over OSPF and EIGRP, ready for our redistribution (R2 and R3)

STEP 1

R1(config)#router ospf 1
R1(config-router)#network 10.0.0.0 0.255.255.255 area 0

R4(config)#router eigrp 100
R4(config-router)#no auto-summary
R4(config-router)#network 10.0.0.0


R2(config)#router ospf 1
R2(config-router)#network 10.1.12.0 0.0.0.255 area 0

03:51:46: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.0.1 on Serial0/0 from LOADING to FULL, Loading Done



R2(config)#router eigrp 100
R2(config-router)#no auto-summary
R2(config-router)#network 10.1.24.0 0.0.0.255

03:52:54: %DUAL-5-NBRCHANGE: IP-EIGRP 100: Neighbor 10.1.24.4 (Ethernet0/0) is up: new adjacency



R3(config)#router ospf 1
R3(config-router)#network 10.1.13.0 0.0.0.255 area 0

*Mar  1 03:54:04.403: %OSPF-5-ADJCHG: Process 1, Nbr 10.1.0.1 on FastEthernet0/0 from LOADING to FULL, Loading Done



R3(config)#router eigrp 100
R3(config-router)#network 10.1.23.0 255.255.255.0




So Router 2 now sees all routes from both domains:

R2#show ip

     10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
O       10.1.13.0/24 [110/791] via 10.1.12.1, 00:05:04, Serial0/0
C       10.1.12.1/32 is directly connected, Serial0/0
C       10.1.12.0/24 is directly connected, Serial0/0
D       10.4.4.0/24 [90/409600] via 10.1.24.4, 00:06:40, Ethernet0/0
O       10.1.0.0/24 [110/782] via 10.1.12.1, 00:05:04, Serial0/0
D       10.4.2.0/24 [90/409600] via 10.1.24.4, 00:06:40, Ethernet0/0
D       10.4.3.0/24 [90/409600] via 10.1.24.4, 00:06:40, Ethernet0/0
D       10.4.0.0/24 [90/409600] via 10.1.24.4, 00:06:40, Ethernet0/0
D       10.4.1.0/24 [90/409600] via 10.1.24.4, 00:06:40, Ethernet0/0
C       10.1.24.0/24 is directly connected, Ethernet0/0
C       10.1.23.0/24 is directly connected, Serial0/1



STEP 1 COMPLETE

STEP 2
Enable full, mutual redistribution on R2 and R3 between OSPF and EIGRP. The 10.4.0.0/24 and 10.4.1.0/24 subnets should have a seed metric of 100 and an OSPF tag of 10 while the 10.4.2.0/24 and 10.4.3.0/24 subnets should have a seed metric of 200 and an OSPF tag of 20. All other subnets redistributed into OSPF should have a seed metric of 300 and an OSPF tag of 30. OSPF routes redistributed into EIGRP should have a seed metric of BW: 400 DLY: 20 REL: 255 LD: 1 MTU: 1500 and a tag of 40. Finally, external OSPF routes should not increment their metric as they pass through the OSPF domain.




last part of STEP 2:
external OSPF routes should not increment their metric as they pass through the OSPF domain. - is an E2 route (what we covered in last lab)



SO, best way forward, ACLs with route maps, lets group the networks by what metrics they need and go from there:


R2(config)#ip access-list standard METRIC100
R2(config-std-nacl)#permit 10.4.0.0 0.0.0.255
R2(config-std-nacl)#permit 10.4.1.0 0.0.0.255

R2(config-std-nacl)#ip access-list standard METRIC200
R2(config-std-nacl)#permit 10.4.2.0 0.0.0.255
R2(config-std-nacl)#permit 10.4.3.0 0.0.0.255

R2(config-std-nacl)#ip access-list standard DENY-10.4.4.0
R2(config-std-nacl)#permit 10.4.4.0 0.0.0.255

R2(config)#route-map EIGRP-TO-OSPF
R2(config-route-map)#match ip address METRIC100
R2(config-route-map)#set metric 100
R2(config-route-map)#set tag 10

AWESOME! so lets check that baby out:

R2#show route-map EIGRP-TO-OSPF
route-map EIGRP-TO-OSPF, permit, sequence 10
  Match clauses:
    ip address (access-lists): METRIC100
  Set clauses:
    metric 100
    tag 10
  Policy routing matches: 0 packets, 0 bytes



SWEEET!!!! SOOOO SOOO KOOL!



route-map EIGRP-TO-OSPF permit 20
 match ip address METRIC200
 set metric 200
 set tag 20

route-map EIGRP-TO-OSPF deny 25
  <- - DENY THE ACL TRAFFIC.... which we are PERMITTING in the below ACL
 match ip address DENY-10.4.4.0

NOTE, Had we of denied the subnet 10.4.4.0/24 in the ACL, we would have needed to use PERMIT in the above sequence 25
GET THIS, if you DENY at the sequence level of the route-map and deny at the ACL too, it permits it! so 2 negatives make a positive! lol, SO rule of thumb (the Jeremy way) keep route-maps at permit and do the denies at the ACL, keeps it simplier.

route-map EIGRP-TO-OSPF permit 30  <- - NO MATCH, so MATCHES EVERYTHING THAT HASN'T ALREADY BEEN MATCHED BY THE PREVIOUS SEQEUENCES!
 set metric 300
 set tag 30



So the above also takes care of step 3 in our objective;
3. Ensure the 10.4.4.0/24 network does not reach the OSPF routing domain.

SO, we now have our tastey route-map as follows:

route-map EIGRP-TO-OSPF, permit, sequence 10
  Match clauses:
    ip address (access-lists): METRIC100
  Set clauses:
    metric 100
    tag 10
  Policy routing matches: 0 packets, 0 bytes
route-map EIGRP-TO-OSPF, permit, sequence 20
  Match clauses:
    ip address (access-lists): METRIC200
  Set clauses:
    metric 200
    tag 20
  Policy routing matches: 0 packets, 0 bytes
route-map EIGRP-TO-OSPF, deny, sequence 25
  Match clauses:
    ip address (access-lists): DENY-10.4.4.0
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
route-map EIGRP-TO-OSPF, permit, sequence 30
  Match clauses:
  Set clauses:
    metric 300
    tag 30
  Policy routing matches: 0 packets, 0 bytes



YY-EEE-AAAAH BOI!!!! thats what im talking about!
Lets apply this bad muftha, we need to go under the OSPF process, as this is filtering EIGRP TO OSPF

R2(config)#router ospf 1
R2(config-router)#redistribute eigrp 100 subnets route-map EIGRP-TO-OSPF


DONT need to set metric or tags as that is all down in the route-map, lets check it out on R1!!!


R1#show ip route

     10.0.0.0/8 is variably subnetted, 10 subnets, 2 masks
C       10.1.12.2/32 is directly connected, Serial0/0
C       10.1.13.0/24 is directly connected, Ethernet0/0
C       10.1.12.0/24 is directly connected, Serial0/0
C       10.1.0.0/24 is directly connected, Loopback0
O E2    10.4.2.0/24 [110/200] via 10.1.12.2, 00:00:09, Serial0/0
O E2    10.4.3.0/24 [110/200] via 10.1.12.2, 00:00:09, Serial0/0
O E2    10.4.0.0/24 [110/100] via 10.1.12.2, 00:00:09, Serial0/0
O E2    10.4.1.0/24 [110/100] via 10.1.12.2, 00:00:09, Serial0/0
O E2    10.1.24.0/24 [110/300] via 10.1.12.2, 00:00:09, Serial0/0
O E2    10.1.23.0/24 [110/300] via 10.1.12.2, 00:00:09, Serial0/0


SWEEEEEEET! check it out! check out them metrics! and notice the WAN links 10.1.23 & .24.0/24 have the metric of 300!!!

lets check the TAGs (although not doing anything at the mooooo, but) :

R1#show ip route 10.4.2.0
Routing entry for 10.4.2.0/24
  Known via "ospf 1", distance 110, metric 200
  Tag 20, type extern 2, forward metric 781
  Last update from 10.1.12.2 on Serial0/0, 00:05:48 ago

R1#show ip route 10.4.0.0
Routing entry for 10.4.0.0/24
  Known via "ospf 1", distance 110, metric 100
  Tag 10, type extern 2, forward metric 781
  Last update from 10.1.12.2 on Serial0/0, 00:05:32 ago

R1#show ip route 10.1.24.0
Routing entry for 10.1.24.0/24
  Known via "ospf 1", distance 110, metric 300
  Tag 30, type extern 2, forward metric 781
  Last update from 10.1.12.2 on Serial0/0, 00:06:53 ago



Lets apply the same route-map to our other re-distribution router R3;

R3(config)#route-map EIGRP-TO-OSPF permit 10
 match ip address METRIC100
 set metric 100
 set tag 10
!
route-map EIGRP-TO-OSPF permit 20
 match ip address METRIC200
 set metric 200
 set tag 20
!
route-map EIGRP-TO-OSPF deny 25
 match ip address DENY-10.4.4.0
!
route-map EIGRP-TO-OSPF permit 30
 set metric 300
 set tag 30

and apply the ACL's

R3(config)#ip access-list standard DENY-10.4.4.0
 permit 10.4.4.0 0.0.0.255
ip access-list standard METRIC100
 permit 10.4.0.0 0.0.0.255
 permit 10.4.1.0 0.0.0.255
ip access-list standard METRIC200
 permit 10.4.2.0 0.0.0.255
 permit 10.4.3.0 0.0.0.255



lets check R1 now;

R1#show ip route

     10.0.0.0/8 is variably subnetted, 10 subnets, 2 masks
C       10.1.12.2/32 is directly connected, Serial0/0
C       10.1.13.0/24 is directly connected, Ethernet0/0
C       10.1.12.0/24 is directly connected, Serial0/0
C       10.1.0.0/24 is directly connected, Loopback0
O E2    10.4.2.0/24 [110/200] via 10.1.13.3, 00:00:58, Ethernet0/0
O E2    10.4.3.0/24 [110/200] via 10.1.13.3, 00:00:58, Ethernet0/0
O E2    10.4.0.0/24 [110/100] via 10.1.13.3, 00:02:44, Ethernet0/0
O E2    10.4.1.0/24 [110/100] via 10.1.13.3, 00:02:44, Ethernet0/0
O E2    10.1.24.0/24 [110/300] via 10.1.13.3, 00:00:58, Ethernet0/0
O E2    10.1.23.0/24 [110/300] via 10.1.13.3, 00:00:58, Ethernet0/0



SO now, we need to look at redistributing the other way, OSPF --> EIGRP


R2(config)#route-map OSPF-TO-EIGRP
R2(config-route-map)#set metric ?                 <--NO match needed, this will match ALL
  +/-<metric>     Add or subtract metric
  <0-4294967295>  Metric value or Bandwidth in Kbits per second
  <cr>


R2(config-route-map)#set metric 400 20 255 1 1500
  <--(set all K-Values)
R2(config-route-map)#set tag 40

Apply the route-map to the re-distribution process for OSPF;

R2(config)#router eigrp 100
R2(config-router)#redistribute ospf 1 route-map OSPF-TO-EIGRP

(Apply this route map to R3 as well)

Lets check the routing table of R4;

R4#show ip route

     10.0.0.0/8 is variably subnetted, 11 subnets, 2 masks
D EX    10.1.13.0/24 [170/6430720] via 10.1.24.2, 00:01:33, FastEthernet0/0
D EX    10.1.12.1/32 [170/6430720] via 10.1.24.2, 00:01:33, FastEthernet0/0
D EX    10.1.12.0/24 [170/6430720] via 10.1.24.2, 00:01:33, FastEthernet0/0
C       10.4.4.0/24 is directly connected, Loopback4
D EX    10.1.0.0/24 [170/6430720] via 10.1.24.2, 00:01:33, FastEthernet0/0
C       10.4.2.0/24 is directly connected, Loopback2
C       10.4.3.0/24 is directly connected, Loopback3
C       10.4.0.0/24 is directly connected, Loopback0
C       10.4.1.0/24 is directly connected, Loopback1
C       10.1.24.0/24 is directly connected, FastEthernet0/0
D       10.1.23.0/24 [90/2195456] via 10.1.24.2, 01:44:40, FastEthernet0/0


R4#show ip route 10.1.0.0
Routing entry for 10.1.0.0/24
  Known via "eigrp 100", distance 170, metric 6430720
  Tag 40, type external
  Redistributing via eigrp 100
  Last update from 10.1.24.2 on FastEthernet0/0, 00:02:07 ago
  Routing Descriptor Blocks:
  * 10.1.24.2, from 10.1.24.2, 00:02:07 ago, via FastEthernet0/0
      Route metric is 6430720, traffic share count is 1
      Total delay is 1200 microseconds, minimum bandwidth is 400 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 1

R4#show ip route 10.1.12.0
Routing entry for 10.1.12.0/24
  Known via "eigrp 100", distance 170, metric 6430720
  Tag 40, type external
  Redistributing via eigrp 100
  Last update from 10.1.24.2 on FastEthernet0/0, 00:04:19 ago
  Routing Descriptor Blocks:
  * 10.1.24.2, from 10.1.24.2, 00:04:19 ago, via FastEthernet0/0
      Route metric is 6430720, traffic share count is 1
      Total delay is 1200 microseconds, minimum bandwidth is 400 Kbit
      Reliability 255/255, minimum MTU 1500 bytes
      Loading 1/255, Hops 1


And the Tags are there tooo

RIGHT, lets take on Step 4 tomorrow:

4. Enable filtering using the assigned route tags to ensure redistributed routes do not cause any looping issues.

Friday, 25 November 2011

Nugget 17
IPv4 Redistribution - Implementing Simple Redistribution Steps 3 & 4

Lets crack on with the next step now steps 1 & 2 are complete;

Step 3.
Implement distribute-list filtering in such a way that the OSPF domain only sees odd numbered loopback networks coming from R1. Any even numbered subnet (including physical networks) should be hidden from OSPF.

So looking at the diagram again, we are going to need to advertise the follow loopbacks only to OSPF:

Advertise the ODD Routes
10.1.1.0/24
10.1.3.0/24
10.1.5.0/24

BUT hide the EVEN routes:

10.1.0.0/24
10.1.2.0/24
10.1.4.0/24
10.1.6.0/24

and including the physical interface;
10.1.12.0/24


Lets create an ACL that the distribution-list can use (always try and give a descriptive name to the ACL so we know what it does!):

R2(config)#ip access-list standard ODD-OSPF-NETWORKS
R2(config-std-nacl)#permit 10.1.1.0 0.0.0.255
R2(config-std-nacl)#permit 10.1.3.0 0.0.0.255
R2(config-std-nacl)#permit 10.1.5.0 0.0.0.255


Lets apply the ACL so it actually does something, this is done under the OSPF process;

R2(config-std-nacl)#router ospf 1
R2(config-router)#distribute-list ODD-OSPF-NETWORKS ?
  in   Filter incoming routing updates
  out  Filter outgoing routing updates


So the direction is key here, this is done from router2's perspective, so we want to filter the routes we advertise OUT to R3







So now we know the direction, lets check the routes we can see on R3 before we apply the distribution-list;




R3#show ip route

     10.0.0.0/8 is variably subnetted, 17 subnets, 3 masks
C       10.1.11.0/30 is directly connected, Loopback11
C       10.1.10.0/24 is directly connected, Loopback10
C       10.1.9.0/24 is directly connected, Loopback9
C       10.1.8.0/24 is directly connected, Loopback8
C       10.1.11.4/30 is directly connected, Loopback12
O E2    10.1.12.1/32 [110/100] via 10.1.23.2, 00:59:49, Serial1/0
O E2    10.1.12.0/24 [110/100] via 10.1.23.2, 00:59:49, Serial1/0
O E2    10.1.3.0/24 [110/100] via 10.1.23.2, 00:59:49, Serial1/0
C       10.1.11.8/30 is directly connected, Loopback13
C       10.1.2.0/24 is directly connected, FastEthernet0/0
O E2    10.1.1.0/24 [110/100] via 10.1.23.2, 00:59:49, Serial1/0
O E2    10.1.0.0/24 [110/100] via 10.1.23.2, 00:59:49, Serial1/0
C       10.1.7.0/24 is directly connected, Loopback7
O E2    10.1.6.0/24 [110/100] via 10.1.23.2, 00:59:49, Serial1/0
O E2    10.1.5.0/24 [110/100] via 10.1.23.2, 00:59:49, Serial1/0
O E2    10.1.4.0/24 [110/100] via 10.1.23.2, 00:59:49, Serial1/0
C       10.1.23.0/24 is directly connected, Serial1/0


So notice we have even and off routes being seen in OSPF, lets apply the distribution list;

R2(config-std-nacl)#router ospf 1
R2(config-router)#distribute-list ODD-OSPF-NETWORKS out

I'm all excited!! lets jump over and check R3!!!;


R3#show ip route

     10.0.0.0/8 is variably subnetted, 12 subnets, 2 masks
C       10.1.11.0/30 is directly connected, Loopback11
C       10.1.10.0/24 is directly connected, Loopback10
C       10.1.9.0/24 is directly connected, Loopback9
C       10.1.8.0/24 is directly connected, Loopback8
C       10.1.11.4/30 is directly connected, Loopback12
O E2    10.1.3.0/24 [110/100] via 10.1.23.2, 01:07:10, Serial1/0
C       10.1.11.8/30 is directly connected, Loopback13
C       10.1.2.0/24 is directly connected, FastEthernet0/0
O E2    10.1.1.0/24
[110/100] via 10.1.23.2, 01:07:10, Serial1/0
C       10.1.7.0/24 is directly connected, Loopback7
O E2    10.1.5.0/24 [110/100] via 10.1.23.2, 01:07:10, Serial1/0
C       10.1.23.0/24 is directly connected, Serial1/0



SWEEEET! sure enough we are now only seeing the ODD numbered subnets from the EIGRP domain :0)

STEP 3 COMPLETE

P.S
R2#show ip access-list ODD-OSPF-NETWORKS
Standard IP access list ODD-OSPF-NETWORKS
    permit 10.1.1.0, wildcard bits 0.0.0.255 (1 match)<----
    permit 10.1.3.0, wildcard bits 0.0.0.255 (1 match)<----
    permit 10.1.5.0, wildcard bits 0.0.0.255 (1 match)<---- YEAH BOI!





4. Implement route-map filtering in such a way that the EIGRP domain does not see routes with a more specific subnet mask than /24.

SO we could just accomplish this with an ACL and specify the /24 routes only are permitted, but thats boring, we are going to check out prefix-lists!

So prefix lists are here to help us get very specific with subnetmasks with route filtering and BGP, however we can also them to apply to route redistribution (remember to give them a meaning name, just like the ACLs)

So prefix lists work by given the prefix-list a name, they i would like to permit/deny the general network and mask, then we allow the specific mask;


R2(config)#ip prefix-list /24-MASK permit 10.0.0.0/8 ?
  ge  Minimum prefix length to be matched
  le  Maximum prefix length to be matched
  <cr>


SO if i was to press enter now, it would only allow JUST that mask 10.0.0.0/8 (Class A), so we would be denying pretty much everything, including the WAN links (the name of the prefix-list is /24-MASK)


R2(config)#ip prefix-list /24-MASK permit 10.0.0.0/8 le 24

So the above command (as an example, lets say a route of 10.1.7.0/24 comes into the router2, the router will check the prefix-list and check that it belongs to the 10. network (Class A 10.0.0.0/8), which it does, next it will see if it is LESS than or equal to /24, in this case, yes it is equal to /24, the router PERMITs the route to pass over to the other side.

HOWEVER the 10.1.11.8/30 is not LESS than /24, it is GREATER than a /24, so he is denied.



R2(config)#ip prefix-list /24-MASK permit 10.0.0.0/8 le 24
So its kind of a range really, from the 10.0.0.0/8 ------> le or ge /24 or /30 Soooo you can do this;


R2(config)#ip prefix-list /24-MASK permit 10.0.0.0/8 ge /16 le /24

how kool is that, so we can really pin down what subnets are allowed, between a range!

SO know we can create a route map which can use the prefix-list, as the route-map is pretty much if and then statements, but they are actually called match and set, your'll see:


R2(config)#route-map FILTER_OSPF_TO_EIGRP
R2(config-route-map)#match ip address prefix-list /24-MASK



R2#show route-map FILTER_OSPF_TO_EIGRP
route-map FILTER_OSPF_TO_EIGRP, permit, sequence 10
  Match clauses:
    ip address prefix-lists: /24-MASK
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes


So the route-map is permitting (thats the default) anything that matches the prefix-list /24-MASK

NOW the kool part, we need to go under the EIGRP process and apply it to the re-distribution!
But first, lets just check the routes that R1 can see now


R1#show ip route

     10.0.0.0/8 is variably subnetted, 17 subnets, 3 masks
D EX    10.1.11.0/30 [170/26137600] via 10.1.12.2, 01:45:44, Serial0/0
D EX    10.1.10.0/24 [170/26137600] via 10.1.12.2, 01:45:44, Serial0/0
D EX    10.1.9.0/24 [170/26137600] via 10.1.12.2, 01:45:44, Serial0/0
D EX    10.1.8.0/24 [170/26137600] via 10.1.12.2, 01:45:44, Serial0/0
D EX    10.1.11.4/30 [170/26137600] via 10.1.12.2, 01:45:44, Serial0/0
C       10.1.12.2/32 is directly connected, Serial0/0
C       10.1.12.0/24 is directly connected, Serial0/0
D EX    10.1.11.8/30 [170/26137600] via 10.1.12.2, 01:45:44, Serial0/0
C       10.1.3.0/24 is directly connected, Loopback3
C       10.1.2.0/24 is directly connected, Ethernet0/0
C       10.1.1.0/24 is directly connected, Loopback1
C       10.1.0.0/24 is directly connected, Loopback0
D EX    10.1.7.0/24 [170/26137600] via 10.1.12.2, 01:45:44, Serial0/0
C       10.1.6.0/24 is directly connected, Loopback6
C       10.1.5.0/24 is directly connected, Loopback5
C       10.1.4.0/24 is directly connected, Loopback4
D EX    10.1.23.0/24 [170/26137600] via 10.1.12.2, 01:46:01, Serial0/0



R2(config)#router eigrp 100
R2(config-router)#redistribute ospf 1 metric 100 100 100 100 100 route-map FILTER_OSPF_TO_EIGRP



R1#show ip route

     10.0.0.0/8 is variably subnetted, 14 subnets, 2 masks
D EX    10.1.10.0/24 [170/26137600] via 10.1.12.2, 01:47:23, Serial0/0
D EX    10.1.9.0/24 [170/26137600] via 10.1.12.2, 01:47:23, Serial0/0
D EX    10.1.8.0/24 [170/26137600] via 10.1.12.2, 01:47:23, Serial0/0
C       10.1.12.2/32 is directly connected, Serial0/0
C       10.1.12.0/24 is directly connected, Serial0/0
C       10.1.3.0/24 is directly connected, Loopback3
C       10.1.2.0/24 is directly connected, Ethernet0/0
C       10.1.1.0/24 is directly connected, Loopback1
C       10.1.0.0/24 is directly connected, Loopback0
D EX    10.1.7.0/24 [170/26137600] via 10.1.12.2, 01:47:23, Serial0/0
C       10.1.6.0/24 is directly connected, Loopback6
C       10.1.5.0/24 is directly connected, Loopback5
C       10.1.4.0/24 is directly connected, Loopback4
D EX    10.1.23.0/24 [170/26137600] via 10.1.12.2, 01:47:39, Serial0/0



YAYE! it works! only the /24's subnets are showing
SO to confirm and clarify;


R2#show route-map FILTER_OSPF_TO_EIGRP
route-map FILTER_OSPF_TO_EIGRP, permit, sequence 10
  Match clauses:
    ip address prefix-lists: /24-MASK
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
<-- wont see matching as we are not performing policy routing(yet)


R2#show ip prefix-list /24-MASK
ip prefix-list /24-MASK: 1 entries
   seq 5 permit 10.0.0.0/8 le 24



NUGGET COMPLETE, ROLL
on the advanced lab!