Pages

network cisco ccna gns3 certification arteq

network cisco ccna gns3 certification arteq
a network runs through it

Search insearchofthecert

Showing posts with label ios cookbook. Show all posts
Showing posts with label ios cookbook. Show all posts

Sunday, September 30, 2012

cookbook cost...

to change the cost of an ospf link use...

ip ospf cost (cost)

i cannot think of a good reason to ever do this... it might be instructive for a lab so that you could see something weird, or to illustrate why not to do this... use at your own risk...

onto something useful...

the summary of all summaries, as it were...

a default route is not automatically distributed to a neighbor...


however default-information originate will ship it next door...

light up ospf on r3 and r4 for area 1

r1#sh ip route

Gateway of last resort is not set

      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.1.1.0/24 is directly connected, Loopback1
L        1.1.1.1/32 is directly connected, Loopback1
      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C        10.1.1.0/24 is directly connected, FastEthernet0/0
L        10.1.1.1/32 is directly connected, FastEthernet0/0
C        10.1.2.0/24 is directly connected, FastEthernet1/1
L        10.1.2.1/32 is directly connected, FastEthernet1/1
O IA  192.168.1.0/24 [110/782] via 10.1.1.2, 00:03:55, FastEthernet0/0

now set up a default route on r2...

r2#sh ip route

Gateway of last resort is 192.168.1.2 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 192.168.1.2
      1.0.0.0/24 is subnetted, 1 subnets
O        1.1.1.0 [110/2] via 10.1.1.1, 00:05:29, FastEthernet0/0
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.1.1.0/24 is directly connected, FastEthernet0/0
L        10.1.1.2/32 is directly connected, FastEthernet0/0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Serial1/1
L        192.168.1.1/32 is directly connected, Serial1/1

r1#sh ip route

Gateway of last resort is not set

      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.1.1.0/24 is directly connected, Loopback1
L        1.1.1.1/32 is directly connected, Loopback1
      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C        10.1.1.0/24 is directly connected, FastEthernet0/0
L        10.1.1.1/32 is directly connected, FastEthernet0/0
C        10.1.2.0/24 is directly connected, FastEthernet1/1
L        10.1.2.1/32 is directly connected, FastEthernet1/1
O IA  192.168.1.0/24 [110/782] via 10.1.1.2, 00:08:09, FastEthernet0/0

note that on r2 the gateway of last resort is locally significant only...

default-information originate will distribute it...

r2(config)#router ospf 1
r2(config-router)#default-info originate

r1#sh ip route

Gateway of last resort is 10.1.1.2 to network 0.0.0.0

O*E2  0.0.0.0/0 [110/1] via 10.1.1.2, 00:00:24, FastEthernet0/0
      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.1.1.0/24 is directly connected, Loopback1
L        1.1.1.1/32 is directly connected, Loopback1
      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C        10.1.1.0/24 is directly connected, FastEthernet0/0
L        10.1.1.1/32 is directly connected, FastEthernet0/0
C        10.1.2.0/24 is directly connected, FastEthernet1/1
L        10.1.2.1/32 is directly connected, FastEthernet1/1
O IA  192.168.1.0/24 [110/782] via 10.1.1.2, 00:10:36, FastEthernet0/0

it shows as external type 2 by default...

r4#sh ip route

Gateway of last resort is 192.168.1.1 to network 0.0.0.0

O*E2  0.0.0.0/0 [110/1] via 192.168.1.1, 00:01:53, Serial1/1
      1.0.0.0/24 is subnetted, 1 subnets
O IA     1.1.1.0 [110/783] via 192.168.1.1, 00:09:00, Serial1/1
      10.0.0.0/24 is subnetted, 1 subnets
O IA     10.1.1.0 [110/782] via 192.168.1.1, 00:09:00, Serial1/1
      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.1.0/24 is directly connected, FastEthernet0/0
