Sei sulla pagina 1di 9

IP Routing in a Single Area OSPF Network

The example configurations below provide IP routing between two HP ProCurve 5300XL Switches (Switch A
and Switch B) using OSPF as the routing protocol. The two switches are within a single area OSPF domain.

Switch A and B configured to provide IP routing between VLANs using only OSPF as the routing protocol. All
protocols are switched within each VLAN.

Switch B is configured to restrict advertisement of VLAN 40 by OSPF.

This configuration example applies to the following products:


� J4819A HP ProCurve Switch 5308XL
� J4850A HP ProCurve Switch 5304XL

OPSPF Area
VLAN 20
20.20.20.0

Switch A
hp procurve
switch 5304XL
Use xl m od ul es only
J4850A

IP address
hp p ro c urve hp proc urve
10 / 1 00 -T x l
m o d ul e
M ini -GBI C
xl m o dule xl
J4 82 0A J4 87 8A m o dule

10.10.10.2

VLAN 10 link untagged for


10.10.10.0 VLAN 10

IP address
10.10.10.3 hp procurve
switch 5308XL
J4819A Use xl m od ul es only

hp p ro curve
10/ 100- Tx l hp p ro curve

xl
m o dule
M ini-GBIC
J4820A
xlm o d ule
J4 87 8A m o dule

VLAN 40
198.168.40.0

VLAN 30
Switch B 30.30.30.0

©Copyright Hewlett-Packard Company, 2000. Page 1


All rights reserved.
WARNING:
The example configuration below was created from a factory default configuration on the HP ProCurve
5300XL Switch. The first 3 commands in the sequence of CLI commands given below will first reset the switch
back to factory default settings. We recommend saving your current configuration if necessary. Otherwise, skip
the first 3 commands.

NOTES:
1. The interface port numbers (e.g. interface a1) and the IP address (e.g. 10.10.10.2) may differ in your
network, so adjust these values accordingly.
2. The HP ProCurve Switch 5300XL Series (e.g. HP 5304XL), type of module(s), and software version
number below may not accurately reflect the device(s) you are configuring.
3. The area 0.0.0.0 command is used to assign the 5300XLSwitches to the single backbone area.
4. The ip ospf area 0.0.0.0 command is used to assign the individual interfaces to the OSPF area.
5. In the example below for Switch B, as soon as the redistribute connected command is issued for a given
routing protocol, ALL connected routes are advertised within that routing protocol. The restrict
198.168.40.0/24 command is used in order to keep this directly connected network (e.g. VLAN 40) from
being advertised through OSPF to Switch A.
6. In the example below, the redistribute connected command is needed in order for Switch A to learn (via
OSPF) the directly connected network (e.g., the 30.30.30.0 network) on Switch B and vice versa. By
default the Switch 5300XL will not advertise directly connected OSPF networks. By default the Switch
5300XL will advertise directly connected RIP networks.
7. The configuration examples below were created on software version E.06.01.

©Copyright Hewlett-Packard Company, 2000. Page 2


All rights reserved.
CONFIGURATION COMMANDS: (created on software version E.06.01)
Switch A

HP ProCurve Switch 5304XL# con

HP ProCurve Switch 5304XL(config)# hostname Switch_A

Switch_A(config)# vlan 10

Switch_A(vlan-10)# untag a1

Switch_A(vlan-10)# ip address 10.10.10.2/24

Switch_A(vlan-10)# exit

Switch_A(config)# ip routing

Switch_A(config)# router ospf

Switch_A(ospf)# area 0.0.0.0

Switch_A(ospf)# redistribute connected

Switch_A(ospf)# vlan 10

Switch_A(vlan-10)# ip ospf area 0.0.0.0

Switch_A(vlan-10)# vlan 20

Switch_A(vlan-20)# untag b1

Switch_A(vlan-20)# ip address 20.20.20.2/24

Switch B
HP ProCurve Switch 5308XL# con

HP ProCurve Switch 5308XL(config)# hostname Switch_B

Switch_B(config)# vlan 10

Switch_B(vlan-10)# untag a1

Switch_B(vlan-10)# ip address 10.10.10.3/24

Switch_B(vlan-10)# exit

Switch_B(config)# ip routing

Switch_B(config)# router ospf

Switch_B(ospf)# area 0.0.0.0

Switch_B(ospf)# redistribute connected

Switch_B(ospf)# restrict 198.168.40.0/24

