FRR EVPN 对称分布式网关(SDR) 配置及拓扑

拓扑:

 

 

配置:

50.57 配置:

kernel config:

#对称 symmetric distributed routing

#DUT1
#create namespace ns1, add virtual eth veth1 connect to host1 in namespace
#host1  10.1.1.2/24  00:00:00:00:00:01  gateway:10.1.1.1
ip netns add ns1
ip link add veth1 type veth peer name host1 netns ns1
ip netns exec ns1 ip link set lo up
ip netns exec ns1 ip link set host1 address 00:00:00:00:00:01
ip netns exec ns1 ip link set host1 up
ip netns exec ns1 ip addr add 10.1.1.2/24 dev host1
ip netns exec ns1 ip route add default via 10.1.1.1 dev host1


#host2  20.1.1.2/24 gateway:20.1.1.1
ip netns add ns2
ip link add veth2 type veth peer name host2 netns ns2
ip netns exec ns2 ip link set lo up
ip netns exec ns2 ip link set host2 address 00:00:00:00:00:02
ip netns exec ns2 ip link set host2 up
ip netns exec ns2 ip addr add 20.1.1.2/24 dev host2
ip netns exec ns2 ip route add default via 20.1.1.1 dev host2


#add bridge including vxlan instance and access port veth1
#bridge10  veth1+vxlan10 IP:10.1.1.1  MAC:00:00:0a:00:00:01
ip link add br10 type bridge
ip link add vxlan10 type vxlan id 10 local 10.10.18.209 dstport 4789 nolearning
ip link set br10 up
ip link set veth1 up
ip link set vxlan10 up
ip link set veth1 master br10
ip link set vxlan10 master br10
ip link set dev br10 address 00:00:0a:00:00:01
ip addr add 10.1.1.1/24 dev br10

#bridge20  veth2+vxlan20 IP:20.1.1.1  MAC:00:00:14:00:00:01
ip link add br20 type bridge
ip link add vxlan20 type vxlan id 20 local 10.10.18.209 dstport 4789 nolearning
ip link set br20 up
ip link set veth2 up
ip link set vxlan20 up
ip link set veth2 master br20
ip link set vxlan20 master br20
ip link set dev br20 address 00:00:14:00:00:01
ip addr add 20.1.1.1/24 dev br20

#bridge100  L3 vxlan100 IP:x  MAC:00:00:64:00:00:01
ip link add br100 type bridge
ip link add vxlan100 type vxlan id 100 local 10.10.18.209 dstport 4789 nolearning
ip link set br100 up
ip link set vxlan100 up
ip link set vxlan100 master br100
ip link set vxlan100 master br100
ip link set dev br100 address 00:00:64:00:00:01
#ip addr add 100.1.1.1/24 dev br100



# add vrf
ip link add vrf1 type vrf table 100
ip link set vrf1 up
ip link set br100 master vrf1 
ip link set br10 master vrf1
ip link set br20 master vrf1

CLI config:

vrf vrf1
 vni 100
 exit-vrf
!
router bgp 8888
 bgp router-id 10.10.18.209
 bgp bestpath as-path multipath-relax
 neighbor fabric peer-group
 neighbor fabric remote-as external
 neighbor 10.10.18.212 peer-group fabric
 neighbor 10.10.18.212 update-source 10.10.18.209
 !
 address-family l2vpn evpn
  neighbor fabric activate
  advertise-all-vni
 exit-address-family
!
router bgp 8888 vrf vrf1
 !
 address-family l2vpn evpn
  advertise ipv4 unicast
 exit-address-family

50.204 配置:

kernel config:

#DUT2  50.204
#create namespace ns1, add virtual eth veth3 connect to host3 in namespace
#host3  10.1.1.3/24  00:00:00:00:00:03  gateway:10.1.1.1
ip netns add ns3
ip link add veth3 type veth peer name host3 netns ns3
ip netns exec ns3 ip link set lo up
ip netns exec ns3 ip link set host3 address 00:00:00:00:00:03
ip netns exec ns3 ip link set host3 up
ip netns exec ns3 ip addr add 10.1.1.3/24 dev host3
ip netns exec ns3 ip route add default via 10.1.1.1 dev host3


#host4  20.1.1.4/24 gateway:20.1.1.1
ip netns add ns4
ip link add veth4 type veth peer name host4 netns ns4
ip netns exec ns4 ip link set lo up
ip netns exec ns4 ip link set host4 address 00:00:00:00:00:04
ip netns exec ns4 ip link set host4 up
ip netns exec ns4 ip addr add 20.1.1.4/24 dev host4
ip netns exec ns4 ip route add default via 20.1.1.1 dev host4


#add bridge including vxlan instance and access port veth1
#bridge10  veth1+vxlan10 IP:10.1.1.1  MAC:00:00:0a:00:00:01
ip link add br10 type bridge
ip link add vxlan10 type vxlan id 10 local 10.10.18.212 dstport 4789 nolearning
ip link set br10 up
ip link set veth3 up
ip link set vxlan10 up
ip link set veth3 master br10
ip link set vxlan10 master br10
ip link set dev br10 address 00:00:0a:00:00:01
ip addr add 10.1.1.1/24 dev br10

#bridge20  veth2+vxlan20 IP:20.1.1.1  MAC:00:00:14:00:00:01
ip link add br20 type bridge
ip link add vxlan20 type vxlan id 20 local 10.10.18.212 dstport 4789 nolearning
ip link set br20 up
ip link set veth4 up
ip link set vxlan20 up
ip link set veth4 master br20
ip link set vxlan20 master br20
ip link set dev br20 address 00:00:14:00:00:01
ip addr add 20.1.1.1/24 dev br20

#bridge100  L3 vxlan100 IP:x  MAC:00:00:64:00:00:01
ip link add br100 type bridge
ip link add vxlan100 type vxlan id 100 local 10.10.18.212 dstport 4789 nolearning
ip link set br100 up
ip link set vxlan100 up
ip link set vxlan100 master br100
ip link set vxlan100 master br100
ip link set dev br100 address 00:00:64:00:00:02
#ip addr add 100.1.1.1/24 dev br100



# add vrf
ip link add vrf1 type vrf table 100
ip link set vrf1 up
ip link set br100 master vrf1 
ip link set br10 master vrf1
ip link set br20 master vrf1

CLI config:

vrf vrf1
 vni 100
 exit-vrf
!
router bgp 9999
 bgp router-id 10.10.18.212
 bgp bestpath as-path multipath-relax
 neighbor fabric peer-group
 neighbor fabric remote-as external
 neighbor 10.10.18.209 peer-group fabric
 neighbor 10.10.18.209 update-source 10.10.18.212
 !
 address-family l2vpn evpn
  neighbor fabric activate
  advertise-all-vni
 exit-address-family
!
router bgp 9999 vrf vrf1
 address-family l2vpn evpn
  advertise ipv4 unicast
 exit-address-family
 

 

posted @ 2020-11-19 16:26  ***的博客  阅读(658)  评论(0编辑  收藏  举报