L        172.16.1.2/32 is directly connected, FastEthernet0/0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Serial1/1
L        192.168.1.2/32 is directly connected, Serial1/1

but you can change that...

r2(config-router)#default-info originate metric-type 1

r1#sh ip route

Gateway of last resort is 10.1.1.2 to network 0.0.0.0

O*E1  0.0.0.0/0 [110/2] via 10.1.1.2, 00:00:35, FastEthernet0/0
      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.1.1.0/24 is directly connected, Loopback1
L        1.1.1.1/32 is directly connected, Loopback1
      10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C        10.1.1.0/24 is directly connected, FastEthernet0/0
L        10.1.1.1/32 is directly connected, FastEthernet0/0
C        10.1.2.0/24 is directly connected, FastEthernet1/1
L        10.1.2.1/32 is directly connected, FastEthernet1/1
O IA  192.168.1.0/24 [110/782] via 10.1.1.2, 00:16:43, FastEthernet0/0

note the difference between type 1 and type 2... type 1 includes the internal cost...





cookbook ospf 2...


remove ospf from the interfaces... add network statements...

with ospf you can filter lsa's in but not out, unless you filter all of them out... but you love lsa's so don't do that...

r2#sh ip route ospf

Gateway of last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets
O        1.1.1.0 [110/2] via 10.1.1.1, 00:00:49, FastEthernet0/0

r2#sh access-list 1
Standard IP access list 1
    10 deny   1.1.1.0 (2 matches)
    20 permit any
r2#sh run | beg router
router ospf 1
 network 10.1.1.0 0.0.0.255 area 0
 distribute-list 1 in FastEthernet0/0

r2#sh ip route ospf
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

r2(config-router)#distribute-list 1 out f0/0
% Interface not allowed with OUT for OSPF

r2(config-router)#no access-list 1
r2(config)#do sh ip route ospf

Gateway of last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets
O        1.1.1.0 [110/2] via 10.1.1.1, 00:00:09, FastEthernet0/0

so be careful here, and listen to the cook:

It's important to remember that unlike EIGRP and RIP, OSPF uses a link state rather than a distance vector algorithm. One place where this difference becomes clear is in route filtering. At a minimum, every router in an area must see the LSAs for every other router in the same area. Depending on the type of area, it may also see summary LSAs representing routing information from other areas or other autonomous systems. These LSA packets are flooded throughout the area, with each router forwarding LSA information on to any downstream devices. Every router then separately computes the best routing table based on this link state information.
If you prevented a router from forwarding some of the LSA information, its downstream routers would not have a full link state database, and consequently wouldn't be able to generate an accurate routing table.

crookbook eigrp summ...

add loopbacks to r1... add auto-summary...

it is very contrived, suck it up...

interface Loopback1
 ip address 192.168.1.1 255.255.255.252
!
interface Loopback2
 ip address 192.168.1.9 255.255.255.252
!
interface Loopback3
 ip address 192.168.1.17 255.255.255.252

r2#sh ip route eigrp

Gateway of last resort is not set

D     1.0.0.0/8 [90/2297856] via 10.1.1.1, 00:00:16, Serial2/0
D     192.168.1.0/24 [90/2297856] via 10.1.1.1, 00:00:16, Serial2/0

auto summary makes summarization at the classful border...

lose it...

r2#sh ip route eigrp

Gateway of last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets
D        1.1.1.0 [90/2297856] via 10.1.1.1, 00:00:11, Serial2/0
      192.168.1.0/30 is subnetted, 3 subnets
D        192.168.1.0 [90/2297856] via 10.1.1.1, 00:00:11, Serial2/0
D        192.168.1.8 [90/2297856] via 10.1.1.1, 00:00:11, Serial2/0
D        192.168.1.16 [90/2297856] via 10.1.1.1, 00:00:11, Serial2/0

and you get them all...

to summarize at the longest prefix, count...

