Cisco N3K VPC+HSRP+ospf 配置
时间: 2023-08-10 17:03:27 浏览: 55
以下是 Cisco Nexus 3000 Series Switches (N3K) 上 VPC、HSRP 和 OSPF 的配置示例:
首先,启用 VPC:
```
feature vpc
```
配置 VPC domain ID 和 peer-keepalive:
```
vpc domain 1
peer-keepalive destination 192.168.1.2 source 192.168.1.1
```
在两个交换机上分别配置 VPC peer gateway 地址:
```
interface Vlan10
ip address 10.0.0.1/24
hsrp version 2
hsrp 10
priority 110
preempt
ip 10.0.0.254
track 1 decrement 20
vpc 10
```
```
interface Vlan10
ip address 10.0.0.2/24
hsrp version 2
hsrp 10
priority 100
ip 10.0.0.254
track 1 decrement 20
vpc 10
```
接下来,配置 OSPF:
```
router ospf 1
router-id 10.0.0.1
auto-cost reference-bandwidth 10000
network 10.0.0.0/24 area 0.0.0.0
```
```
router ospf 1
router-id 10.0.0.2
auto-cost reference-bandwidth 10000
network 10.0.0.0/24 area 0.0.0.0
```
最后,配置 VPC peer-link 和 VPC peer-keepalive:
```
interface Ethernet1/1
description VPC Peer-Link
switchport mode trunk
channel-group 1 mode active
interface Ethernet2/1
description VPC Peer-Keepalive
switchport access vlan 999
spanning-tree port type edge
channel-group 2 mode active
```
```
interface Ethernet1/1
description VPC Peer-Link
switchport mode trunk
channel-group 1 mode active
interface Ethernet2/1
description VPC Peer-Keepalive
switchport access vlan 999
spanning-tree port type edge
channel-group 2 mode active
```
在这个配置示例中,VPC peer-link 使用 channel-group 1,VPC peer-keepalive 使用 channel-group 2。你需要在两个交换机上进行相同的配置,确保配置的一致性并避免问题。