带有 VPC 的 Nexus 3500 上的网关

网络工程 cisco-nexus 个人电脑
2022-03-01 06:48:09

我正在 VPC 拓扑中测试具有 2 个 Nexus 3524 和 2960X 的设置: 在此处输入图像描述

对于这个测试实验室,我错过了一些 SFP,因此每个交换机之间只有一个物理链路(这些链路是使用 1000BASE-T 铜缆 SFP 的铜缆)。

所有 3 台交换机都启用了 VLAN 17 并配置了 IP 地址:

Nexus 1(左):192.168.17.254
Nexus 2(右):192.168.17.252
2960X:192.168.17.2

两个端口通道都是中继,允许 VLAN 17。

当所有链接都启动时,我可以从任何交换机 ping 所有地址。

如果我关闭 2960X 和 Nexus1 之间的链接,我会得到:

  • 2960X能ping通Nexus2
  • Nexus2 可以 ping 通 Nexus1
  • 29060X 无法 ping Nexus1

请注意,其目的是将 Nexus 用作带有 HSRP 的一堆 VLAN 的网关(还将有 8 台交换机 2960X 用作 TOR,每台都有一个连接到 Nexus 的 VPC)。HSRP 尚未配置,因为我想先进行有效的 VPC 配置。

以下是配置:(
除了下面的配置之外,所有3个开关都是出厂默认设置,所有未显示的接口都没有配置)

连结 1

version 6.0(2)A1(1b)
hostname STA-TST-NEXUS1

no feature telnet
cfs eth distribute
feature interface-vlan
feature hsrp
feature lacp
feature vpc

control-plane
  service-policy input copp-system-policy

vrf context management
  ip route 0.0.0.0/0 10.22.110.254
vlan 1
vlan 17
  name test-17
vlan 18
  name test-18

vpc domain 100
  role priority 2000
  system-priority 4000
  peer-keepalive destination 10.22.110.12
  auto-recovery

interface Vlan1

interface Vlan17
  no shutdown
  ip address 192.168.17.254/24

interface Vlan18
  no shutdown
  ip address 192.168.18.254/24

interface port-channel10
  switchport mode trunk
  switchport trunk allowed vlan 17-18
  vpc 100

interface port-channel100
  switchport mode trunk
  spanning-tree port type network
  vpc peer-link

interface Ethernet1/1
  switchport mode trunk
  speed 1000
  channel-group 100


interface Ethernet1/23
  switchport mode trunk
  switchport trunk allowed vlan 17-18
  speed 1000
  channel-group 10 mode active


interface mgmt0
  no ip redirects
  ip address 10.22.110.11/24

连结 2

version 6.0(2)A1(1b)
hostname STA-TST-NEXUS2

no feature telnet
cfs eth distribute
feature interface-vlan
feature lacp
feature vpc

control-plane
  service-policy input copp-system-policy

vrf context management
  ip route 0.0.0.0/0 10.22.110.254

vlan 1

vlan 17
  name test-17

vlan 18
  name test-18

vpc domain 100
  role priority 3000
  system-priority 4000
  peer-keepalive destination 10.22.110.11
  auto-recovery

interface Vlan1

interface Vlan17
  no shutdown
  ip address 192.168.17.252/24

interface Vlan18
  no shutdown
  ip address 192.168.18.252/24

interface port-channel10
  switchport mode trunk
  switchport trunk allowed vlan 17-18
  vpc 100

interface port-channel100
  switchport mode trunk
  spanning-tree port type network
  vpc peer-link

interface Ethernet1/1
  switchport mode trunk
  speed 1000
  channel-group 100

interface Ethernet1/24
  switchport mode trunk
  switchport trunk allowed vlan 17-18
  speed 1000
  channel-group 10 mode active

interface mgmt0
  no ip redirects
  ip address 10.22.110.12/24

2960X

version 15.2
hostname STA-TSTSW1
!
switch 1 provision ws-c2960x-48td-l
!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
lldp run
!
interface Port-channel1
 switchport mode trunk
!
interface FastEthernet0
 ip address 10.22.110.13 255.255.255.0
!
interface GigabitEthernet1/0/1
 switchport access vlan 17
 switchport mode access
!
interface GigabitEthernet1/0/2
 switchport access vlan 17
 switchport mode access
!
interface GigabitEthernet1/0/23
 switchport mode trunk
 shutdown
 channel-group 1 mode active
!
interface GigabitEthernet1/0/24
 switchport mode trunk
 channel-group 1 mode active
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan17
 ip address 192.168.17.2 255.255.255.0
!
ip default-gateway 10.22.110.254

那么问题来了:为什么我在2960X和Nexus1之间断链时ping不通?

奖励:如何在此配置中配置 HSRP?

1个回答

对于您的第一个问题,请在 VPC 域设置下启用“对等网关”。这允许通过 VPC 对等链路进行定向 ping 转发。

对于核心 Nexus VPC 对等点,还建议在 VPC 域设置下设置“peer-switch”,并将 VPC vlan 的 STP 优先级设置为相同的值。

对于您的第二个问题,HSRP 是在两个 N9k 的 SVI 下配置的:

N9k-1

interface vlan 17
  no shutdown
  ip address 192.168.17.254/24
  hsrp version 2
  hsrp 17
    priority 110
    ip 192.168.17.1
    preempt

N9k-2

interface Vlan17
  no shutdown
  ip address 192.168.17.252/24
  hsrp version 2
  hsrp 17
    ip 192.168.17.1
    preempt

此处不需要 HSRP 版本 2,默认 HSRP 优先级为 100。使用“show hsrp brief”验证 HSRP 在对等方之间工作,并确保您可以 ping 所有各种 IP。