0 to 16 includes 0 and that means 17, so the summary needs to be more than 16 and less than 32...  256 minus 32 = 224 or /24 + 3 or /27...

int s2/0
ip summary-add eigrp 1 192.168.1.0 255.255.255.224

r2#sh ip route eigrp

Gateway of last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets
D        1.1.1.0 [90/2297856] via 10.1.1.1, 00:06:45, Serial2/0
      192.168.1.0/27 is subnetted, 1 subnets
D        192.168.1.0 [90/2297856] via 10.1.1.1, 00:00:16, Serial2/0

/28 doesn't get it...

int s2/0
ip summary-add eigrp 1 192.168.1.0 255.255.255.240

r2#sh ip route eigrp

Gateway of last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets
D        1.1.1.0 [90/2297856] via 10.1.1.1, 00:09:25, Serial2/0
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
D        192.168.1.0/27 [90/2297856] via 10.1.1.1, 00:02:56, Serial2/0
D        192.168.1.0/28 [90/2297856] via 10.1.1.1, 00:00:42, Serial2/0

this has been a public service announcement...

crookbook part 3...

add a loopback on r2, and change the configuration to r3 into a rip network...


r2

int lo4
ip add 4.4.4.4 255.255.255.0

router eigrp 1
no netw 172.16.1.0 0.0.0.255

router rip
netw 172.16.0.0
netw 4.0.0.0

r3

no router eigrp 1

router rip
netw 172.16.0.0
netw 3.0.0.0

r2#sh ip route | ex L | inc loop
    
Gateway of last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets
D        1.1.1.0 [90/2297856] via 10.1.1.1, 01:13:03, Serial2/0
      2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        2.2.2.0/24 is directly connected, Loopback0
R     3.0.0.0/8 [120/1] via 172.16.1.3, 00:00:15, FastEthernet0/0
      4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        4.4.4.0/24 is directly connected, Loopback4
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.1.1.0/24 is directly connected, Serial2/0
      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.1.0/24 is directly connected, FastEthernet0/0

redistribute rip into eigrp and eigrp into rip...

r2

router rip
redistribute eigrp 1 metric 5

router eigrp 1
redistribute rip metric 1 0 1 1 1500

r3#sh ip route | ex L | incl loop
      
Gateway of last resort is not set

R     1.0.0.0/8 [120/5] via 172.16.1.2, 00:00:25, FastEthernet0/0
R     2.0.0.0/8 [120/5] via 172.16.1.2, 00:00:25, FastEthernet0/0
      3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        3.3.3.0/24 is directly connected, Loopback0
R     4.0.0.0/8 [120/1] via 172.16.1.2, 00:00:25, FastEthernet0/0
R     10.0.0.0/8 [120/5] via 172.16.1.2, 00:00:25, FastEthernet0/0
      172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.16.1.0/24 is directly connected, FastEthernet0/0

note the redistributed eigrp routes are signified by R on the rip router...

while it is a different story on r1...

r1#sh ip route | exc L | inc loop
    
Gateway of last resort is not set

      1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        1.1.1.0/24 is directly connected, Loopback0
      2.0.0.0/24 is subnetted, 1 subnets
D        2.2.2.0 [90/2297856] via 10.1.1.2, 01:23:54, Serial2/0
D EX  3.0.0.0/8 [170/2560512000] via 10.1.1.2, 00:06:05, Serial2/0
      4.0.0.0/24 is subnetted, 1 subnets
D EX     4.4.4.0 [170/2560512000] via 10.1.1.2, 00:06:05, Serial2/0
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        10.1.1.0/24 is directly connected, Serial2/0
      172.16.0.0/24 is subnetted, 1 subnets
D EX     172.16.1.0 [170/2560512000] via 10.1.1.2, 00:06:05, Serial2/0

do the metrics really matter?

i'll let the crookbook satisfy that..

  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0

