基于BGP/EVPN控制平面的VXLAN anycast-VTEP anycast-gateway基本配置

feature: 

对称IRB

anycast-gateway

anycast-VTEP

VPC

PIM-SM

SSM

anycast-RP

multicast replication

ospf

MP-BGP

EVPN

NVO3

VXLAN

 

hostname SW1

nv overlay evpn
feature ospf
feature bgp
feature pim

ip pim rp-address 111.111.111.111 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8
ip pim anycast-rp 111.111.111.111 1.1.1.1
ip pim anycast-rp 111.111.111.111 2.2.2.2

interface Ethernet1/1
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/3
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/4
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface loopback0
  description router-id
  ip address 1.1.1.1/32
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode

interface loopback1
  description p2p
  ip address 11.11.11.11/32

interface loopback2
  description anycast-RP
  ip address 111.111.111.111/32
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode

router ospf 1
  router-id 1.1.1.1
router bgp 1
  router-id 1.1.1.1
  address-family ipv4 unicast
  address-family l2vpn evpn
    retain route-target all
  neighbor 3.3.3.3
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
      send-community
      send-community extended
      route-reflector-client
    address-family l2vpn evpn
      send-community
      send-community extended
      route-reflector-client
  neighbor 4.4.4.4
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
      send-community
      send-community extended
      route-reflector-client
    address-family l2vpn evpn
      send-community
      send-community extended
      route-reflector-client
  neighbor 5.5.5.5
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
      send-community
      send-community extended
      route-reflector-client
    address-family l2vpn evpn
      send-community
      send-community extended
      route-reflector-client
  neighbor 6.6.6.6
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
      send-community
      send-community extended
      route-reflector-client
    address-family l2vpn evpn
      send-community
      send-community extended
      route-reflector-client

  

hostname SW2

nv overlay evpn
feature ospf
feature bgp
feature pim

ip pim rp-address 111.111.111.111 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8
ip pim anycast-rp 111.111.111.111 1.1.1.1
ip pim anycast-rp 111.111.111.111 2.2.2.2

interface Ethernet1/1
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/3
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/4
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface loopback0
  description router-id
  ip address 2.2.2.2/32
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode

interface loopback1
  description p2p
  ip address 22.22.22.22/32

interface loopback2
  description anycast-rp
  ip address 111.111.111.111/32
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode

router ospf 1
  router-id 2.2.2.2
router bgp 1
  router-id 2.2.2.2
  address-family ipv4 unicast
  address-family l2vpn evpn
    retain route-target all
  template peer ibgp
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
      send-community
      send-community extended
      route-reflector-client
    address-family l2vpn evpn
      send-community
      send-community extended
      route-reflector-client
  neighbor 3.3.3.3
    inherit peer ibgp
  neighbor 4.4.4.4
    inherit peer ibgp
  neighbor 5.5.5.5
    inherit peer ibgp
  neighbor 6.6.6.6
    inherit peer ibgp

  

hostname SW3

nv overlay evpn
feature ospf
feature bgp
feature pim
feature interface-vlan
feature vn-segment-vlan-based
feature lacp
feature vpc
feature nv overlay

fabric forwarding anycast-gateway-mac 0000.2222.3333
ip pim rp-address 111.111.111.111 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8

vlan 100
  vn-segment 100
vlan 200
  vn-segment 200
vlan 1000
  vn-segment 1000

vrf context vxlan1000
  vni 1000
  rd auto
  address-family ipv4 unicast
    route-target both auto
    route-target both auto evpn
evpn
  vni 100 l2
    rd auto
    route-target import auto
    route-target export auto
  vni 200 l2
    rd auto
    route-target import auto
    route-target export auto

vpc domain 34
  role priority 1
  peer-keepalive destination 34.1.1.4 source 34.1.1.3 vrf default

interface Vlan100
  no shutdown
  vrf member vxlan1000
  ip address 100.1.1.1/24
  fabric forwarding mode anycast-gateway

interface Vlan200
  no shutdown
  vrf member vxlan1000
  ip address 200.1.1.1/24
  fabric forwarding mode anycast-gateway

interface Vlan1000
  no shutdown
  vrf member vxlan1000
  ip forward

interface port-channel1
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  spanning-tree port type network
  vpc peer-link

interface port-channel100
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  vpc 100

interface nve1
  no shutdown
  host-reachability protocol bgp
  source-interface loopback0
  member vni 100
    mcast-group 239.0.0.100
  member vni 200
    mcast-group 239.0.0.200
  member vni 1000 associate-vrf

interface Ethernet1/1
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/3
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  channel-group 1 mode active

interface Ethernet1/4
  no switchport
  ip address 34.1.1.3/24
  no shutdown

interface Ethernet1/5
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  channel-group 100 mode active

interface loopback0
  ip address 3.3.3.3/32
  ip address 34.34.34.34/32 secondary
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode

