Skip to content

Commit

Permalink
Change management interface on IOL Layer 2 images from Vlan0 (#2235)
Browse files Browse the repository at this point in the history
* Change managment interface on IOL Layer 2 images from Vlan0
to Ethernet 0/0. While at it, get rid of any specific SVI
configuration. Please note that the order of configurations
statements is important.

* Fix go template language misuse in ip routing config statments.

* fix test

---------

Co-authored-by: Dan Partelly <[email protected]>
Co-authored-by: Roman Dodin <[email protected]>
  • Loading branch information
3 people authored Oct 15, 2024
1 parent 23892a8 commit 2bd726c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
21 changes: 7 additions & 14 deletions nodes/iol/iol.cfg.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,31 @@ no ip domain lookup
username admin privilege 15 secret admin
!
vrf definition clab-mgmt
description clab-mgmt
address-family ipv4
!
address-family ipv6
!
!
interface Ethernet0/0
{{ if .IsL2Node }}
interface Vlan1
no switchport
{{ end }}
vrf forwarding clab-mgmt
description clab-mgmt
ip address {{ .MgmtIPv4Addr }} {{ .MgmtIPv4SubnetMask }}
ipv6 address {{ .MgmtIPv6Addr }}/{{ .MgmtIPv6PrefixLen }}
!
{{ end }}
interface Ethernet0/0
no shutdown
mac-address {{ .MgmtIntfMacAddr }}
{{ if .IsL2Node }}
switchport mode access
switchport access vlan 1
{{ else }}
vrf forwarding clab-mgmt
ip address {{ .MgmtIPv4Addr }} {{ .MgmtIPv4SubnetMask }}
ipv6 address {{ .MgmtIPv6Addr }}/{{ .MgmtIPv6PrefixLen }}
{{ end }}
!{{ range $index, $item := .DataIFaces }}
interface Ethernet{{ .Slot }}/{{ .Port }}
no shutdown
mac-address {{ .MacAddr }}
!{{ end }}
ip forward-protocol nd
!
ip route vrf clab-mgmt 0.0.0.0 0.0.0.0 {{ if .IsL2Node }}Vlan1{{ else }}Ethernet0/0{{ end }} {{ .MgmtIPv4GW }}
ipv6 route vrf clab-mgmt ::/0 {{ if .IsL2Node }}Vlan1{{ else }}Ethernet0/0{{ end }} {{ .MgmtIPv6GW }}
ip route vrf clab-mgmt 0.0.0.0 0.0.0.0 Ethernet0/0 {{ .MgmtIPv4GW }}
ipv6 route vrf clab-mgmt ::/0 Ethernet0/0 {{ .MgmtIPv6GW }}
!
ip ssh version 2
crypto key generate rsa modulus 2048
Expand Down
2 changes: 1 addition & 1 deletion tests/10-basic-cisco_iol/01-iol.robot
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Verify links in node router1

Verify links in node switch
${rc} ${output} = Run And Return Rc And Output
... sshpass -p "admin" ssh -o "IdentitiesOnly=yes" admin@clab-${lab-name}-switch sh ip int br | head -9 | tail -1
... sshpass -p "admin" ssh -o "IdentitiesOnly=yes" admin@clab-${lab-name}-switch sh ip int br | head -5 | tail -1
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 172.20.20.
Expand Down

0 comments on commit 2bd726c

Please sign in to comment.