VXLAN/EVPN on Linux + frrouting


节点1:-bgp配置

[root@localhost ~]# cat  /etc/frr/bgpd.conf
!
! Zebra configuration saved from vty
!   2020/02/25 08:59:54
!
frr version 7.3-MyOwnFRRVersion
frr defaults traditional
!
hostname localhost.localdomain
log file /var/log/frr/bgpd.log
!
!
!
router bgp 81
 bgp router-id 10.10.16.81
 bgp bestpath as-path multipath-relax
 neighbor 10.10.16.82 remote-as external
 neighbor 10.10.16.82 update-source 10.10.16.81
 neighbor 10.10.16.82  ebgp-multihop
 !
 address-family ipv4 unicast
  neighbor fabric activate
 exit-address-family
 !
 address-family l2vpn evpn
  neighbor 10.10.16.82 activate
  advertise-all-vni
 exit-address-family
!
!
line vty
!

节点1-网络配置

ip netns add host2
ip link add veth1 type veth peer name eth0 netns host2
ip netns exec host2 ip link set lo up
ip netns exec host2 ip link set eth0 up
ip netns exec host2 ip addr add 10.81.81.81/24 dev eth0
ip link add br10 type bridge
ip link add vxlan10 type vxlan id 10 local 10.10.16.81 dstport 4790 nolearning
ip link set br10 up
ip link set vxlan10 up
ip link set veth1 up
ip link set veth1 master br10
ip link set vxlan10 master br10

节点2-bgp配置

[root@kunpeng82 devuser]# cat  /etc/frr/bgpd.conf
!
! Zebra configuration saved from vty
!   2020/02/21 06:58:10
!
frr version 7.3-MyOwnFRRVersion
frr defaults traditional
!
hostname kunpeng82.bogon
log file /var/log/frr/bgpd.log
!
!
!
router bgp 82
 bgp router-id 10.10.16.82
 bgp bestpath as-path multipath-relax
 neighbor 10.10.16.81 remote-as external
 neighbor 10.10.16.81 update-source 10.10.16.82
 neighbor 10.10.16.81  ebgp-multihop
 !
 address-family ipv4 unicast
  neighbor fabric activate
 exit-address-family
 !
 address-family l2vpn evpn
  neighbor 10.10.16.81 activate
  advertise-all-vni
 exit-address-family
!
!
line vty
!

节点2-网络配置

ip netns add host2
 ip link add veth1 type veth peer name eth0 netns host2
 ip netns exec host2 ip link set lo up
 ip netns exec host2 ip link set eth0 up
 ip netns exec host2 ip addr add 10.82.82.82/24 dev eth0 
 ip link add br10 type bridge
 ip link add vxlan10 type vxlan id 10 local 10.10.16.82 dstport 4790 nolearning
 ip link set br10 up
 ip link set vxlan10 up
 ip link set veth1 up  
 ip link set veth1 master br10
 ip link set vxlan10 master br10 

节点1-邻居

localhost.localdomain# show bgp neighbors
BGP neighbor is 10.10.16.82, remote AS 82, local AS 81, external link
Hostname: kunpeng82.bogon
  BGP version 4, remote router ID 10.10.16.82, local router ID 10.10.16.81
  BGP state = Established, up for 00:00:23
  Last read 00:00:22, Last write 00:00:22
  Hold time is 180, keepalive interval is 60 seconds
  Neighbor capabilities:
    4 Byte AS: advertised and received
    AddPath:
      IPv4 Unicast: RX advertised IPv4 Unicast and received
      L2VPN EVPN: RX advertised L2VPN EVPN and received
    Route refresh: advertised and received(old & new)
    Address Family IPv4 Unicast: advertised and received
    Address Family L2VPN EVPN: advertised and received
    Hostname Capability: advertised (name: localhost.localdomain,domain name: n/a) received (name: kunpeng82.bogon,domain name: n/a)
    Graceful Restart Capabilty: advertised and received
      Remote Restart timer is 120 seconds
      Address families by peer:
        none
  Graceful restart information:
    End-of-RIB send: IPv4 Unicast, L2VPN EVPN
    End-of-RIB received: IPv4 Unicast, L2VPN EVPN
  Message statistics:
    Inq depth is 0
    Outq depth is 0
                         Sent       Rcvd
    Opens:                  1          1
    Notifications:          0          0
    Updates:                4          4
    Keepalives:             1          1
    Route Refresh:          0          0
    Capability:             0          0
    Total:                  6          6
  Minimum time between advertisement runs is 0 seconds
  Update source is 10.10.16.81

 For address family: IPv4 Unicast
  Update group 1, subgroup 1
  Packet Queue length 0
  Community attribute sent to this neighbor(all)
  0 accepted prefixes

 For address family: L2VPN EVPN
  Update group 2, subgroup 2
  Packet Queue length 0
  NEXT_HOP is propagated unchanged to this neighbor
  Community attribute sent to this neighbor(all)
  advertise-all-vni
  1 accepted prefixes

  Connections established 1; dropped 0
  Last reset 00:00:24,   Waiting for NHT
  External BGP neighbor may be up to 255 hops away.
Local host: 10.10.16.81, Local port: 33113
Foreign host: 10.10.16.82, Foreign port: 179
Nexthop: 10.10.16.81
Nexthop global: ::
Nexthop local: ::
BGP connection: shared network
BGP Connect Retry Timer in Seconds: 120
Read thread: on  Write thread: on  FD used: 24


localhost.localdomain# show ip bgp summary

IPv4 Unicast Summary:
BGP router identifier 10.10.16.81, local AS number 81 vrf-id 0
BGP table version 0
RIB entries 0, using 0 bytes of memory
Peers 1, using 20 KiB of memory

Neighbor        V         AS MsgRcvd MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd
10.10.16.82     4         82       9       9        0    0    0 00:03:58            0

 show bgp l2vpn evpn

 

 

3、tcpdump & ping

 

 

 

 

 4、更改节点2 host的网段

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM