container-labs

 

containerlab deploy -t sonic-evpn.clab.yml
containerlab destroy -t sonic-evpn.clab.yml
containerlab destroy -t sonic-evpn.clab.yml --cleanup


#containerlab to sonic port mapping

containerlab-YAML      Inside-SONiC-VS          Notes
eth0                            (management)              Reserved for OOB mgmt
eth1                            Ethernet0First               data port
eth2                            Ethernet4Second          data port
eth3                            Ethernet8Third              data port

SONiC increments by 4 (e.g., Ethernet0, Ethernet4, Ethernet8...) because it models 100G ports with 4 lanes each by default in the VS image.



#enable bgp service

sed -i 's/bgpd=no/bgpd=yes/' /etc/frr/daemons
supervisorctl restart zebra
supervisorctl restart bgpd

sed -i 's/ospfd=no/ospfd=yes/' /etc/frr/daemons
supervisorctl restart zebra
supervisorctl restart bgpd
supervisorctl restart ospfd


config interface ip add Loopback0 1.1.1.1/32
config interface ip add Ethernet0 10.0.0.0/31
config vlan add 10
config vlan member add 10 Ethernet4
sonic-db-cli CONFIG_DB HSET "VXLAN_TUNNEL|vxlan0" src_ip 1.1.1.1
sonic-db-cli CONFIG_DB HSET "VXLAN_TUNNEL_MAP|vxlan0|map_10010_10" vni 10010 vlan 10
vtysh
conf t
router bgp 65000
 bgp router-id 1.1.1.1
 neighbor 10.0.0.1 remote-as 65000
 address-family l2vpn evpn
  advertise-all-vni
  neighbor 10.0.0.1 activate
 exit-address-family
exit
interface Ethernet0
no shut
interface eth1
no shut

config interface ip add Loopback0 2.2.2.2/32
config interface ip add Ethernet0 10.0.0.3/31
config vlan add 10
config vlan member add 10 Ethernet4
sonic-db-cli CONFIG_DB HSET "VXLAN_TUNNEL|vxlan0" src_ip 2.2.2.2
sonic-db-cli CONFIG_DB HSET "VXLAN_TUNNEL_MAP|vxlan0|map_10010_10" vni 10010 vlan 10
vtysh
conf t
router bgp 65000
 bgp router-id 2.2.2.2
 neighbor 10.0.0.2 remote-as 65000
 address-family l2vpn evpn
  advertise-all-vni
  neighbor 10.0.0.2 activate
 exit-address-family
 
 
config vlan add 10
config vlan member add 10 Ethernet4
config vxlan add vxlan0
config vxlan add vtep vxlan0 2.2.2.2
config vxlan add vni 10010
config vxlan map add vxlan0 10 10010
config interface ip add Loopback0 3.3.3.3/32
config interface ip add Ethernet0 10.0.0.1/31
config interface ip add Ethernet4 10.0.0.2/31
conf t
router bgp 65000
 bgp router-id 3.3.3.3
 neighbor 10.0.0.0 remote-as 65000
 neighbor 10.0.0.3 remote-as 65000
 address-family l2vpn evpn
  neighbor 10.0.0.0 activate
  neighbor 10.0.0.3 activate
  neighbor 10.0.0.0 route-reflector-client
  neighbor 10.0.0.3 route-reflector-client
 exit-address-family
 
 
ip addr add 10.10.10.1/24 dev eth1
ip link set eth1 up
ip addr add 10.10.10.2/24 dev eth1
ip link set eth1 up

leaf1# show ip route
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure
IPv4 unicast VRF default:
K>* 0.0.0.0/0 [0/0] via 172.20.20.1, eth0, weight 1, 00:52:16
C>* 1.1.1.1/32 is directly connected, Loopback0, weight 1, 00:47:11
K>* 2.2.2.2/32 [0/0] via 10.0.0.1, Ethernet0, weight 1, 00:05:09
K>* 3.3.3.3/32 [0/0] via 10.0.0.1, Ethernet0, weight 1, 00:02:11
C>* 10.0.0.0/31 is directly connected, Ethernet0, weight 1, 00:38:22
C>* 172.20.20.0/24 is directly connected, eth0, weight 1, 00:52:16
leaf1#
leaf2# sh ip route
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure
IPv4 unicast VRF default:
K>* 0.0.0.0/0 [0/0] via 172.20.20.1, eth0, weight 1, 00:07:28
K>* 1.1.1.1/32 [0/0] via 10.0.0.3, Ethernet0, weight 1, 00:05:02
C>* 2.2.2.2/32 is directly connected, Loopback0, weight 1, 00:07:28
K>* 3.3.3.3/32 [0/0] via 10.0.0.3, Ethernet0, weight 1, 00:00:51
C>* 10.0.0.2/31 is directly connected, Ethernet0, weight 1, 00:07:28
C>* 172.20.20.0/24 is directly connected, eth0, weight 1, 00:07:28
leaf2#


\spine# sh ip route
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure
IPv4 unicast VRF default:
K>* 0.0.0.0/0 [0/0] via 172.20.20.1, eth0, weight 1, 00:33:18
K>* 1.1.1.1/32 [0/0] via 10.0.0.0, Ethernet0, weight 1, 00:05:08
K>* 2.2.2.2/32 [0/0] via 10.0.0.2, Ethernet4, weight 1, 00:05:01
C>* 3.3.3.3/32 is directly connected, Loopback0, weight 1, 00:33:18
C>* 10.0.0.0/31 is directly connected, Ethernet0, weight 1, 00:31:42
C>* 10.0.0.2/31 is directly connected, Ethernet4, weight 1, 00:30:23
C>* 172.20.20.0/24 is directly connected, eth0, weight 1, 00:33:18


Comments

Popular posts from this blog

eBGP sonic lab + Ansible config & validation

SONiC-2

RDMA RoCE