Sunday, August 18, 2013

Routing with OSPF in ASA

OSPF is a link-state routing protocol that can partition a network into a hierarchy of distinct numbered areas. Area 0 is always considered the backbone area of an OSPF domain or autonomous system, which must connect to all other areas.

When an OSPF router connects to two or more different areas, it is called an Area Border Router (ABR). When an OSPF router connects an area to a non-OSPF domain and it imports routing information from other sources into OSPF, it is called an Autonomous System Boundary Router (ASBR).

OSPF routers build a common database of the status of all links in the area by exchanging link-state advertisements (LSA). The routers build their routing tables by computing the shortest path first (SPF) algorithm based on that database. OSPF uses a path cost value, which is based on link bandwidth, as a routing metric. An ASA can support at most two different OSPF process.


For this scenario, we configured the ASA to use OSPF in exchanging routes with routers in Area 0.

ASA(config)# interface gigabitethernet0
ASA(config-if)# nameif outside
INFO: Security level for "outside" set to 0 by default.
ASA(config-if)# ip address 192.168.1.2 255.255.255.0
ASA(config-if)# no shutdown
ASA(config-if)# ospf ?

interface mode commands/options:
  authentication       Enable authentication
  authentication-key   Authentication password (key)
  cost                 Interface cost
  database-filter      Filter OSPF LSA during synchronization and flooding
  dead-interval        Interval after which a neighbor is declared dead
  hello-interval       Time between HELLO packets
  message-digest-key   Message digest authentication password (key)
  mtu-ignore           Ignores the MTU in DBD packets
  network              Network type
  priority             Router priority
  retransmit-interval  Time between retransmitting lost link state
                       advertisements
  transmit-delay       Link state transmit delay
ASA(config-if)# ospf cost ?

interface mode commands/options:
  <1-65535>  Cost
ASA(config-if)# ospf cost 10
ASA(config-if)# interface gigabitethernet1
ASA(config-if)# nameif inside
INFO: Security level for "inside" set to 100 by default.
ASA(config-if)# ip address 172.16.1.1 255.255.255.0
ASA(config-if)# ospf cost 10
ASA(config-if)# ospf authentication ?

interface mode commands/options:
  message-digest  Use message-digest authentication
  null            Use no authentication
  <cr>
ASA(config-if)# ospf authentication message-digest
ASA(config-if)# ospf message-digest-key ?

interface mode commands/options:
  <1-255>  Key ID
ASA(config-if)# ospf message-digest-key 1 ?

interface mode commands/options:
  md5  Use MD5 algorithm
ASA(config-if)# ospf message-digest-key 1 md5 cisco
ASA(config-if)#exit
ASA(config)# router ?

configure mode commands/options:
  eigrp  Enhanced Interior Gateway Routing Protocol (EIGRP)
  ospf   Open Shortest Path First (OSPF)
  rip    Routing Information Protocol (RIP)
ASA(config)# router ospf ?

configure mode commands/options:
  <1-65535>  Process ID
ASA(config)# router ospf 1
ASA(config-router)# ?

Router configuration commands:
  area                 OSPF area parameters
  compatible           OSPF compatibility list
  default-information  Control distribution of default information
  distance             Define an administrative distance
  exit                 Exit from router configuration mode
  help                 Interactive help for router subcommands
  ignore               Do not complain about specific event
  log-adj-changes      Log changes in adjacency state
  neighbor             Specify a neighbor router
  network              Add/remove interfaces to/from routing process
  no                   Negate a command
  redistribute         Redistribute information from another routing process
  router-id            router-id for this OSPF process
  summary-address      Configure IP address summaries
  timers               Adjust routing timers
ASA(config-router)# network ?

router mode commands/options:
  Hostname or A.B.C.D  Network address
ASA(config-router)# network 172.16.1.0 ?

router mode commands/options:
  A.B.C.D  Mask for network address
ASA(config-router)# network 172.16.1.0 255.255.255.0 ?

router mode commands/options:
  area  Set the OSPF area ID
ASA(config-router)# network 172.16.1.0 255.255.255.0 area ?

router mode commands/options:
  <0-18446744073709551615>  OSPF area ID as a decimal value
  Hostname or A.B.C.D       OSPF area ID
ASA(config-router)# network 172.16.1.0 255.255.255.0 area 0
ASA(config-router)# show route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

Gateway of last resort is not set

C    192.168.1.0 255.255.255.0 is directly connected, outside
ASA(config-router)# exit
ASA(config)# route outside 0 0 192.168.1.1
ASA(config)# show route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

Gateway of last resort is 192.168.1.1 to network 0.0.0.0

C    192.168.1.0 255.255.255.0 is directly connected, outside
S*   0.0.0.0 0.0.0.0 [1/0] via 192.168.1.1, outside


ASA# debug ospf ?

  adj
  database-timer
  events
  flood
  lsa-generation
  packet
  retransmission
  spf
  tree
  <cr>
