Wednesday 3 April 2013


How to configure EIGRP with RIP on same network


In this article we will discuss how can two routing protocols exist in same network? We have discussed basic of both EIGRP and RIP in our pervious article. Now we will go in more depth by including both RIP and EIGRP in same network.

Scenario

You are the administrator at computernetworkingnotes.com. Company network is given below
Rip with eigrp on same network
R0
PortIP addressConnected to
F0/080.0.0.1R1 F0/1
F1/090.0.0.1R2 F0/1
F1/1100.0.0.1R3 F0/1
R1
PortIP addressConnected to
F0/0.1010.0.0.1S1 F0/24
F0/0.2020.0.0.1S1 F0/24
F0/180.0.0.2R0 F0/0
S0/0/030.0.0.1R2 S0/0
R2
PortIP addressConnected to
F0/190.0.0.2R0 F1/0
S0/030.0.0.2R1 S0/0/0
F0/040.0.0.1WR1 0/1
S0/150.0.0.1R3 S0/0/1
R3
PortIP addressConnected to
F0/1100.0.0.2R0 F1/1
S0/0/150.0.0.2R2 S0/1
F0/0.6060.0.0.1S1 G0/1
F0/0.7070.0.0.1S1 G0/1
IP address and other necessary configurations are already done on routers, switches, and on pc's, you need only to configure routing.
Company has 3 main routers R1, R2, R3 connected via serial cable. All these routers are also connected with R0 for backup. Your task is to configure routing protocols on these routers. Backup route should only use when main route is down. IP address and other necessary configuration is already done on all devices. You are only required to configure routing protocols on routers.
Download pre configured topology form here and load it in packet tracer
In this scenario R0 is only providing backup to main links of R1, R2, R3. And it should only use in the failure of main links. This is a tricky question. Its directly related to administrative distance. As we know Administrative distance of RIP is 120 and EIGRP is 90. If both protocol exist on same router and have path for destination, EIGRP path will be chosen by default as it have low AD value. And in routing decision low AD value is winner.

Configuration of R0

First we will configure R0. To configure double click on R0 select CLI and configure it as given below
To configure and enable RIP as backup routing on R0 follow these commands exactly.
R0>enable
R0#sh ip interface brief
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        80.0.0.1        YES manual up                    up

FastEthernet1/0        90.0.0.1        YES manual up                    up