interface loopback1
  ip address 33.33.33.33/32

router ospf 1
  router-id 3.3.3.3
router bgp 1
  router-id 3.3.3.3
  address-family ipv4 unicast
  address-family l2vpn evpn
  neighbor 1.1.1.1
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
    address-family l2vpn evpn
      send-community
      send-community extended
  neighbor 2.2.2.2
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
    address-family l2vpn evpn
      send-community
      send-community extended
  vrf vxlan1000
    address-family ipv4 unicast
      advertise l2vpn evpn

  

hostname SW4

nv overlay evpn
feature ospf
feature bgp
feature pim
feature interface-vlan
feature vn-segment-vlan-based
feature lacp
feature vpc
feature nv overlay

fabric forwarding anycast-gateway-mac 0000.2222.3333
ip pim rp-address 111.111.111.111 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8

vlan 100
  vn-segment 100
vlan 200
  vn-segment 200
vlan 1000
  vn-segment 1000

vrf context vxlan1000
  vni 1000
  rd auto
  address-family ipv4 unicast
    route-target both auto
    route-target both auto evpn
evpn
  vni 100 l2
    rd auto
    route-target import auto
    route-target export auto
  vni 200 l2
    rd auto
    route-target import auto
    route-target export auto

vpc domain 34
  peer-keepalive destination 34.1.1.3 source 34.1.1.4 vrf default

interface Vlan100
  no shutdown
  vrf member vxlan1000
  ip address 100.1.1.1/24
  fabric forwarding mode anycast-gateway

interface Vlan200
  no shutdown
  vrf member vxlan1000
  ip address 200.1.1.1/24
  fabric forwarding mode anycast-gateway

interface Vlan1000
  no shutdown
  vrf member vxlan1000
  ip forward

interface port-channel1
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  spanning-tree port type network
  vpc peer-link

interface port-channel100
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  vpc 100

interface nve1
  no shutdown
  host-reachability protocol bgp
  source-interface loopback0
  member vni 100
    mcast-group 239.0.0.100
  member vni 200
    mcast-group 239.0.0.200
  member vni 1000 associate-vrf

interface Ethernet1/1
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/3
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  channel-group 1 mode active

interface Ethernet1/4
  no switchport
  ip address 34.1.1.4/24
  no shutdown

interface Ethernet1/5
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  channel-group 100 mode active

interface loopback0
  ip address 4.4.4.4/32
  ip address 34.34.34.34/32 secondary
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode

interface loopback1
  ip address 44.44.44.44/32

router ospf 1
  router-id 4.4.4.4
router bgp 1
  router-id 4.4.4.4
  address-family ipv4 unicast
  address-family l2vpn evpn
  neighbor 1.1.1.1
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
    address-family l2vpn evpn
      send-community
      send-community extended
  neighbor 2.2.2.2
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
    address-family l2vpn evpn
      send-community
      send-community extended
  vrf vxlan1000
    address-family ipv4 unicast
      advertise l2vpn evpn

  

hostname SW5

nv overlay evpn
feature ospf
feature bgp
feature pim
feature interface-vlan
feature vn-segment-vlan-based
feature lacp
feature vpc
feature nv overlay

fabric forwarding anycast-gateway-mac 0000.2222.3333
ip pim rp-address 111.111.111.111 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8

vlan 100
  vn-segment 100
vlan 200
  vn-segment 200
vlan 1000
  vn-segment 1000

vrf context vxlan1000
  vni 1000
  rd auto
  address-family ipv4 unicast
    route-target both auto
    route-target both auto evpn
evpn
  vni 100 l2
    rd auto
    route-target import auto
    route-target export auto
  vni 200 l2
    rd auto
    route-target import auto
    route-target export auto

vpc domain 56
  role priority 1
  peer-keepalive destination 56.1.1.6 source 56.1.1.5 vrf default

interface Vlan100
  no shutdown
  vrf member vxlan1000
  ip address 100.1.1.1/24
  fabric forwarding mode anycast-gateway

interface Vlan200
  no shutdown
  vrf member vxlan1000
  ip address 200.1.1.1/24
  fabric forwarding mode anycast-gateway

interface Vlan1000
  no shutdown
  vrf member vxlan1000
  ip forward

interface port-channel1
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  spanning-tree port type network
  vpc peer-link

interface port-channel100
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  vpc 100

interface nve1
  no shutdown
  host-reachability protocol bgp
  source-interface loopback0
  member vni 100
    mcast-group 239.0.0.100
  member vni 200
    mcast-group 239.0.0.200
  member vni 1000 associate-vrf

interface Ethernet1/1
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/3
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  channel-group 1 mode active

interface Ethernet1/4
  no switchport
  ip address 56.1.1.5/24
  no shutdown

interface Ethernet1/5
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  channel-group 100 mode active

interface loopback0
  ip address 5.5.5.5/32
  ip address 56.56.56.56/32 secondary
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode

