Saturday, May 28, 2022
HomeNetworkingMulti-Platform Customized Configuration Templates in netsim-tools « ipSpace.web weblog

Multi-Platform Customized Configuration Templates in netsim-tools « ipSpace.web weblog


Within the Constructing a BGP Anycast Lab I described how you possibly can use customized configuration templates to increase the performance of netsim-tools.

That instance used Cisco IOS… however what if you wish to check the identical performance on a number of platforms? netsim-tools gives a pleasant trick: the customized configuration template may level to a listing with platform-specific templates. Let me present you the way that works…

We’ll begin with the BGP anycast topology, however change the lab units to a mixture of Cisco IOS, Arista EOS, and Cumulus VX:

  • Most units will run Cisco IOSv
  • One of many leaf switches and one of many anycast nodes will run Arista EOS
  • One other anycast node will run Cumulus VX

Bodily lab topology

Lab topology definition

module: [ ospf, bgp ]
defaults.bgp.extra_attributes.node: [ anycast ]

bgp:
  as_list:
    65000:
      members: [ l1, l2, l3, s1 ]
      rr: [ s1 ]
    65101:
      members: [ a1,a2,a3 ]

defaults.gadget: iosv

nodes: 
  l1:
  l2:
    gadget: eos
  l3:
  s1:
  a1:
  a2:
    gadget: eos
  a3:
	  gadget: cumulus

hyperlinks: [ s1-l1, s1-l2, s1-l3, l2-a1, l2-a2, l3-a3 ]

Now for the multi-platform customized configuration trick: we’ll specify directories as a substitute of template file names in group config attributes (learn the BGP anycast weblog publish for extra particulars).

Utilizing directories as customized configuration templates

teams:
  as65000:
    config: [ bgp-addpath ]
  as65101:
    config: [ bgp-anycast ]
    node_data:
      bgp.anycast: 10.42.42.42/32
      bgp.advertise_loopback: False

The remaining lab topology file is obtainable on GitHub.

We’ll have three information throughout the bgp-anycast listing: ios.j2, eos.j2 and cumulus.j2:

Customized configuration template for Cisco IOS (bgp-anycast/ios.j2)

{% if bgp is outlined and bgp.anycast is outlined %}
interface loopback 42
 ip deal with {ipaddr('deal with') } {ipaddr('netmask') }
!
router bgp {{ bgp.as }}
 address-family ipv4
  community {ipaddr('deal with') } masks {ipaddr('netmask') }
{% endif %}

Customized configuration template for Arista EOS (bgp-anycast/eos.j2)

{% if bgp is outlined and bgp.anycast is outlined %}
interface loopback 42
 ip deal with {{ bgp.anycast }}
!
router bgp {{ bgp.as }}
 address-family ipv4
  community {ipaddr('0') }
{% endif %}

Customized configuration template for Cumulus VX (bgp-anycast/cumulus.j2)

{% if bgp is outlined and bgp.anycast is outlined %}
interface lo
 ip deal with {{ bgp.anycast }} label anycast
!
router bgp {{ bgp.as }}
 address-family ipv4
  community {ipaddr('0') }
{% endif %}

Ansible playbook printout generated through the lab initialization (utilizing netlab up -q command) shows the templates used to configure lab units – as you’ll be able to see, each platform makes use of a unique configuration template.

# ios_config: deploying bgp-anycast from /dwelling/pipi/net101/multi-platform/bgp-anycast/bgp-anycast/ios.j2 ******************
  * a1                         - modified=True --  ---------------------------------------------
...
# eos_config: deploying bgp-anycast from /dwelling/pipi/net101/multi-platform/bgp-anycast/bgp-anycast/eos.j2 ******************
  * a2                         - modified=True --  ---------------------------------------------
.....
# run vtysh to import bgp-anycast config from /dwelling/pipi/net101/multi-platform/bgp-anycast/bgp-anycast/cumulus.j2 *********
  * a3                         - modified=True --  ---------------------------------------------
...
# ios_config: deploying bgp-addpath from /dwelling/pipi/net101/multi-platform/bgp-anycast/bgp-addpath/ios.j2 ******************
  * l1                         - modified=True --  ---------------------------------------------
...
# eos_config: deploying bgp-addpath from /dwelling/pipi/net101/multi-platform/bgp-anycast/bgp-addpath/eos.j2 ******************
  * l2                         - modified=True --  ---------------------------------------------
...
# ios_config: deploying bgp-addpath from /dwelling/pipi/net101/multi-platform/bgp-anycast/bgp-addpath/ios.j2 ******************
  * l3                         - modified=True --  ---------------------------------------------
...
# ios_config: deploying bgp-addpath from /dwelling/pipi/net101/multi-platform/bgp-anycast/bgp-addpath/ios.j2 ******************
  * s1                         - modified=True --  ---------------------------------------------

Need to check this performance by yourself? Set up netsim-tools (and a bunch of different stuff), obtain the lab topology and customized configuration templates from GitHub, and execute netlab up.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments