Nexus und OSPF
Routing per OSPF auf Nexus Systemen.
Zum Einsatz kommt das Nexus 9300 Image auf GNS 3
Auf allen Systemen muss das feature OSPF insatlliert werden/sein
Das Management Interface ist in dem Netzwerk 192.168.176.0/24 und das default Gateway lautet 192.168.176.100 und ist per VLAN 192 auf dem MGMT Switch angelegt.
Die Konfigurationen der Systeme
Nexus-1
switchname Nexus-1
!
vdc Nexus-1 id 1
!
feature ospf
!
ip route 0.0.0.0/0 172.16.0.1
vlan 1
!
vrf context management
ip route 0.0.0.0/0 192.168.176.100
!
interface Ethernet1/1
no switchport
ip address 172.16.0.2/30
ip router ospf 123 area 0.0.0.0 <– Interface in das OSPF Routing aufnehmen
no shutdown
!
interface Ethernet1/2
no switchport
ip address 10.10.0.1/30
ip router ospf 123 area 0.0.0.0 <– Interface in das OSPF Routing aufnehmen
no shutdown
!
interface mgmt0
speed 100
duplex full
vrf member management
ip address 192.168.176.1/24
cli alias name wr copy running startup
!
boot nxos bootflash:/nxos.9.3.3.bin sup-1
!
router ospf 123
router-id 1.1.1.1
default-information originate <– default Route weitergeben
area 0.0.0.0 range 10.10.0.0/30
area 0.0.0.0 range 172.16.0.0/30
Nexus-2
vdc Nexus-2 id 1
!
feature ospf
!
ip route 0.0.0.0/0 209.165.200.224
!
vlan 1
!
vrf context management
ip route 0.0.0.0/0 192.168.176.100
!
interface Ethernet1/1
no switchport
ip address 172.16.0.1/30
ip router ospf 123 area 0.0.0.0
no shutdown
!
interface Ethernet1/2
no switchport
ip address 172.16.1.1/30
ip router ospf 123 area 0.0.0.0
no shutdown
!
interface mgmt0
speed 100
duplex full
vrf member management
ip address 192.168.176.2/24
!
interface loopback0
ip address 209.165.200.225/27
!
cli alias name wr copy running startup
!
boot nxos bootflash:/nxos.9.3.3.bin sup-1
!
router ospf 123
router-id 2.2.2.2
default-information originate
area 0.0.0.0 range 172.16.0.0/30
area 0.0.0.0 range 172.16.1.0/30
!
Nexus-3
switchname Nexus-3
!
vdc Nexus-3 id 1
!
feature ospf
!
ip route 0.0.0.0/0 172.16.1.1
vlan 1
!
vrf context management
ip route 0.0.0.0/0 192.168.176.1
!
interface Ethernet1/1
no switchport
ip address 172.16.1.2/30
ip router ospf 123 area 0.0.0.0
no shutdown
!
interface Ethernet1/2
no switchport
ip address 10.10.4.1/30
ip router ospf 123 area 0.0.0.0
no shutdown
!
interface mgmt0
speed 100
duplex full
vrf member management
ip address 192.168.176.3/24
!
cli alias name wr copy running startup
!
boot nxos bootflash:/nxos.9.3.3.bin sup-1
!
router ospf 123
router-id 3.3.3.1
default-information originate
area 0.0.0.0 range 10.10.4.0/30
area 0.0.0.0 range 172.16.1.0/30
D1
hostname D1
!
vdc D1 id 1
!
feature ospf
!
vlan 1
!
vrf context management
ip route 0.0.0.0/0 192.168.176.100
!
interface Ethernet1/1
no switchport
ip address 10.10.0.2/30
ip router ospf 123 area 0.0.0.0
no shutdown
!
interface Ethernet1/9
no switchport
ip address 10.10.1.1/24
ip router ospf 123 area 0.0.0.0
no shutdown
!
interface mgmt0
speed 100
duplex full
vrf member management
ip address 192.168.176.4/24
!
interface loopback2
ip address 10.10.2.1/24
ip ospf network point-to-point
!
interface loopback3
ip address 10.10.3.1/24
ip ospf network point-to-point
!
cli alias name wr copy running startup
!
boot nxos bootflash:/nxos.9.3.3.bin sup-1
!
router ospf 123
router-id 1.1.1.2
area 0.0.0.0 range 10.10.0.0/22
D3
hostname D3
!
vdc D3 id 1
!
feature ospf
!
vlan 1
!
vrf context management
ip route 0.0.0.0/0 192.168.176.100
!
interface Ethernet1/1
no switchport
ip address 10.10.4.2/30
ip router ospf 123 area 0.0.0.0
no shutdown
!
interface Ethernet1/9
no switchport
ip address 10.10.5.1/24
ip router ospf 123 area 0.0.0.0
no shutdown
!
interface mgmt0
speed 100
duplex full
vrf member management
ip address 192.168.176.5/24
!
interface loopback16
ip address 10.10.16.1/24
ip ospf network point-to-point
ip router ospf 123 area 0.0.0.0
!
interface loopback17
ip address 10.10.17.1/24
ip ospf network point-to-point
ip router ospf 123 area 0.0.0.0
!
interface loopback18
ip address 10.10.18.1/24
ip ospf network point-to-point
ip router ospf 123 area 0.0.0.0
!
interface loopback19
ip address 10.10.19.1/24
ip ospf network point-to-point
ip router ospf 123 area 0.0.0.0
!
interface loopback20
ip address 10.10.20.1/24
ip ospf network point-to-point
ip router ospf 123 area 0.0.0.0
!
interface loopback21
ip address 10.10.21.1/24
ip ospf network point-to-point
ip router ospf 123 area 0.0.0.0
!
interface loopback22
ip address 10.10.22.1/24
ip ospf network point-to-point
ip router ospf 123 area 0.0.0.0
!
interface loopback23
ip address 10.10.23.1/24
ip ospf network point-to-point
ip router ospf 123 area 0.0.0.0
!
cli alias name wr copy running startup
!
boot nxos bootflash:/nxos.9.3.3.bin sup-1
!
router ospf 123
router-id 3.3.3.2
area 0.0.0.0 range 10.10.4.0/23
area 0.0.0.0 range 10.10.16.0/21
!
PC 1
IP: 10.10.1.10
Mask 255.255.255.0
GW: 10.10.1.10
PC2
IP: 10.10.5.10
Mask 255.255.255.0
GW: 10.10.5.10
Zur Überprüfung ob der Weg wirklich steht, kann man von PC1 auf den PC2 pingen.
Die Routing Tabellen
D1
D1# sh ip route ospf-123
IP Route Table for VRF “default”
‘*’ denotes best ucast next-hop
‘**’ denotes best mcast next-hop
‘[x/y]’ denotes [preference/metric]
‘%’ in via output denotes VRF
0.0.0.0/0, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/1], 04:07:27, ospf-123, type-2
10.10.4.0/30, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/160], 00:00:14, ospf-123, intra
10.10.5.0/24, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/200], 00:00:14, ospf-123, intra
10.10.16.1/32, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/161], 00:00:14, ospf-123, intra
10.10.17.1/32, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/161], 00:00:14, ospf-123, intra
10.10.18.1/32, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/161], 00:00:14, ospf-123, intra
10.10.19.1/32, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/161], 00:00:14, ospf-123, intra
10.10.20.1/32, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/161], 00:00:14, ospf-123, intra
10.10.21.1/32, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/161], 00:00:14, ospf-123, intra
10.10.22.1/32, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/161], 00:00:14, ospf-123, intra
10.10.23.1/32, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/161], 00:00:14, ospf-123, intra
172.16.0.0/30, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/80], 04:07:27, ospf-123, intra
172.16.1.0/30, ubest/mbest: 1/0
*via 10.10.0.1, Eth1/1, [110/120], 00:00:20, ospf-123, intra
D1# sh ip ospf database
OSPF Router with ID (1.1.1.2) (Process ID 123 VRF default)
Router Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# Checksum Link Count
1.1.1.1 1.1.1.1 1027 0x8000000d 0x5ed8 2
1.1.1.2 1.1.1.2 983 0x8000000c 0xd777 4
2.2.2.2 2.2.2.2 118 0x8000000d 0xffdb 2
3.3.3.1 3.3.3.1 123 0x8000000d 0xb46c 2
3.3.3.2 3.3.3.2 1331 0x80000013 0x367b 10
Network Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# Checksum
10.10.0.1 1.1.1.1 396 0x8000000a 0x9c95
10.10.4.1 3.3.3.1 1449 0x80000009 0xba62
172.16.0.2 1.1.1.1 836 0x8000000a 0x2c59
172.16.1.2 3.3.3.1 124 0x80000002 0x314f
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 1.1.1.1 1027 0x80000009 0xbe07 0
0.0.0.0 2.2.2.2 1079 0x8000000a 0x9e22 0
0.0.0.0 3.3.3.1 607 0x80000002 0x9c2a 0
D3
D3# sh ip route ospf-123
IP Route Table for VRF “default”
‘*’ denotes best ucast next-hop
‘**’ denotes best mcast next-hop
‘[x/y]’ denotes [preference/metric]
‘%’ in via output denotes VRF
0.0.0.0/0, ubest/mbest: 1/0
*via 10.10.4.1, Eth1/1, [110/1], 00:10:27, ospf-123, type-2
10.10.0.0/30, ubest/mbest: 1/0
*via 10.10.4.1, Eth1/1, [110/160], 00:02:18, ospf-123, intra
10.10.1.0/24, ubest/mbest: 1/0
*via 10.10.4.1, Eth1/1, [110/200], 00:02:18, ospf-123, intra
10.10.2.0/24, ubest/mbest: 1/0
*via 10.10.4.1, Eth1/1, [110/161], 00:02:18, ospf-123, intra
10.10.3.0/24, ubest/mbest: 1/0
*via 10.10.4.1, Eth1/1, [110/161], 00:02:18, ospf-123, intra
172.16.0.0/30, ubest/mbest: 1/0
*via 10.10.4.1, Eth1/1, [110/120], 00:02:18, ospf-123, intra
172.16.1.0/30, ubest/mbest: 1/0
*via 10.10.4.1, Eth1/1, [110/80], 03:56:40, ospf-123, intra
D3# sh ip ospf database
OSPF Router with ID (3.3.3.2) (Process ID 123 VRF default)
Router Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# Checksum Link Count
1.1.1.1 1.1.1.1 1063 0x8000000d 0x5ed8 2
1.1.1.2 1.1.1.2 1022 0x8000000c 0xd777 4
2.2.2.2 2.2.2.2 153 0x8000000d 0xffdb 2
3.3.3.1 3.3.3.1 157 0x8000000d 0xb46c 2
3.3.3.2 3.3.3.2 1362 0x80000013 0x367b 10
Network Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# Checksum
10.10.0.1 1.1.1.1 433 0x8000000a 0x9c95
10.10.4.1 3.3.3.1 1483 0x80000009 0xba62
172.16.0.2 1.1.1.1 873 0x8000000a 0x2c59
172.16.1.2 3.3.3.1 157 0x80000002 0x314f
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 1.1.1.1 1063 0x80000009 0xbe07 0
0.0.0.0 2.2.2.2 1114 0x8000000a 0x9e22 0
0.0.0.0 3.3.3.1 641 0x80000002 0x9c2a 0
Nexus-2
Nexus-2# sh ip ospf route
OSPF Process ID 123 VRF default, Routing Table
(D) denotes route is directly attached (R) denotes route is in RIB
(L) denotes route label is in ULIB (NHR) denotes next-hop is in RIB
0.0.0.0/0 (type-2)(R) area 0.0.0.0
via 172.16.0.2/Eth1/1 , cost 1 distance 110 (NHR)
via 172.16.1.2/Eth1/2 , cost 1 distance 110 (NHR)
10.10.0.0/30 (intra)(R) area 0.0.0.0
via 172.16.0.2/Eth1/1 , cost 80 distance 110 (NHR)
10.10.1.0/24 (intra)(R) area 0.0.0.0
via 172.16.0.2/Eth1/1 , cost 120 distance 110 (NHR)
10.10.2.0/24 (intra)(R) area 0.0.0.0
via 172.16.0.2/Eth1/1 , cost 81 distance 110 (NHR)
10.10.3.0/24 (intra)(R) area 0.0.0.0
via 172.16.0.2/Eth1/1 , cost 81 distance 110 (NHR)
10.10.4.0/30 (intra)(R) area 0.0.0.0
via 172.16.1.2/Eth1/2 , cost 80 distance 110 (NHR)
10.10.5.0/24 (intra)(R) area 0.0.0.0
via 172.16.1.2/Eth1/2 , cost 120 distance 110 (NHR)
10.10.16.1/32 (intra)(R) area 0.0.0.0
via 172.16.1.2/Eth1/2 , cost 81 distance 110 (NHR)
10.10.17.1/32 (intra)(R) area 0.0.0.0
via 172.16.1.2/Eth1/2 , cost 81 distance 110 (NHR)
10.10.18.1/32 (intra)(R) area 0.0.0.0
via 172.16.1.2/Eth1/2 , cost 81 distance 110 (NHR)
10.10.19.1/32 (intra)(R) area 0.0.0.0
via 172.16.1.2/Eth1/2 , cost 81 distance 110 (NHR)
10.10.20.1/32 (intra)(R) area 0.0.0.0
via 172.16.1.2/Eth1/2 , cost 81 distance 110 (NHR)
10.10.21.1/32 (intra)(R) area 0.0.0.0
via 172.16.1.2/Eth1/2 , cost 81 distance 110 (NHR)
10.10.22.1/32 (intra)(R) area 0.0.0.0
via 172.16.1.2/Eth1/2 , cost 81 distance 110 (NHR)
10.10.23.1/32 (intra)(R) area 0.0.0.0
via 172.16.1.2/Eth1/2 , cost 81 distance 110 (NHR)
172.16.0.0/30 (intra)(D) area 0.0.0.0
via 172.16.0.1/Eth1/1* , cost 40 distance 110 (NHR)
172.16.1.0/30 (intra)(D) area 0.0.0.0
via 172.16.1.1/Eth1/2* , cost 40 distance 110 (NHR)
Nexus-2# sh ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 123 VRF default)
Router Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# Checksum Link Count
1.1.1.1 1.1.1.1 1110 0x8000000d 0x5ed8 2
1.1.1.2 1.1.1.2 1069 0x8000000c 0xd777 4
2.2.2.2 2.2.2.2 200 0x8000000d 0xffdb 2
3.3.3.1 3.3.3.1 205 0x8000000d 0xb46c 2
3.3.3.2 3.3.3.2 1413 0x80000013 0x367b 10
Network Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# Checksum
10.10.0.1 1.1.1.1 480 0x8000000a 0x9c95
10.10.4.1 3.3.3.1 1531 0x80000009 0xba62
172.16.0.2 1.1.1.1 920 0x8000000a 0x2c59
172.16.1.2 3.3.3.1 206 0x80000002 0x314f
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 1.1.1.1 1110 0x80000009 0xbe07 0
0.0.0.0 2.2.2.2 1161 0x8000000a 0x9e22 0
0.0.0.0 3.3.3.1 689 0x80000002 0x9c2a 0