Switch_B(ospf)# vlan 10

Switch_B(vlan-10)# ip ospf area 0.0.0.0

Switch_B(vlan-10)# vlan 30

Switch_B(vlan-30)# untag b1

Switch_B(vlan-30)# ip address 30.30.30.2/24

Switch_B(vlan-30)# vlan 40

Switch_B(vlan-40)# untag b4

Switch_B(vlan-40)# ip address 198.168.40.1/24

©Copyright Hewlett-Packard Company, 2000. Page 3


All rights reserved.
RESULTING CONFIGURATION:
Switch A
Startup configuration:

; J4850A Configuration Editor; Created on release #E.06.01

hostname "Switch_A"

time daylight-time-rule None

cdp run

module 2 type J4821A

module 1 type J4820A

ip routing

snmp-server community "public" Unrestricted

vlan 1

name "DEFAULT_VLAN"

untagged A2-A24,B2-B4

ip address dhcp-bootp

no untagged A1,B1

exit

vlan 10

name "VLAN10"

untagged A1

ip address 10.10.10.2 255.255.255.0

exit

vlan 20

name "VLAN20"

untagged B1

ip address 20.20.20.2 255.255.255.0

exit

no aaa port-access authenticator active

ip router-id 10.10.10.2

router ospf

area backbone

redistribute connected

exit

vlan 10

ip ospf area backbone

exit

©Copyright Hewlett-Packard Company, 2000. Page 4


All rights reserved.
RESULTING CONFIGURATION:
Switch B
Startup configuration:

; J4819A Configuration Editor; Created on release #E.06.01

hostname "Switch_B"

time daylight-time-rule None

cdp run

module 2 type J4821A

module 1 type J4820A

ip routing

snmp-server community "public" Unrestricted

vlan 1

name "DEFAULT_VLAN"

untagged A2-A24,B2-B3

ip address dhcp-bootp

no untagged A1,B1,B4

exit

vlan 10

name "VLAN10"

untagged A1

ip address 10.10.10.3 255.255.255.0

exit

vlan 30

name "VLAN30"

untagged B1

ip address 30.30.30.2 255.255.255.0

exit

vlan 40

name "VLAN40"

untagged B4

ip address 198.168.40.1 255.255.255.0

exit

no aaa port-access authenticator active

ip router-id 10.10.10.3

router ospf

area backbone

redistribute connected

restrict 198.168.40.0 255.255.255.0

exit

vlan 10

ip ospf area backbone

exit

©Copyright Hewlett-Packard Company, 2000. Page 5


All rights reserved.
VERIFICATION COMMANDS:

1. The following CLI commands can be used to display OSPF information:


· show ip ospf general
· show ip ospf interface
· show ip route ospf
· show ip route
· show ip ospf neighbor
· show ip ospf database link-state
· show ip ospf database external-link-state
· show ip ospf restrict

Outputs from these show commands for this example follow below. Refer to Chapter 16 of the HP
Procurve Series 5300XL Switches Management and Configuration Guide for detailed descriptions of each
command's output.

Switch_A# sh ip ospf general

OSPF General Status

OSPF protocol : enabled

Router ID : 10.10.10.2

RFC 1583 compatability : compatible

Default import metric : 10

Default import metric type : external type 2

Area Border : no

AS Border : yes

External LSA Count : 2

External LSA Checksum Sum : 31803

Originate New LSA Count : 57

Receive New LSA Count : 115

Switch_B# sh ip ospf general

OSPF General Status

OSPF protocol : enabled

Router ID : 10.10.10.3

RFC 1583 compatability : compatible

Default import metric : 10

Default import metric type : external type 2

Area Border : no

AS Border : yes

External LSA Count : 2

External LSA Checksum Sum : 30781

Originate New LSA Count : 115

Receive New LSA Count : 53

Switch_A# sh ip ospf interface

OSPF Interface Status

IP Address Status Area ID State Auth-type Cost Priority

--------------- -------- --------------- ------- --------- ------ ---------

10.10.10.2 enabled backbone BDR none 1 1

©Copyright Hewlett-Packard Company, 2000. Page 6


All rights reserved.
Switch_B# sh ip ospf interface

OSPF Interface Status

IP Address Status Area ID State Auth-type Cost Priority

--------------- -------- --------------- ------- --------- ------ ---------

10.10.10.3 enabled backbone DR none 1 1

