EVPN和MPLSVPN
EVPN
hostname N1 nv overlay evpn feature ospf feature bgp interface Ethernet1/1 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/2 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/3 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/4 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/5 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/6 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface loopback0 ip address 1.1.1.1/32 ip router ospf 1 area 0.0.0.0 interface loopback1 ip address 11.11.11.11/32 router ospf 1 router-id 1.1.1.1 router bgp 1 router-id 1.1.1.1 address-family l2vpn evpn retain route-target all template peer ibgp remote-as 1 update-source loopback0 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 neighbor 7.7.7.7 inherit peer ibgp neighbor 8.8.8.8 inherit peer ibgp
hostname N2 nv overlay evpn feature ospf feature bgp interface Ethernet1/1 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/2 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/3 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/4 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/5 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/6 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface loopback0 ip address 2.2.2.2/32 ip router ospf 1 area 0.0.0.0 interface loopback1 ip address 22.22.22.22/32 router ospf 1 router-id 2.2.2.2 router bgp 1 router-id 2.2.2.2 address-family l2vpn evpn retain route-target all template peer ibgp remote-as 1 update-source loopback0 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 neighbor 7.7.7.7 inherit peer ibgp neighbor 8.8.8.8 inherit peer ibgp
hostname N3 nv overlay evpn feature ospf feature bgp feature interface-vlan feature vn-segment-vlan-based feature lacp feature vpc feature nv overlay fabric forwarding anycast-gateway-mac 0002.0002.0002 vlan 100,200,1000 vlan 100 vn-segment 100 vlan 200 vn-segment 200 vlan 1000 vn-segment 1000 vrf context lucifer vni 1000 rd auto address-family ipv4 unicast route-target both auto route-target both auto evpn vrf context vpc vpc domain 34 peer-keepalive destination 34.1.1.1 source 34.1.1.0 vrf vpc interface Vlan100 no shutdown vrf member lucifer ip address 100.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan200 no shutdown vrf member lucifer ip address 200.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan1000 no shutdown vrf member lucifer 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 ingress-replication protocol bgp member vni 200 ingress-replication protocol bgp member vni 1000 associate-vrf interface Ethernet1/1 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/2 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/3 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 1 mode active interface Ethernet1/4 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 1 mode active interface Ethernet1/5 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 100 mode active interface Ethernet1/7 no switchport vrf member vpc ip address 34.1.1.0/31 no shutdown 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 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 l2vpn evpn template peer ibgp remote-as 1 update-source loopback0 address-family l2vpn evpn send-community send-community extended neighbor 1.1.1.1 inherit peer ibgp neighbor 2.2.2.2 inherit peer ibgp 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
hostname N4 nv overlay evpn feature ospf feature bgp feature interface-vlan feature vn-segment-vlan-based feature lacp feature vpc feature nv overlay fabric forwarding anycast-gateway-mac 0002.0002.0002 vlan 100,200,1000 vlan 100 vn-segment 100 vlan 200 vn-segment 200 vlan 1000 vn-segment 1000 vrf context lucifer vni 1000 rd auto address-family ipv4 unicast route-target both auto route-target both auto evpn vrf context vpc vpc domain 34 peer-keepalive destination 34.1.1.0 source 34.1.1.1 vrf vpc interface Vlan100 no shutdown vrf member lucifer ip address 100.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan200 no shutdown vrf member lucifer ip address 200.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan1000 no shutdown vrf member lucifer 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 ingress-replication protocol bgp member vni 200 ingress-replication protocol bgp member vni 1000 associate-vrf interface Ethernet1/1 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/2 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/3 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 1 mode active interface Ethernet1/4 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 1 mode active interface Ethernet1/6 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 100 mode active interface Ethernet1/7 no switchport vrf member vpc ip address 34.1.1.1/31 no shutdown 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 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 l2vpn evpn template peer ibgp remote-as 1 update-source loopback0 address-family l2vpn evpn send-community send-community extended neighbor 1.1.1.1 inherit peer ibgp neighbor 2.2.2.2 inherit peer ibgp 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
hostname N5 nv overlay evpn feature ospf feature bgp feature interface-vlan feature vn-segment-vlan-based feature lacp feature vpc feature nv overlay fabric forwarding anycast-gateway-mac 0002.0002.0002 vlan 100,200,1000 vlan 100 vn-segment 100 vlan 200 vn-segment 200 vlan 1000 vn-segment 1000 vrf context lucifer vni 1000 rd auto address-family ipv4 unicast route-target both auto route-target both auto evpn vrf context vpc vpc domain 56 peer-keepalive destination 56.1.1.1 source 56.1.1.0 vrf vpc interface Vlan100 no shutdown vrf member lucifer ip address 100.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan200 no shutdown vrf member lucifer ip address 200.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan1000 no shutdown vrf member lucifer 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 ingress-replication protocol bgp member vni 200 ingress-replication protocol bgp member vni 1000 associate-vrf interface Ethernet1/1 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/2 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/3 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 1 mode active interface Ethernet1/4 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 1 mode active interface Ethernet1/5 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 100 mode active interface Ethernet1/7 no switchport vrf member vpc ip address 56.1.1.0/31 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 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 l2vpn evpn template peer ibgp remote-as 1 update-source loopback0 address-family l2vpn evpn send-community send-community extended neighbor 1.1.1.1 inherit peer ibgp neighbor 2.2.2.2 inherit peer ibgp 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
hostname N6 nv overlay evpn feature ospf feature bgp feature interface-vlan feature vn-segment-vlan-based feature lacp feature vpc feature nv overlay fabric forwarding anycast-gateway-mac 0002.0002.0002 vlan 100,200,1000 vlan 100 vn-segment 100 vlan 200 vn-segment 200 vlan 1000 vn-segment 1000 vrf context lucifer vni 1000 rd auto address-family ipv4 unicast route-target both auto route-target both auto evpn vrf context vpc vpc domain 56 peer-keepalive destination 56.1.1.0 source 56.1.1.1 vrf vpc interface Vlan100 no shutdown vrf member lucifer ip address 100.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan200 no shutdown vrf member lucifer ip address 200.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan1000 no shutdown vrf member lucifer 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 ingress-replication protocol bgp member vni 200 ingress-replication protocol bgp member vni 1000 associate-vrf interface Ethernet1/1 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/2 no switchport medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/3 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 1 mode active interface Ethernet1/4 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 1 mode active interface Ethernet1/6 switchport mode trunk switchport trunk allowed vlan 100,200 channel-group 100 mode active interface Ethernet1/7 no switchport vrf member vpc ip address 56.1.1.1/31 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 interface loopback1 ip address 66.66.66.66/32 router ospf 1 router-id 6.6.6.6 router bgp 1 router-id 6.6.6.6 address-family l2vpn evpn template peer ibgp remote-as 1 update-source loopback0 address-family l2vpn evpn send-community send-community extended neighbor 1.1.1.1 inherit peer ibgp neighbor 2.2.2.2 inherit peer ibgp 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
EVPN客户端
hostname N7 feature lacp vrf context vlan100 ip route 0.0.0.0/0 100.1.1.1 address-family ipv4 unicast 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/5 no switchport channel-group 1 mode active no shutdown interface Ethernet1/6 no switchport channel-group 1 mode active no shutdown
hostname N8 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/5 no switchport channel-group 1 mode active no shutdown interface Ethernet1/6 no switchport channel-group 1 mode active no shutdown
MPLSVPN
hostname R9 vrf lucifer address-family ipv4 unicast import route-target 1:1 export route-target 1:1 interface Loopback0 ipv4 address 9.9.9.9 255.255.255.255 interface Loopback1 vrf lucifer ipv4 address 109.109.109.109 255.255.255.255 interface GigabitEthernet0/0/0/0 ipv4 address 90.1.1.9 255.255.255.0 interface GigabitEthernet0/0/0/1 ipv4 address 200.1.1.1 255.255.255.254 route-policy pass pass end-policy router static address-family ipv4 unicast 200.1.1.0/32 GigabitEthernet0/0/0/1 router ospf 1 router-id 9.9.9.9 segment-routing mpls segment-routing forwarding mpls area 0 segment-routing forwarding mpls segment-routing mpls interface Loopback0 prefix-sid index 1 interface GigabitEthernet0/0/0/0 network point-to-point router bgp 10 bgp router-id 9.9.9.9 address-family vpnv4 unicast neighbor 200.1.1.0 remote-as 1 address-family vpnv4 unicast route-policy pass in route-policy pass out neighbor 10.10.10.10 remote-as 10 update-source Loopback0 address-family vpnv4 unicast next-hop-self vrf lucifer rd 1:1 address-family ipv4 unicast redistribute connected
hostname R10 vrf lucifer address-family ipv4 unicast import route-target 1:1 export route-target 1:1 interface Loopback0 ipv4 address 10.10.10.10 255.255.255.255 interface Loopback1 vrf lucifer ipv4 address 110.110.110.110 255.255.255.255 interface GigabitEthernet0/0/0/0 ipv4 address 90.1.1.10 255.255.255.0 interface GigabitEthernet0/0/0/1 ipv4 address 201.1.1.1 255.255.255.254 route-policy pass pass end-policy router static address-family ipv4 unicast 201.1.1.0/32 GigabitEthernet0/0/0/1 router ospf 1 router-id 10.10.10.10 segment-routing mpls segment-routing forwarding mpls area 0 segment-routing forwarding mpls segment-routing mpls interface Loopback0 prefix-sid index 2 interface GigabitEthernet0/0/0/0 network point-to-point router bgp 10 bgp router-id 10.10.10.10 address-family vpnv4 unicast neighbor 9.9.9.9 remote-as 10 update-source Loopback0 address-family vpnv4 unicast next-hop-self neighbor 201.1.1.0 remote-as 1 address-family vpnv4 unicast route-policy pass in route-policy pass out vrf lucifer rd 1:1 address-family ipv4 unicast redistribute connected
BorderPE(EVPN——MPLSVPN)
hostname X install feature-set mpls feature-set mpls nv overlay evpn feature ospf feature bgp feature mpls l3vpn feature mpls segment-routing feature interface-vlan feature vn-segment-vlan-based feature nv overlay fabric forwarding anycast-gateway-mac 0002.0002.0002 vlan 100,200,1000 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 route-map route permit 10 match ip address prefix-list route route-map passall permit 10 vrf context lucifer vni 1000 rd auto address-family ipv4 unicast route-target both auto route-target both auto evpn route-target import 1:1 route-target export 1:1 interface Vlan100 no shutdown vrf member lucifer ip address 100.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan200 no shutdown vrf member lucifer ip address 200.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan1000 no shutdown vrf member lucifer ip forward interface nve1 no shutdown host-reachability protocol bgp source-interface loopback0 member vni 100 ingress-replication protocol bgp member vni 200 ingress-replication protocol bgp member vni 1000 associate-vrf interface Ethernet1/1 medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/2 medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/3 ip address 200.1.1.0/31 mpls ip forwarding no shutdown interface loopback0 ip address 7.7.7.7/32 ip router ospf 1 area 0.0.0.0 interface loopback1 ip address 77.77.77.77/32 router ospf 1 router-id 7.7.7.7 router bgp 1 router-id 7.7.7.7 address-family vpnv4 unicast address-family l2vpn evpn template peer ibgp remote-as 1 update-source loopback0 address-family l2vpn evpn send-community send-community extended import vpn unicast reoriginate neighbor 1.1.1.1 inherit peer ibgp neighbor 2.2.2.2 inherit peer ibgp neighbor 200.1.1.1 remote-as 10 address-family vpnv4 unicast send-community send-community extended route-map passall in route-map route out import l2vpn evpn reoriginate vrf lucifer address-family ipv4 unicast
network 100.1.1.0/24 network 200.1.1.0/24
hostname Y install feature-set mpls feature-set mpls nv overlay evpn feature ospf feature bgp feature mpls l3vpn feature mpls segment-routing feature interface-vlan feature vn-segment-vlan-based feature nv overlay fabric forwarding anycast-gateway-mac 0002.0002.0002 vlan 100,200,1000 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 route-map route permit 10 match ip address prefix-list route route-map passall permit 10 vrf context lucifer vni 1000 rd auto address-family ipv4 unicast route-target both auto route-target both auto evpn route-target import 1:1 route-target export 1:1 interface Vlan100 no shutdown vrf member lucifer ip address 100.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan200 no shutdown vrf member lucifer ip address 200.1.1.1/24 fabric forwarding mode anycast-gateway interface Vlan1000 no shutdown vrf member lucifer ip forward interface nve1 no shutdown host-reachability protocol bgp source-interface loopback0 member vni 100 ingress-replication protocol bgp member vni 200 ingress-replication protocol bgp member vni 1000 associate-vrf interface Ethernet1/1 medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/2 medium p2p ip unnumbered loopback1 ip ospf network point-to-point ip router ospf 1 area 0.0.0.0 no shutdown interface Ethernet1/3 ip address 201.1.1.0/31 mpls ip forwarding no shutdown interface loopback0 ip address 8.8.8.8/32 ip router ospf 1 area 0.0.0.0 interface loopback1 ip address 88.88.88.88/32 router ospf 1 router-id 8.8.8.8 router bgp 1 router-id 8.8.8.8 address-family vpnv4 unicast address-family l2vpn evpn template peer ibgp remote-as 1 update-source loopback0 address-family l2vpn evpn send-community send-community extended import vpn unicast reoriginate neighbor 1.1.1.1 inherit peer ibgp neighbor 2.2.2.2 inherit peer ibgp neighbor 201.1.1.1 remote-as 10 address-family vpnv4 unicast send-community send-community extended route-map passall in route-map route out import l2vpn evpn reoriginate vrf lucifer address-family ipv4 unicast network 100.1.1.0/24 network 200.1.1.0/24