From afff78fdfaf72f18dffdaefc3030914d7ac224e5 Mon Sep 17 00:00:00 2001 From: Shannon Byrnes Date: Fri, 31 Jan 2025 12:24:22 -0700 Subject: [PATCH] take 5 --- .../startup-config/cisco1.conf | 33 ++++++---------- .../startup-config/cisco2.conf | 39 +++++++------------ .../startup-config/cisco3.conf | 39 +++++++------------ .../workshop.clab.yml.j2 | 2 + 4 files changed, 44 insertions(+), 69 deletions(-) diff --git a/internal-lab-setup-assets/startup-config/cisco1.conf b/internal-lab-setup-assets/startup-config/cisco1.conf index 697d981..e984b87 100644 --- a/internal-lab-setup-assets/startup-config/cisco1.conf +++ b/internal-lab-setup-assets/startup-config/cisco1.conf @@ -5,29 +5,25 @@ username clab secret 10 $6$7/293.lG/gI3....$qhqRPSKeGBilG47Ii/xlYF9xJVR1IK7bnw.7HHiVj4Aj8cb58bxiLAim8Xz.beUfJ6TQTP3vHUty3UO.4KmaL. ! grpc + vrf {{ .Env.CLAB_MGMT_VRF }} + port 9339 no-tls address-family dual ! line default transport input ssh ! -call-home - service active - contact smart-licensing - profile CiscoTAC-1 - active - destination transport-method email disable - destination transport-method http - ! -! ! netconf-yang agent ! ssh ! cdp lldp ! -interface MgmtEth0/RP0/CPU0/0 - vrf management +vrf {{ .Env.CLAB_MGMT_VRF }} + address-family ipv4 unicast + ! + address-family ipv6 unicast + ! ! interface Loopback0 ip address 198.51.100.1 255.255.255.255 @@ -64,17 +60,12 @@ route-policy PERMIT_ALL end-policy ! router static - vrf management + vrf {{ .Env.CLAB_MGMT_VRF }} {{- if .MgmtIPv4Gateway }} address-family ipv4 unicast 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 {{ .MgmtIPv4Gateway }} ! {{- end}} -{{- if .MgmtIPv6Gateway }} - address-family ipv6 unicast - ::/0 MgmtEth0/RP0/CPU0/0 {{ .MgmtIPv6Gateway }} - ! -{{- end}} ! router bgp 64500 bgp router-id 198.51.100.1 @@ -97,10 +88,10 @@ router bgp 64500 use neighbor-group LAB ! ! -xml agent tty - iteration off +! xml agent tty +! iteration off ! ssh server v2 -ssh server vrf management -! ssh server netconf vrf management +ssh server vrf {{ .Env.CLAB_MGMT_VRF }} +! ssh server netconf vrf {{ .Env.CLAB_MGMT_VRF }} end diff --git a/internal-lab-setup-assets/startup-config/cisco2.conf b/internal-lab-setup-assets/startup-config/cisco2.conf index daf55cf..058b64c 100644 --- a/internal-lab-setup-assets/startup-config/cisco2.conf +++ b/internal-lab-setup-assets/startup-config/cisco2.conf @@ -5,29 +5,25 @@ username clab secret 10 $6$7/293.lG/gI3....$qhqRPSKeGBilG47Ii/xlYF9xJVR1IK7bnw.7HHiVj4Aj8cb58bxiLAim8Xz.beUfJ6TQTP3vHUty3UO.4KmaL. ! grpc + vrf {{ .Env.CLAB_MGMT_VRF }} + port 9339 no-tls address-family dual ! line default transport input ssh ! -call-home - service active - contact smart-licensing - profile CiscoTAC-1 - active - destination transport-method email disable - destination transport-method http - ! -! ! netconf-yang agent ! ssh ! cdp lldp ! -interface MgmtEth0/RP0/CPU0/0 - vrf management +vrf {{ .Env.CLAB_MGMT_VRF }} + address-family ipv4 unicast + ! + address-family ipv6 unicast + ! ! interface Loopback0 ip address 198.51.100.2 255.255.255.255 @@ -64,20 +60,15 @@ route-policy PERMIT_ALL end-policy ! router static - vrf management + vrf {{ .Env.CLAB_MGMT_VRF }} {{- if .MgmtIPv4Gateway }} address-family ipv4 unicast 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 {{ .MgmtIPv4Gateway }} ! {{- end}} -{{- if .MgmtIPv6Gateway }} - address-family ipv6 unicast - ::/0 MgmtEth0/RP0/CPU0/0 {{ .MgmtIPv6Gateway }} - ! -{{- end}} ! router bgp 64500 - bgp router-id 198.51.100.2 + bgp router-id 198.51.100.1 address-family ipv4 unicast redistribute connected ! @@ -90,17 +81,17 @@ router bgp 64500 route-policy PERMIT_ALL out ! ! - neighbor 172.17.1.16 + neighbor 172.17.1.17 use neighbor-group LAB ! - neighbor 172.17.1.21 + neighbor 172.17.1.19 use neighbor-group LAB ! ! -xml agent tty - iteration off +! xml agent tty +! iteration off ! ssh server v2 -ssh server vrf management -! ssh server netconf vrf management +ssh server vrf {{ .Env.CLAB_MGMT_VRF }} +! ssh server netconf vrf {{ .Env.CLAB_MGMT_VRF }} end diff --git a/internal-lab-setup-assets/startup-config/cisco3.conf b/internal-lab-setup-assets/startup-config/cisco3.conf index 269f21e..ca10587 100644 --- a/internal-lab-setup-assets/startup-config/cisco3.conf +++ b/internal-lab-setup-assets/startup-config/cisco3.conf @@ -5,29 +5,25 @@ username clab secret 10 $6$7/293.lG/gI3....$qhqRPSKeGBilG47Ii/xlYF9xJVR1IK7bnw.7HHiVj4Aj8cb58bxiLAim8Xz.beUfJ6TQTP3vHUty3UO.4KmaL. ! grpc + vrf {{ .Env.CLAB_MGMT_VRF }} + port 9339 no-tls address-family dual ! line default transport input ssh ! -call-home - service active - contact smart-licensing - profile CiscoTAC-1 - active - destination transport-method email disable - destination transport-method http - ! -! ! netconf-yang agent ! ssh ! cdp lldp ! -interface MgmtEth0/RP0/CPU0/0 - vrf management +vrf {{ .Env.CLAB_MGMT_VRF }} + address-family ipv4 unicast + ! + address-family ipv6 unicast + ! ! interface Loopback0 ip address 198.51.100.3 255.255.255.255 @@ -54,20 +50,15 @@ route-policy PERMIT_ALL end-policy ! router static - vrf management + vrf {{ .Env.CLAB_MGMT_VRF }} {{- if .MgmtIPv4Gateway }} address-family ipv4 unicast 0.0.0.0/0 MgmtEth0/RP0/CPU0/0 {{ .MgmtIPv4Gateway }} ! {{- end}} -{{- if .MgmtIPv6Gateway }} - address-family ipv6 unicast - ::/0 MgmtEth0/RP0/CPU0/0 {{ .MgmtIPv6Gateway }} - ! -{{- end}} ! router bgp 64500 - bgp router-id 198.51.100.3 + bgp router-id 198.51.100.1 address-family ipv4 unicast redistribute connected ! @@ -80,17 +71,17 @@ router bgp 64500 route-policy PERMIT_ALL out ! ! - neighbor 172.17.1.16 + neighbor 172.17.1.17 use neighbor-group LAB ! - neighbor 172.17.1.20 + neighbor 172.17.1.19 use neighbor-group LAB ! ! -xml agent tty - iteration off +! xml agent tty +! iteration off ! ssh server v2 -ssh server vrf management -! ssh server netconf vrf management +ssh server vrf {{ .Env.CLAB_MGMT_VRF }} +! ssh server netconf vrf {{ .Env.CLAB_MGMT_VRF }} end diff --git a/internal-lab-setup-assets/workshop.clab.yml.j2 b/internal-lab-setup-assets/workshop.clab.yml.j2 index 3bbe09e..4ffbbad 100644 --- a/internal-lab-setup-assets/workshop.clab.yml.j2 +++ b/internal-lab-setup-assets/workshop.clab.yml.j2 @@ -14,6 +14,8 @@ topology: kinds: cisco_xrd: image: ios-xr/xrd-control-plane:7.11.1 + env: + CLAB_MGMT_VRF: management nodes: {%- set x = 2 %}