Switch_A# sh ip route ospf

IP Route Entries

Destination Network Mask | Gateway Type Sub-Type Metric

--------------- --------------- + --------------- --------- ---------- ------

30.30.30.0 255.255.255.0 | 10.10.10.3 ospf External2 10

Switch_B# sh ip route ospf

IP Route Entries

Destination Network Mask | Gateway Type Sub-Type Metric

--------------- --------------- + --------------- --------- ---------- ------

20.20.20.0 255.255.255.0 | 10.10.10.2 ospf External2 10

Switch_A# sh ip route

IP Route Entries

Destination Network Mask | Gateway Type Sub-Type Metric

--------------- --------------- + --------------- --------- ---------- ------

10.10.10.0 255.255.255.0 | VLAN10 connected 0

20.20.20.0 255.255.255.0 | VLAN20 connected 0

30.30.30.0 255.255.255.0 | 10.10.10.3 ospf External2 10

127.0.0.0 255.0.0.0 | reject static 0

127.0.0.1 255.255.255.255 | lo0 connected 0

Switch_B# sh ip route

IP Route Entries

Destination Network Mask | Gateway Type Sub-Type Metric

--------------- --------------- + --------------- --------- ---------- ------

10.10.10.0 255.255.255.0 | VLAN10 connected 0

20.20.20.0 255.255.255.0 | 10.10.10.2 ospf External2 10

30.30.30.0 255.255.255.0 | VLAN30 connected 0

127.0.0.0 255.0.0.0 | reject static 0

127.0.0.1 255.255.255.255 | lo0 connected 0

198.168.40.0 255.255.255.0 | VLAN40 connected 0

©Copyright Hewlett-Packard Company, 2000. Page 7


All rights reserved.
Switch_A# sh ip ospf neighbor

OSPF Neighbor Information

Router ID Pri IP Address NbIfState State Rxmt QLen Events

--------------- --- --------------- --------- -------- --------- ----------

10.10.10.3 1 10.10.10.3 DR FULL 0 6

Switch_B# sh ip ospf neighbor

OSPF Neighbor Information

Router ID Pri IP Address NbIfState State Rxmt QLen Events

--------------- --- --------------- --------- -------- --------- ----------

10.10.10.2 1 10.10.10.2 BDR FULL 0 6

Switch_A# sh ip ospf link-state

OSPF Link State Database for Area 0.0.0.0

Advertising

LSA Type Link State ID Router ID Age Sequence # Checksum

---------- --------------- --------------- ---- ----------- ----------

Router 10.10.10.2 10.10.10.2 1553 0x80000033 0x00008914

Router 10.10.10.3 10.10.10.3 1555 0x8000002c 0x0000950c

Network 10.10.10.3 10.10.10.3 1550 0x80000025 0x0000436f

Switch_B# sh ip ospf link-state

OSPF Link State Database for Area 0.0.0.0

Advertising

LSA Type Link State ID Router ID Age Sequence # Checksum

---------- --------------- --------------- ---- ----------- ----------

Router 10.10.10.2 10.10.10.2 322 0x80000034 0x00008715

Router 10.10.10.3 10.10.10.3 321 0x8000002d 0x0000930d

Network 10.10.10.3 10.10.10.3 316 0x80000026 0x00004170

Switch_A# sh ip ospf external-link-state

OSPF External LSAs

Link State ID Router ID Age Sequence # Checksum

--------------- --------------- ---- ----------- ----------

20.20.20.0 10.10.10.2 1616 0x80000001 0x000077f4

30.30.30.0 10.10.10.3 1747 0x80000003 0x00000447

Switch_B# sh ip ospf external-link-state

OSPF External LSAs

Link State ID Router ID Age Sequence # Checksum

--------------- --------------- ---- ----------- ----------

20.20.20.0 10.10.10.2 452 0x80000002 0x000075f5

30.30.30.0 10.10.10.3 580 0x80000004 0x00000248

©Copyright Hewlett-Packard Company, 2000. Page 8


All rights reserved.
Switch_A# sh ip ospf restrict

OSPF restrict list

IP Address Mask

--------------- ---------------

Switch_B# sh ip ospf restrict

OSPF restrict list

IP Address Mask

--------------- ---------------

198.168.40.0 255.255.255.0

©Copyright Hewlett-Packard Company, 2000. Page 9


All rights reserved.

Potrebbero piacerti anche