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

ip prefix-list route seq 5 deny 0.0.0.0/0 eq 32 
ip prefix-list route seq 10 permit 0.0.0.0/0 le 32 

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 Ethernet1/6
  no switchport
  vrf member vxlan1000
  ip address 198.1.1.5/24
  no shutdown

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
      network 100.1.1.0/24
      network 200.1.1.0/24
      advertise l2vpn evpn
    neighbor 198.1.1.9
      remote-as 2
      address-family ipv4 unicast
        send-community
        send-community extended
        prefix-list route out

  

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

ip prefix-list route seq 5 deny 0.0.0.0/0 eq 32 
ip prefix-list route seq 10 permit 0.0.0.0/0 le 32 

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 Ethernet1/6
  no switchport
  vrf member vxlan1000
  ip address 197.1.1.6/24
  no shutdown

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
      network 100.1.1.0/24
      network 200.1.1.0/24
      advertise l2vpn evpn
    neighbor 197.1.1.10
      remote-as 2
      address-family ipv4 unicast
        send-community
        send-community extended
        prefix-list route out

  

hostname SW9

feature ospf
feature bgp

interface Ethernet1/1
  no switchport
  medium p2p
  ip address 199.199.199.0/31
  ip router ospf 1 area 0.0.0.0
  no shutdown

interface Ethernet1/6
  no switchport
  ip address 198.1.1.9/24
  no shutdown

interface loopback0
  ip address 200.200.200.9/32
  ip router ospf 1 area 0.0.0.0

router ospf 1
  router-id 200.200.200.9
router bgp 2
  router-id 200.200.200.9
  address-family ipv4 unicast
    network 200.200.200.9/32
  neighbor 198.1.1.5
    remote-as 1
    address-family ipv4 unicast
  neighbor 200.200.200.10
    remote-as 2
    update-source loopback0
    address-family ipv4 unicast
      next-hop-self

  

hostname SW10

feature ospf
feature bgp

interface Ethernet1/1
  no switchport
  medium p2p
  ip address 199.199.199.1/31
  ip router ospf 1 area 0.0.0.0
  no shutdown

interface Ethernet1/6
  no switchport
  ip address 197.1.1.10/24
  no shutdown

interface loopback0
  ip address 200.200.200.10/32
  ip router ospf 1 area 0.0.0.0

router ospf 1
  router-id 200.200.200.10
router bgp 2
  router-id 200.200.200.10
  address-family ipv4 unicast
    network 200.200.200.10/32
  neighbor 197.1.1.6
    remote-as 1
    address-family ipv4 unicast
  neighbor 200.200.200.9
    remote-as 2
    update-source loopback0
    address-family ipv4 unicast
      next-hop-self

  

 

posted @ 2020-12-30 08:49  贾春旺  阅读(713)  评论(0编辑  收藏  举报