ASA# debug ospf adj
OSPF adjacency events debugging is on
ASA# debug ospf events
OSPF events debugging is on
ASA# configure terminal
ASA(config)# interface gigabitethernet1
ASA(config-if)# no shutdown
ASA(config-if)#
OSPF: Interface inside going Up
OSPF: Send with youngest Key 1
OSPF: Build router LSA for area 0, router ID 192.168.1.2, seq 0x80000002
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: End of hello processing
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: 2 Way Communication to 172.16.1.2 on inside, state 2WAY
OSPF: Backup seen Event before WAIT timer on inside
OSPF: DR/BDR election on inside
OSPF: Elect BDR 192.168.1.2
OSPF: Elect DR 172.16.1.2
OSPF: Elect BDR 192.168.1.2
OSPF: Elect DR 172.16.1.2
       DR: 172.16.1.2 (Id)   BDR: 192.168.1.2 (Id)
OSPF: Send DBD to 172.16.1.2 on inside seq 0x1237 opt 0x2 flag 0x7 len 32
OSPF: Send with youngest Key 1
OSPF: End of hello processing
OSPF: Rcv DBD from 172.16.1.2 on inside seq 0x2283 opt 0x52 flag 0x7 len 32  mtu 1500 state EXSTART
OSPF: First DBD and we are not SLAVE
OSPF: Rcv DBD from 172.16.1.2 on inside seq 0x1237 opt 0x52 flag 0x2 len 92  mtu 1500 state EXSTART
OSPF: NBR Negotiation Done. We are the MASTER
OSPF: Send DBD to 172.16.1.2 on inside seq 0x1238 opt 0x2 flag 0x3 len 52
OSPF: Send with youngest Key 1
OSPF: Send with youngest Key 1
OSPF: Database request to 172.16.1.2
OSPF: sent LS REQ packet to 172.16.1.2, length 36
OSPF: Rcv DBD from 172.16.1.2 on inside seq 0x1238 opt 0x52 flag 0x0 len 32  mtu 1500 state EXCHANGE
OSPF: Send DBD to 172.16.1.2 on inside seq 0x1239 opt 0x2 flag 0x1 len 32
OSPF: Send with youngest Key 1
OSPF: Send with youngest Key 1
OSPF: Rcv DBD from 172.16.1.2 on inside seq 0x1239 opt 0x52 flag 0x0 len 32  mtu 1500 state EXCHANGE
OSPF: Exchange Done with 172.16.1.2 on inside
OSPF: Synchronized with 172.16.1.2 on inside, state FULL
OSPF: Send with youngest Key 1
OSPF: Build router LSA for area 0, router ID 192.168.1.2, seq 0x80000003
OSPF: Send with youngest Key 1
OSPF: Send with youngest Key 1
OSPF: Send with youngest Key 1
OSPF: Rcv hello from 172.16.1.2 area 0 from inside 172.16.1.2
OSPF: Neighbor change Event on interface inside
OSPF: DR/BDR election on inside
OSPF: Elect BDR 192.168.1.2
OSPF: Elect DR 172.16.1.2
       DR: 172.16.1.2 (Id)   BDR: 192.168.1.2 (Id)
OSPF: End of hello processing
ASA(config-if)# no debug ospf
ASA(config-if)# show route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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

Gateway of last resort is 192.168.1.1 to network 0.0.0.0

C    172.16.1.0 255.255.255.0 is directly connected, inside
O    10.1.10.1 255.255.255.255 [110/75] via 172.16.1.2, 0:00:36, inside
O    10.1.2.0 255.255.255.0 [110/74] via 172.16.1.2, 0:00:36, inside
O    10.1.1.0 255.255.255.0 [110/74] via 172.16.1.2, 0:00:36, inside
O    10.1.5.1 255.255.255.255 [110/75] via 172.16.1.2, 0:00:36, inside
C    192.168.1.0 255.255.255.0 is directly connected, outside
S*   0.0.0.0 0.0.0.0 [1/0] via 192.168.1.1, outside

ASA# show ospf ?

  <1-65535>            OSPF process id
  border-routers       Show OSPF border routers
  database             Show OSPF database
  flood-list           Show OSPF link state flood lists
  interface            Show OSPF information for a specific interface
  neighbor             Show OSPF neighbors
  request-list         Show OSPF link state request-lists
  retransmission-list  Show OSPF link state retransmission-lists
  summary-address      Show OSPF summary addresses
  virtual-links        Show OSPF virtual links
  |                    Output modifiers
  <cr>

ASA# show ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
172.16.1.2        1   FULL/DR         0:00:31     172.16.1.2      inside

ASA# show ospf database

       OSPF Router with ID (192.168.1.2) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
10.1.5.1        10.1.5.1        949         0x80000002 0x1a6b 3
10.1.10.1       10.1.10.1       898         0x80000002 0x274d 3
172.16.1.2      172.16.1.2      90          0x80000006 0x1776 5
192.168.1.2     192.168.1.2     88          0x80000003 0x3898 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
172.16.1.2      172.16.1.2      89          0x80000001 0x 589

ASA# ping 10.1.5.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.5.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/80/220 ms
ASA# ping 10.1.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/38/100 ms

1 comment:

  1. Hi,

    I studied again for the Cisco ROUTE and SWITCH since both are prerequisites.

    The usual materials I always use are the Cisco Press ARCH Official Cert Guide (OCG) and CBT nuggets video.

    Note ARCH 300-320 exam was recently updated. See helpful links:

    http://www.cisco.com/c/en/us/training-events/training-certifications/certifications/professional/ccdp.html

    https://learningnetwork.cisco.com/thread/95220

    https://www.cbtnuggets.com/it-training/cisco-ccdp-642-874-arch

    ReplyDelete