FastEthernet1/1        100.0.0.1       YES manual up                    up
R0#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R0(config)#router rip
R0(config-router)#network 80.0.0.0
R0(config-router)#network 90.0.0.0
R0(config-router)#network 100.0.0.0
R0(config-router)#exit
R0(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R0#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
R0#
We need not to configure EIGRP on it as its only going to be a backup route

Configuration of R1

Now configure R1. On R1 we need to configure both RIP and EIGRP. RIP for backup and EIGRP for main route.
R1>enable
R1#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        unassigned      YES manual up                    up

FastEthernet0/0.10     10.0.0.1        YES manual up                    up

FastEthernet0/0.20     20.0.0.1        YES manual up                    up

FastEthernet0/1        80.0.0.2        YES manual up                    up

Serial0/0/0            30.0.0.1        YES manual up                    up

Serial0/0/1            unassigned      YES manual administratively down down

Vlan1                  unassigned      YES manual administratively down down
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#router rip
R1(config-router)#network 10.0.0.0
R1(config-router)#network 20.0.0.0
R1(config-router)#network 30.0.0.0
R1(config-router)#network 80.0.0.0
R1(config-router)#exit
R1(config)#router eigrp 1
R1(config-router)#network 10.0.0.0
R1(config-router)#network 20.0.0.0
R1(config-router)#network 30.0.0.0
R1(config-router)#exit
R1(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R1#copy run start
Destination filename [startup-config]?
Building configuration...
[OK]
R1#
Why did we not include network 80.0.0.0 in EIGRP routing?
Network 80.0.0.0 is connecting R1 to R0 which is backup route. And only going to be used In the failure of main EIGRP route.
If we include network 80.0.0.0 in EIGRP routing, still R1 will take main EIGRP (via R2) route to reach R3 why?
Because by default Matrix of EIGRP is bandwidth and delay, and in this scenario backup route (R1 – R0 – R3) is using Ethernet cable link and main EIGRP route ( R1 – R2 – R3) is using serial cable link. Serial link have better matrix then Ethernet link that's why R1 will take main EIGRP route to reach R3.

Configuration of R2

To configure and enable eigrp with rip routing on R2 follow these commands exactly.
Router>enable
R2#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        40.0.0.1        YES manual up                    up

FastEthernet0/1        90.0.0.2        YES manual up                    up

Serial0/0              30.0.0.2        YES manual up                    up

Serial0/1              50.0.0.1        YES manual up                    up
R2#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#router rip
R2(config-router)#network 30.0.0.0
R2(config-router)#network 40.0.0.0
R2(config-router)#network 50.0.0.0
R2(config-router)#network 90.0.0.0
R2(config-router)#exit
R2(config)#router eigrp 1
R2(config-router)#network 30.0.0.0
R2(config-router)#
R2(config-router)#network 40.0.0.0
R2(config-router)#network 50.0.0.0
R2(config-router)#exit
R2(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R2#

Configuration of R3

To configure and enable eigrp with rip routing on R3 follow these commands exactly.
Router>enable
R3#show ip interface brief
Interface              IP-Address      OK? Method Status                Protocol

FastEthernet0/0        unassigned      YES manual up                    up

FastEthernet0/0.60     60.0.0.1        YES manual up                    up

FastEthernet0/0.70     70.0.0.1        YES manual up                    up

FastEthernet0/1        100.0.0.2       YES manual up                    up

Serial0/0/0            unassigned      YES manual administratively down down

Serial0/0/1            50.0.0.2        YES manual up                    up

Vlan1                  unassigned      YES manual administratively down down
R3#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router rip
R3(config-router)#network 50.0.0.0
R3(config-router)#network 60.0.0.0
R3(config-router)#network 70.0.0.0
R3(config-router)#network 100.0.0.0
R3(config-router)#exit
R3(config)#router eigrp 1
R3(config-router)#network 50.0.0.0
R3(config-router)#network
R3(config-router)#network 60.0.0.0
R3(config-router)#network 70.0.0.0
R3(config-router)#exit
R3(config)#exit
%SYS-5-CONFIG_I: Configured from console by console
R3#

Testing of EIGRP with RIP

Now we have configured both RIP and EIGRP in this network. To test this network double click on PC-PT PC0 and select command prompt tracert 70.0.0.3
trace 70.0.0.3
As you can see image R1 is taking Main EIGRP route to rich at R3
Now remove the serial cable by using red cross sign shown in right control panel
eigrp with rip
Now again tracert 70.0.0.3 from PC0 
trace pc
As you can see in image this time R1 takes R0 to reach R3 because Main EIGRP route is down
We have a configured topology here for cross checking if you have done any error in configuration. Download it and check where you have done mistake

OSPF - Concept and Configuration


How to configure open shortest path first routing protocol

In this article I will demonstrate an example of OSPF Routing configuration. We will use four different series router so you can get familiar with all different platform covered in CCNA exam. Create a topology as shown in figure.
static route configurations
1841 Series Router0 (R1)
FastEthernet0/0Serial0/0/0
IP address10.0.0.120.0.0.1
Connected WithPc0R2 on Serial 0/0
2811 Series Router0 (R4)
FastEthernet0/0Serial0/0/0
IP address50.0.0.140.0.0.2
Connected WithPc1R3 on Serial 0/0
2621XM Series Router0 (R3)
FastEthernet0/0Serial0/0/0
IP address30.0.0.240.0.0.1
Connected WithFastEthernet0/0R4 on Serial 0/0/0
2620XM Series Router1 (R2)
FastEthernet0/0Serial0/0
IP address30.0.0.120.0.0.2
Connected WithR3 on FastEthernet0/0R1 on Serial 0/0/0
PC-PT PC0
FastEthernet0Default Gateway
IP address10.0.0.210.0.0.1
Connected WithR1 on FastEthernet0/0
PC-PT PC1
FastEthernet0Default Gateway
IP address50.0.0.250.0.0.1
Connected WithR4 on FastEthernet0/0
Configuring OSPF is slightly different from configuring RIP. When configuring OSPF, use the following syntax:
Router(config)# router ospf process_ID
Router(config-router)# network IP_address wildcard_mask area area_#
The process_ID is locally significant and is used to differentiate between OSPF processes running on the same router. Your router might be a boundary router between two OSPF autonomous systems, and to differentiate them on your router, you will give them unique process IDs. Note that these numbers do not need to match between different routers so they have nothing to do with autonomous system numbers.
To configure any router double click on it and select CLI.To configure this topology use this step by step guide.

(1841Router0) Hostname R1

To configure and enable ospf routing on R1 follow these commands exactly.
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R1
R1(config)#interface fastethernet 0/0
R1(config-if)#ip address 10.0.0.1 255.0.0.0
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#exit
R1(config)#interface serial 0/0/0
R1(config-if)#ip address 20.0.0.1 255.0.0.0
R1(config-if)#clock rate 64000
R1(config-if)#bandwidth 64
R1(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
R1(config-if)#exit
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
R1(config)#router ospf 1
R1(config-router)#network 10.0.0.0 0.255.255.255 area 0
R1(config-router)#network 20.0.0.0 0.255.255.255 area 0
R1(config-router)#exit
R1(config)#

(2620XM-Router1) Hostname R2

To configure and enable ospf routing on R2 follow these commands exactly.
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R2
R2(config)#interface serial 0/0
R2(config-if)#ip address 20.0.0.2 255.0.0.0
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
R2(config-if)#exit
R2(config)#interface fastethernet 0/0
R2(config-if)#ip address 30.0.0.1 255.0.0.0
R2(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
R2(config-if)#exit
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R2(config)#router ospf 2
R2(config-router)#network 20.0.0.0 0.255.255.255 area 0
R2(config-router)#network 3
00:03:10: %OSPF-5-ADJCHG: Process 2, Nbr 20.0.0.1 on Serial0/0 from
 LOADING to FULL, Loading Done0.0.0.0 0.255.255.255 area 0
R2(config-router)#network 30.0.0.0 0.255.255.255 area 0
R2(config-router)#exit
R2(config)#

(2620XM-Router2)Hostname R3

To configure and enable ospf routing on R3 follow these commands exactly.
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R3
R3(config)#interface fastethernet 0/0
R3(config-if)#ip address 30.0.0.2 255.0.0.0
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R3(config-if)#interface serial 0/0
R3(config-if)#ip address 40.0.0.1 255.0.0.0
R3(config-if)#clock rate 64000
R3(config-if)#bandwidth 64
R3(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0, changed state to down
R3(config-if)#exit
%LINK-5-CHANGED: Interface Serial0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
R3(config)#router ospf 3
R3(config-router)#network 40.0.0.0 0.255.255.255 area 0
R3(config-router)#network 30.0.0.0 0.255.255.255 area 0
00:04:53: %OSPF-5-ADJCHG: Process 3, Nbr 30.0.0.1 on FastEthernet0/0 from
 LOADING to FULL, Loading D
R3(config-router)#exit
R3(config)#
%SYS-5-CONFIG_I: Configured from console by console
R3#

(2811Router3) Hostname R4

To configure and enable ospf routing on R4 follow these commands exactly.
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 40.0.0.2 255.0.0.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
Router(config-if)#exit
Router(config)#interface fastethernet 0/0
Router(config-if)#ip address 50.0.0.1 255.0.0.0
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
R4(config)#router ospf 4
R4(config-router)#network 50.0.0.0 0.255.255.255 area 0
R4(config-router)#network 40.0.0.0 0.255.255.255 area 0
R4(config-router)#
00:06:32: %OSPF-5-ADJCHG: Process 4, Nbr 40.0.0.1 on Serial0/0/0 from
LOADING to FULL, Loading Done
R4(config-router)#exit
R4(config)#

PC-1

PC>ipconfig

IP Address......................: 10.0.0.2
Subnet Mask.....................: 255.0.0.0
Default Gateway.................: 10.0.0.1

PC>ping 50.0.0.2

Pinging 50.0.0.2 with 32 bytes of data:

Reply from 50.0.0.2: bytes=32 time=156ms TTL=124
Reply from 50.0.0.2: bytes=32 time=127ms TTL=124
Reply from 50.0.0.2: bytes=32 time=156ms TTL=124
Reply from 50.0.0.2: bytes=32 time=140ms TTL=124

Ping statistics for 50.0.0.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 127ms, Maximum = 156ms, Average = 144ms
PC>

PC-2

PC>ipconfig

IP Address......................: 50.0.0.2
Subnet Mask.....................: 255.0.0.0
Default Gateway.................: 50.0.0.1

PC>ping 10.0.0.2

Pinging 10.0.0.2 with 32 bytes of data:

Reply from 10.0.0.2: bytes=32 time=140ms TTL=124
Reply from 10.0.0.2: bytes=32 time=141ms TTL=124
Reply from 10.0.0.2: bytes=32 time=157ms TTL=124
Reply from 10.0.0.2: bytes=32 time=156ms TTL=124

Ping statistics for 10.0.0.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 140ms, Maximum = 157ms, Average = 148ms
You can verify that ospf is running successfully via show ip protocols command in privilege mode.
R4#show ip protocols

Routing Protocol is "ospf 4"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 50.0.0.1
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    50.0.0.0 0.255.255.255 area 0
    40.0.0.0 0.255.255.255 area 0
  Routing Information Sources:
    Gateway         Distance      Last Update
    40.0.0.1             110      00:01:26
  Distance: (default is 110)

R4#
You can use show ip route command to troubleshoot ospf network. If you did not see information about any route checks the router attached with that network.
R4#show ip 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

O    10.0.0.0/8 [110/1564] via 40.0.0.1, 00:02:37, Serial0/0/0
O    20.0.0.0/8 [110/1563] via 40.0.0.1, 00:02:37, Serial0/0/0
O    30.0.0.0/8 [110/782] via 40.0.0.1, 00:02:37, Serial0/0/0
C    40.0.0.0/8 is directly connected, Serial0/0/0
C    50.0.0.0/8 is directly connected, FastEthernet0/0
R4#
To test ospf routing do ping from pc1 to pc2 and vice versa. If you get replay then you have successfully configured ospf routing but if you did not get replay double check this configuration and try to troubleshoot. I have uploaded a configured and tested topology in case you are unable to locate the problem spot then download this configuration file. And try to find out where have you committed mistake

Configuration command of OSPF


CommandsDescriptions
Router(config)#router ospf 1
Starts OSPF process 1. The process ID is any positive integer value between 1 and 65,535.
Router(config-router)#network 172.16.0.0 0.0.255.255 area 0
OSPF advertises interfaces, not networks. Uses the wildcard mask to determine which interfaces to advertise.
Router(config-if)#ip ospf hellointerval timer 20
Changes the Hello Interval timer to 20 seconds.
Router(config-if)#ip ospf deadinterval 80
Changes the Dead Interval timer to 80 seconds.
NOTE: Hello and Dead Interval timers must match for routers to become neighbors
Router#show ip protocol
Displays parameters for all protocols running on the router
Router#show ip route
Displays a complete IP routing table
Router#show ip ospf
Displays basic information about OSPF routing processes
Router#show ip ospf interface
Displays OSPF info as it relates to all interfaces
Router#show ip ospf interface fastethernet 0/0
Displays OSPF information for interface fastethernet 0/0
Router#show ip ospf border-routers
Displays border and boundary router information
Router#show ip ospf neighbor
Lists all OSPF neighbors and their states
Router#show ip ospf neighbor detail
Displays a detailed list of neighbors
Router#clear ip route *
Clears entire routing table, forcing it to rebuild
Router#clear ip route a.b.c.d
Clears specific route to network a.b.c.d
Router#clear ip opsf counters
Resets OSPF counters
Router#clear ip ospf process
Resets entire OSPF process, forcing OSPF to re-create neighbors, database, and routing table
Router#debug ip ospf events
Displays all OSPF events
Router#debug ip ospf adjacency
Displays various OSPF states and DR/ BDR election between adjacent routers
Router#debug ip ospf packets
Displays OPSF packets


OSPF Open Shortest Path First Routing protocol


Biggest advantage of OSPF over EIGRP is that it will run on any device as its based on open standard

Advantages

  • It will run on most routers, since it is based on an open standard.
  • It uses the SPF algorithm, developed by Dijkstra, to provide a loop-free topology.
  • It provides fast convergence with triggered, incremental updates via Link State Advertisements (LSAs).
  • It is a classless protocol and allows for a hierarchical design with VLSM and route summarization.

Disadvantages:

  • It requires more memory to hold the adjacency (list of OSPF neighbors), topology and routing tables.
  • It requires extra CPU processing to run the SPF algorithm
  • It is complex to configure and more difficult to troubleshoot.

Features

  • OSPF implements a two-layer hierarchy: the backbone (area 0) and areas off of the backbone (areas 1– 65,535)
  • To provide scalability OSPF supports two important concepts: autonomous systems and areas.
  • Synchronous serial links, no matter what the clock rate of the physical link is, the bandwidth always defaults to 1544 Kbps.
  • OSPF uses cost as a metric, which is the inverse of the bandwidth of a link.


Router Identities

Each router in an OSPF network needs a unique ID that is used to provide a unique identity to the OSPF router. The router ID is chosen according to one of the two following criteria:
  • The highest IP address on its loop back interfaces (this is a logical interface on a router)
  • The highest IP address on its active interfaces
OSPF learns about its neighbors and builds its adjacency and topology tables by sharing LSAs OSPF routers will generate hello LSAs every 10 seconds. If a neighbor is not seen within the dead interval time, which defaults to 40 seconds, the neighbor is declared dead.
First before a router will accept any routing information from another OSPF router, they have to build an adjacency with each other on their connected interfaces. When this adjacency is built, the two routers (on the connected interfaces) are called a neighbor, which indicates a special relationship between the two. In order for two routers to become neighbors, the following must match on each router:

  • The hello and dead interval timers
  • The area number and its type
  • The OSPF password (optional), if it is configured
  • The area stub flag (used to contain OSPF messages and routing information,
       OSPF routers will go through three states called the exchange process:
  • 1. Down state The new router has not exchanged any OSPF information with any other router.
  • 2. Init state A destination router has received a new router's hello and adds it to its neighbor list (assuming that certain values match). Note that communication is only unidirectional at this point.
  • 3. Two-Way state The new router receives a unidirectional reply to its initial hello packet and adds destination router to its neighbor database. Once the routers have entered a two-way state, they are considered neighbors.
    • For each network multi-access segment, there is a DR and a BDR as well as other routers.
    • This process is true for multi-access segments, (an example, if you have ten VLANs in your switched area, you’ll have ten DRs and ten BDRs.) but not point-to-point links, where DRs are not necessary.
    • The router with the highest priority (or highest router ID) becomes the DR.
    • Loop back Interfaces
    • A loop back interface is a logical, virtual interface on a router that always remains up. By default, the router doesn't have any loop back interfaces, but they can easily be created.
      OSPF routers use Link State Advertisements (LSAs) to communicate with each other. One type of LSA is a hello, which is used to form neighbor relationships and as a keep-alive function. Hellos are generated every ten seconds.
      When sharing link information (directly connected routes), links are sent to the DR (224.0.0.6) and the DR Disseminates this to everyone (224.0.0.5) else on the segment.

      Sharing Routing Information

      After electing the DR/BDR pair, the routers continue to generate hellos to maintain communication. This is considered an exstart state, in which the OSPF routers are ready to share link state information. The process the routers go through is called anexchange protocol
      1.Exstart state
      The DR and BDR form adjacencies with the other OSPF routers on the segment, and then within each adjacency, the router with the highest router ID becomes the master and starts the exchange process first (shares its link state information)—note that the DR is not necessarily the master for the exchange process. The remaining router in the adjacency will be the slave.
      2. Exchange state 
      The master starts sharing link state information first, with the slave. These are called DBDs (database description packets), also referred to as DDPs. The DBDs contain the link-state type, the ID of the advertising router, the cost of the advertised link, and the sequence number of the link. The slave responds back with an LSACK—an acknowledgment to the DBD from the master. The slave then compares the DBD's information with its own.
      3. Loading state
      If the master has more up-to-date information than the slave, the slave will respond to the master's original DBD with an LSR (Link State Request). The master will then send a LSU (Link State Update) with the detailed information of the links to the slave. The slave will then incorporate this into its local link state database. Again, the slave will generate an LSACK to the master to acknowledge the fact that it received the LSU. If a slave has more up-to-date information, it will repeat the "exchange" and "loading" states.
      4. Full state
      Once the master and the slave are synchronized, they are considered to be in a full state. To summarize these four steps, OSPF routers share a type of LSA message in order to disclose information about available routes. Basically, an LSA update message contains a link and a state, as well as other information.
      link is the router interface on which the update was generated (a connected route).
      The state is a description of this interface, including the IP address configured on it as well as the relationship this router has with its neighboring router. However, OSPF routers will not share this information with just any OSPF router.
      two-way state indicates that two OSPF routers are neighbors. A full state indicates the completion of sharing of links between routers.
      Cost metric is the inverse of the accumulated bandwidth values of routers’ interfaces. The default Measurement that Cisco uses in calculating the cost metric is: cost = 108/(interface bandwidth)
      
      

Tuesday 2 April 2013

How to Configure VLAN, STP, DTP 

In this tutorial I will demonstrate that how can you
  • Configure Access or Trunk links
  • Create VLAN
  • Assign VLAN membership
  • Configure Intra VLAN routing
  • Configure VTP Server
  • Make VTP Clients
  • Show STP Static
  • Configure DTP port
To complete these lab either create a topology as shown in figure or download this file and load it in packet tracer

PC configurations
DevicesIP AddressVLANConnected With
PC010.0.0.2VLAN10Switch1 on F0/1
PC120.0.0.2VLAN20Switch1 on F0/2
PC210.0.0.3VLAN10Switch2 on F0/1
PC320.0.0.3VLAN20Switch2 on F0/2
PC410.0.0.4VLAN10Switch3 on F0/1
PC520.0.0.4VLAN20Switch3 on F0/2
2960 – 24 TTL Switch 1 Configuration
Port Connected toVLANLINKSTATUS
F0/1 With PC0VLAN10AccessOK
F0/2 With PC1VLAN20AccessOK
Gig1/1 With RouterVLAN 10,20TrunkOK
Gig 1/2 With Switch2VLAN 10,20TrunkOK
F0/24 Witch Switch2VLAN 10,20TrunkOK
2960 – 24 TTL Switch 2 Configuration
F0/1 With PC0VLAN10AccessOK
F0/2 With PC1VLAN20AccessOK
Gig 1/2 With Switch1VLAN 10,20TrunkOK
Gig 1/1 With Switch3VLAN 10,20TrunkOK
F0/24 Witch Switch1VLAN 10,20TrunkBlocked
F0/23 Witch Switch3VLAN 10,20TrunkOK
2960 – 24 TTL Switch 3 Configuration
F0/1 With PC0VLAN10AccessOK
F0/2 With PC1VLAN20AccessOK
Gig 1/1 With Switch2VLAN 10,20TrunkOK
F0/24 Witch Switch1VLAN 10,20TrunkBlocked

Task

You are the administrator at ComputerNetworkingNotes.com. company have two department sales and management. You have given three pc for sales and three pc in management. You created two VLAN. VLAN 10 for sales and VLAN20 for management. For backup purpose you have interconnected switch with one extra connection. You have one router for intera VLAN communications.
Let's start configuration first assign IP address to all pc's
To assign IP address double click on pc and select ip configurations from desktop tab and give ip address as shown in table given above

VLAN Trunking Protocol

Configure VTP Server

We will first create a VTP Server so it can automatically propagate VLAN information to other switch. Double click on Switch1 and select CLI. Set hostname to S1 and create VTP domain name example and set password to vinita ( Remember password is case sensitive ).
Switch 1
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S1
S1(config)#vtp mode server
Device mode already VTP SERVER.
S1(config)#vtp domain example
Changing VTP domain name from NULL to example
S1(config)#vtp password vinita
Setting device VLAN database password to vinita

Configure VTP clients

Once you have created a VTP domain. Configure remaining Switch to Client mode.
Switch 2
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S2
S2(config)#vtp mode client
Setting device to VTP CLIENT mode.
S2(config)#vtp domain example
Changing VTP domain name from NULL to example
S2(config)#vtp password vinita
Setting device VLAN database password to vinita
S2(config)#
Switch 3
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname S3
S3(config)#vtp mode client
Setting device to VTP CLIENT mode.
S3(config)#vtp domain example
Changing VTP domain name from NULL to example
S3(config)#vtp password vinita
Setting device VLAN database password to vinita
S3(config)#

Dynamic Trunking Protocol

Configure DTP port

All Switch ports remain by default in access mode. Access port can not transfer the trunk frame. Change mode to trunk on all the port those are used to interconnect the switches
Switch 1
S1(config)#interface fastEthernet 0/24
S1(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24,
changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24,
changed state to up
S1(config-if)#exit
S1(config)#interface gigabitEthernet 1/1
S1(config-if)#switchport mode trunk
S1(config-if)#exit
S1(config)#interface gigabitEthernet 1/2
S1(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/2,
changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/2,
changed state to up
S1(config-if)#exit
S1(config)#
Switch 2
S2(config)#interface gigabitEthernet 1/1
S2(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1,
changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1,
changed state to up
S2(config-if)#exit
S2(config)#interface gigabitEthernet 1/2
S2(config-if)#switchport mode trunk
S2(config-if)#exit
S2(config)#interface fastEthernet 0/23
S2(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23,
changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/23,
changed state to up
S2(config-if)#exit
S2(config)#interface fastEthernet 0/24
S2(config-if)#switchport mode trunk
S2(config-if)#exit
Switch 3
S3(config)#interface fastEthernet 0/24
S3(config-if)#switchport mode trunk
S3(config-if)#exit
S3(config)#interface gigabitEthernet 1/1
S3(config-if)#switchport mode trunk
S3(config-if)#exit

Virtual LAN (VLAN)

Create VLAN

After VTP server configuration its time to organize VLAN. We need only to create VLAN on VTP server and reset will be done by VTP Server automatically.
Switch 1
S1(config)#vlan 10
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#exit
S1(config)#
As we have already configure VTP server in our network so we don't need to create VLAN on S2 or S3. We need only to associate VLAN with port.

Assign VLAN membership

Switch 1
S1(config)#interface fastEthernet 0/1
S1(config-if)#switchport access vlan 10
S1(config-if)#interface fastEthernet 0/2
S1(config-if)#switchport access vlan 20
Switch 2
S2(config)#interface fastEthernet 0/1
S2(config-if)#switchport access vlan 10
S2(config-if)#interface fastEthernet 0/2
S2(config-if)#switchport access vlan 20
Switch 3
S3(config)#interface fastEthernet 0/1
S3(config-if)#switchport access vlan 10
S3(config-if)#interface fastEthernet 0/2
S3(config-if)#switchport access vlan 20
Now we have two working vlan. To test connectivity do ping form 10.0.0.2 to 10.0.0.3 and 10.0.0.4. if you get successfully replay then you have successfully created VLAN and VTP server.

Spanning-Tree Protocol

In this configuration STP will block these ports F0/24 of S1 , F0/23 and F0/24 of S2 and F0/24 of S3 to avoid loop at layer to two. Verify those ports blocked due to STP functions

Verify STP ports

Switch 2
S2#show spanning-tree active
VLAN0001
  Spanning tree enabled protocol ieee
  Root ID    Priority    32769
             Address     0002.174D.7794
             Cost        4
             Port        26(GigabitEthernet1/2)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32769  (priority 32768 sys-id-ext 1)
             Address     00D0.FF08.82E1
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- ---------------------------
Fa0/1            Desg FWD 19        128.1    P2p
Fa0/2            Desg FWD 19        128.2    P2p
Fa0/23           Desg FWD 19        128.23   P2p
Fa0/24           Altn BLK 19        128.24   P2p
Gi1/1            Desg FWD 4         128.25   P2p
Gi1/2            Root FWD 4         128.26   P2p
[Output is omitted]
S2#
You can test STP protocols status on S1 and S3 also with
show spanning-tree active command

Router on Stick

Switch#show interfaces vlan xDisplays interface characteristics for the specified VLAN
Switch#delete flash:vlan.dat
Delete filename [vlan.dat]?
Delete flash:vlan.dat? [confirm]
Switch#
Removes the entire VLAN database from flash.
Make sure there is no space between the colon (:) and the characters vlan.dat. You can potentially erase the entire contents of the flash with this command if the syntax is not correct. Make sure you read the output from the switch. If you need to cancel, press ctrl+c to escape back to privileged mode:
Switch(config)#interface fastethernet 0/5Moves to interface configuration mode.
Switch(config-if)#no switchport access vlan 5Removes port from VLAN 5 and reassigns it to VLAN 1—the default VLAN.
Switch(config-if)#exitMoves to global configuration mode.
Switch(config)#no vlan 5Removes VLAN 5 from the VLAN database.
Switch#copy running-config startupconfigSaves the configuration in NVRAM
Switch(config-if) #switchport mode trunkPuts the interface into permanent trunking mode and negotiates to convert the link into a trunk link.
Switch(config)#vtp mode serverChanges the switch to VTP server mode.
Switch(config)#vtp mode clientChanges the switch to VTP client mode.
Switch(config)#vtp mode transparentChanges the switch to VTP transparent mode.
Switch(config)#no vtp modeReturns the switch to the default VTP server mode.
Switch(config)#vtp domain domain-nameConfigures the VTP domain name. The name can be from 1 to 32 characters long.
Switch(config)#vtp password passwordConfigures a VTP password
.
Switch(config)#vtp pruningEnables VTP pruning
Switch#show vtp statusDisplays general information about VTP configuration
Switch#show vtp countersDisplays the VTP counters for the switch