EIGRP uses these K values as coefficients in an involved equation that specifies how to combine all of these different individual metrics into a single numerical value, the composite EIGRP metric. You will notice that only K1 and K3 are nonzero. The result is that, by default, EIGRP uses only bandwidth and delay when computing its metric. So, in fact, you can generally fill in just about anything for the other parameters in the default-metric command, and it won't make any difference.
We note as an aside that while you can change these different K values by using the metric weights command, we strongly advise against changing the defaults. These values were of some use in IGRP, and when Cisco introduced EIGRP, with its superior DUAL algorithm, they carried the parameters forward. However, it was discovered that in practice it was relatively easy to make routing extremely unstable by changing them. And it's almost impossible to make things any better by changing these weight values in EIGRP.

so there...

eigrp crookbook eigrp 02...

add another router...


add to eigrp 1

r2

router eigrp 1
netw 172.16.1.0 0.0.0.255

r3

router eigrp 1
netw 172.16.1.0 0.0.0.255
netw 3.0.0.0

r3(config-router)#
*Sep 30 07:23:29: %DUAL-5-NBRCHANGE: EIGRP-IPv4 1: Neighbor 172.16.1.2 (FastEthernet0/0) is up: new adjacency

r1#sh ip route eigrp

Gateway of last resort is not set

      2.0.0.0/24 is subnetted, 1 subnets
D        2.2.2.0 [90/2297856] via 10.1.1.2, 00:24:40, Serial2/0
      3.0.0.0/24 is subnetted, 1 subnets
D        3.3.3.0 [90/2300416] via 10.1.1.2, 00:01:03, Serial2/0
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2172416] via 10.1.1.2, 00:01:45, Serial2/0

filter r3's loopback...

r2(config)#access-list 1 deny 3.3.3.0
r2(config)#access-list 1 permit any
r2(config)#router eigrp 1
r2(config-router)#distribute-list 1 in f0/0

this filters the loopback incoming to r2, and permits the rest...

r1#sh ip route eigrp

Gateway of last resort is not set

      2.0.0.0/24 is subnetted, 1 subnets
D        2.2.2.0 [90/2297856] via 10.1.1.2, 00:27:55, Serial2/0
      172.16.0.0/24 is subnetted, 1 subnets
D        172.16.1.0 [90/2172416] via 10.1.1.2, 00:05:00, Serial2/0

r3#sh ip route eigrp

Gateway of last resort is not set

      1.0.0.0/24 is subnetted, 1 subnets
D        1.1.1.0 [90/2300416] via 172.16.1.2, 00:06:58, FastEthernet0/0
      2.0.0.0/24 is subnetted, 1 subnets
D        2.2.2.0 [90/156160] via 172.16.1.2, 00:06:58, FastEthernet0/0
      10.0.0.0/24 is subnetted, 1 subnets
D        10.1.1.0 [90/2172416] via 172.16.1.2, 00:06:58, FastEthernet0/0

you can do the same outgoing from r2 to r3... we'll drop the advertisement to r3 of r1's loopback...

r2(config)#access-list 2 deny 1.1.1.0
r2(config)#access-list 2 permit any
r2(config)#router eigrp 1
r2(config-router)#distribute-list 2 out f0/0

r3#sh ip route eigrp

Gateway of last resort is not set

      2.0.0.0/24 is subnetted, 1 subnets
D        2.2.2.0 [90/156160] via 172.16.1.2, 00:11:05, FastEthernet0/0
      10.0.0.0/24 is subnetted, 1 subnets
D        10.1.1.0 [90/2172416] via 172.16.1.2, 00:11:05, FastEthernet0/0

r2#sh ip proto
*** IP Routing is NSF aware ***