interface loopback1
  ip address 55.55.55.55/32

router ospf 1
  router-id 5.5.5.5
router bgp 1
  router-id 5.5.5.5
  address-family ipv4 unicast
  address-family l2vpn evpn
  neighbor 1.1.1.1
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
    address-family l2vpn evpn
      send-community
      send-community extended
  neighbor 2.2.2.2
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
    address-family l2vpn evpn
      send-community
      send-community extended
  vrf vxlan1000
    address-family ipv4 unicast
      advertise l2vpn evpn

  

hostname SW6

nv overlay evpn
feature ospf
feature bgp
feature pim
feature interface-vlan
feature vn-segment-vlan-based
feature lacp
feature vpc
feature nv overlay

fabric forwarding anycast-gateway-mac 0000.2222.3333
ip pim rp-address 111.111.111.111 group-list 224.0.0.0/4
ip pim ssm range 232.0.0.0/8

vlan 100
  vn-segment 100
vlan 200
  vn-segment 200
vlan 1000
  vn-segment 1000

vrf context vxlan1000
  vni 1000
  rd auto
  address-family ipv4 unicast
    route-target both auto
    route-target both auto evpn
evpn
  vni 100 l2
    rd auto
    route-target import auto
    route-target export auto
  vni 200 l2
    rd auto
    route-target import auto
    route-target export auto

vpc domain 56
  peer-keepalive destination 56.1.1.5 source 56.1.1.6 vrf default

interface Vlan100
  no shutdown
  vrf member vxlan1000
  ip address 100.1.1.1/24
  fabric forwarding mode anycast-gateway

interface Vlan200
  no shutdown
  vrf member vxlan1000
  ip address 200.1.1.1/24
  fabric forwarding mode anycast-gateway

interface Vlan1000
  no shutdown
  vrf member vxlan1000
  ip forward

interface port-channel1
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  spanning-tree port type network
  vpc peer-link

interface port-channel100
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  vpc 100

interface nve1
  no shutdown
  host-reachability protocol bgp
  source-interface loopback0
  member vni 100
    mcast-group 239.0.0.100
  member vni 200
    mcast-group 239.0.0.200
  member vni 1000 associate-vrf

interface Ethernet1/1
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/2
  no switchport
  medium p2p
  ip unnumbered loopback1
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode
  no shutdown

interface Ethernet1/3
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  channel-group 1 mode active

interface Ethernet1/4
  no switchport
  ip address 56.1.1.6/24
  no shutdown

interface Ethernet1/5
  switchport mode trunk
  switchport trunk allowed vlan 100,200
  channel-group 100 mode active

interface loopback0
  ip address 6.6.6.6/32
  ip address 56.56.56.56/32 secondary
  ip router ospf 1 area 0.0.0.0
  ip pim sparse-mode

interface loopback1
  ip address 66.66.66.66/32

router ospf 1
  router-id 6.6.6.6
router bgp 1
  router-id 5.5.5.5
  address-family ipv4 unicast
  address-family l2vpn evpn
  neighbor 1.1.1.1
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
    address-family l2vpn evpn
      send-community
      send-community extended
  neighbor 2.2.2.2
    remote-as 1
    update-source loopback0
    address-family ipv4 unicast
    address-family l2vpn evpn
      send-community
      send-community extended
  vrf vxlan1000
    address-family ipv4 unicast
      advertise l2vpn evpn

  

hostname SW7(模拟客户端)

feature lacp

vrf context vlan100
  ip route 0.0.0.0/0 100.1.1.1
vrf context vlan200
  ip route 0.0.0.0/0 200.1.1.1

interface port-channel1
  no switchport

interface port-channel1.100
  encapsulation dot1q 100
  vrf member vlan100
  ip address 100.1.1.7/24
  no shutdown

interface port-channel1.200
  encapsulation dot1q 200
  vrf member vlan200
  ip address 200.1.1.7/24
  no shutdown

interface Ethernet1/1
  no switchport
  channel-group 1 mode active
  no shutdown

interface Ethernet1/2
  no switchport
  channel-group 1 mode active
  no shutdown
hostname SW8(模拟客户端)

feature lacp

vrf context vlan100
  ip route 0.0.0.0/0 100.1.1.1
vrf context vlan200
  ip route 0.0.0.0/0 200.1.1.1

interface port-channel1
  no switchport

interface port-channel1.100
  encapsulation dot1q 100
  vrf member vlan100
  ip address 100.1.1.8/24
  no shutdown

interface port-channel1.200
  encapsulation dot1q 200
  vrf member vlan200
  ip address 200.1.1.8/24
  no shutdown

interface Ethernet1/1
  no switchport
  channel-group 1 mode active
  no shutdown

interface Ethernet1/2
  no switchport
  channel-group 1 mode active
  no shutdown

  

  

posted @ 2020-12-26 16:18  贾春旺  阅读(1806)  评论(0编辑  收藏  举报