Routing Protocol is "eigrp 1"
  Outgoing update filter list for all interfaces is not set
    FastEthernet0/0 filtered by 2 (per-user), default is not set
  Incoming update filter list for all interfaces is not set
    FastEthernet0/0 filtered by 1 (per-user), default is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP-IPv4 Protocol for AS(1)
    Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
    NSF-aware route hold timer is 240
    Router-ID: 2.2.2.2
    Topology : 0 (base)
      Active Timer: 3 min
      Distance: internal 90 external 170
      Maximum path: 4
      Maximum hopcount 100
      Maximum metric variance 1

  Automatic Summarization: disabled
  Maximum path: 4
  Routing for Networks:
    2.0.0.0
    10.0.0.0
    172.16.1.0/24
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.1.1.1              90      00:09:00
    172.16.1.3            90      00:03:39
  Distance: internal 90 external 170

prefix lists are mostly used to filter eigrp with bgp and the converse... we'll get to that later...

ios crookbook...

over the years i've spent a wad of cash on network books and training materials.  most i still have, others have gotten away... in the last few months cisco has been offering ebooks at cisco press for a very reduced rate... i have bought quite a few, and while i used to prefer hard copy, i have come to appreciate the portability of pdf, especially the ease with which i can scrape important pieces into anki for long term study...

i bumped into ios cookbook a while back, and with your friendly neighborhood google, you can find what appears to be a bootleg  online... i think it's in china or some shit, and i don't really care... if it's online, feel free to use it i say, and let the publishers go after the crooks... that's not my concern, and i don't make any money from any of this anyway...

there are many sections in the so called cookbooks, and they cut directly to the chase for configurations purposes... this seems useful... i decided to go through it starting with the routing protocol sections as a structured practice...

i'll start with eigrp... this is meant for those who have already been through the theory of the major concerns presented in numerous ways by many more adept  than myself... as usual, i'll start at the beginning and follow through...

simple eigrp...



r1

int lo0
ip add 1.1.1.1 255.255.255.0

int s2/0
ip add 10.1.1.1 255.255.255.0
clock rate 128000
no shut

router eigrp 1

netw 10.0.0.0
netw 1.0.0.0
no auto-summ

r2

int lo0
ip add 2.2.2.2 255.255.255.0

int s2/0
ip add 10.1.1.2 255.255.255.0
clock rate 128000
no shut

router eigrp 1
netw 2.0.0.0
no auto-summ

the code i have for the routers in gns3 uses no auto-summary by default... i will not be typing that again...

the router-id is selected using the same precedence as ospf... or you could manually configure it as well... wildcards can also be used in the network statements...


r2#sh ip eigrp topo
EIGRP-IPv4 Topology Table for AS(1)/ID(2.2.2.2)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status

P 2.2.2.0/24, 1 successors, FD is 128256
        via Connected, Loopback0
P 1.1.1.0/24, 1 successors, FD is 2297856
        via 10.1.1.1 (2297856/128256), Serial2/0
P 10.1.1.0/24, 1 successors, FD is 2169856
        via Connected, Serial2/0

r1#sh ip proto
*** IP Routing is NSF aware ***

Routing Protocol is "eigrp 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP-IPv4 Protocol for AS(1)
    Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
    NSF-aware route hold timer is 240
    Router-ID: 1.1.1.1
    Topology : 0 (base)
      Active Timer: 3 min
      Distance: internal 90 external 170
      Maximum path: 4
      Maximum hopcount 100
      Maximum metric variance 1

  Automatic Summarization: disabled
  Maximum path: 4
  Routing for Networks:
    1.0.0.0
    10.0.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.1.1.2              90      00:03:24
  Distance: internal 90 external 170

note default k values 1 0 1 0 0...

r2#sh 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

      1.0.0.0/24 is subnetted, 1 subnets
D        1.1.1.0 [90/2297856] via 10.1.1.1, 00:05:47, Serial2/0

r1#sh ip eigrp neigh
EIGRP-IPv4 Neighbors for AS(1)
H   Address                 Interface              Hold Uptime   SRTT   RTO  Q  Seq
                                                   (sec)         (ms)       Cnt Num
0   10.1.1.2                Se2/0                    11 00:19:23   13   100  0  7

next...