Configuring Vlan interface, without creating port in access mode #1409
-
Hi, Unfortunately, at the moment, my only working option is to create a link, assigning the ip of the Vlan interface, configuring the VRRP, and adding the access.vlan: my_vlan to ensure the correct vlan gets updated. But this will also assigned one interface, as an access port to that vlan, which won't be connected to anything. How can I edit the topology file to edit the Vlan interface creation, without adding an extra interface? Here is the full topology file I am using for this test: ---
plugin: [ multilab ]
defaults.multilab.id: 2
defaults.addressing.mgmt.start: 10
addressing.mgmt.ipv4: "10.194.57.0/24"
provider: clab
defaults.devices.eos.clab.image: "ceos:4.32.2F.1"
defaults.devices.linux.clab.image: "ubuntu/nginx"
groups:
s3gws:
device: eos
module: [vlan, gateway, ospf]
members: [ s3xgw1, s3xgw2 ]
s3switches:
device: eos
module: [vlan]
members: [ s3xdsw01, s3xdsw02, s3xasw01, s3xasw02]
s3hosts:
device: linux
role: host
members: [ s3xh01, s3xh02 ]
config: [ config-snippets/linux.j2 ]
vlans:
# SITE 3 VLANs
s3blue:
id: 3031
prefix: 172.16.32.0/24
ospf.passive: true
s3red:
id: 3032
prefix: 172.16.33.0/24
ospf.passive: true
nodes:
# SITE 3 nodes and hosts
s3xgw1:
vlans:
s3blue:
s3red:
s3xgw2:
vlans:
s3blue:
s3red:
s3xdsw01:
s3xdsw02:
s3xasw01:
s3xasw02:
s3xh01:
s3xh02:
links:
# SITE 3 Links
# Gateway 1 vlan interfaces
- s3xgw1:
ipv4: 1
gateway.protocol: vrrp
gateway.vrrp.priority: 120
vlan.access: s3blue
- s3xgw1:
ipv4: 1
gateway.protocol: vrrp
gateway.vrrp.priority: 120
vlan.access: s3red
# Gateway 2 vlan interfaces
- s3xgw2:
gateway.protocol: vrrp
vlan.access: s3blue
- s3xgw2:
gateway.protocol: vrrp
vlan.access: s3red
# Gateway 1 to Gateway 2
- s3xgw1:
s3xgw2:
vlan.trunk: [ s3blue, s3red ]
# interlink for OSPF
- s3xgw1-s3xgw2
# Gateway 1 to distribution switches
- s3xgw1:
s3xdsw01:
vlan.trunk: [ s3blue, s3red ]
- s3xgw1:
s3xdsw02:
vlan.trunk: [ s3blue, s3red ]
# Gateway 2 to distribution switches
- s3xgw2:
s3xdsw01:
vlan.trunk: [ s3blue, s3red ]
- s3xgw2:
s3xdsw02:
vlan.trunk: [ s3blue, s3red ]
# Distribution interconnects
- s3xdsw01:
s3xdsw02:
vlan.trunk: [ s3blue, s3red ]
- s3xdsw01:
s3xdsw02:
vlan.trunk: [ s3blue, s3red ]
# Distribution 1 to access switches
- s3xdsw01:
s3xasw01:
vlan.trunk: [ s3blue, s3red ]
- s3xdsw01:
s3xasw02:
vlan.trunk: [ s3blue, s3red ]
# Distribution 2 to access switches
- s3xdsw02:
s3xasw01:
vlan.trunk: [ s3blue, s3red ]
- s3xdsw02:
s3xasw02:
vlan.trunk: [ s3blue, s3red ]
# Access switches to hosts
- s3xh01:
ipv4: 60
s3xasw01:
vlan.access: s3blue
- s3xh01:
ipv4: 60
s3xasw02:
vlan.access: s3red
- s3xh02:
ipv4: 61
s3xasw01:
vlan.access: s3blue
- s3xh02:
ipv4: 61
s3xasw02:
vlan.access: s3red
tools:
graphite:
And how the topology looks: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
This is how the vlan interface looks like, which is exactly what I want: ~/co/quick-netlab-lab ❯ netlab connect s3xgw1 -s run int vl 3032
Connecting to clab-ml_2-s3xgw1 using SSH port 22, executing show run int vl 3032
interface Vlan3032
description VLAN s3red (3032) -> [s3xgw2,s3xdsw01,s3xdsw02,s3xasw01,s3xasw02,s3xh01,s3xh02]
ip address 172.16.33.1/24
ip ospf area 0.0.0.0
vrrp 1 priority-level 120
vrrp 1 ipv4 172.16.33.254
vrrp 1 ipv4 version 3 but I also have this interface in access mode, which I don't want: ~/co/quick-netlab-lab ❯ netlab connect s3xgw1 -s run int et2
Connecting to clab-ml_2-s3xgw1 using SSH port 22, executing show run int et2
interface Ethernet2
mac-address 52:dc:ca:fe:01:02
switchport access vlan 3032 |
Beta Was this translation helpful? Give feedback.
-
As soon as you have a VLAN used by a node (for example, on a trunk port), you should get a VLAN interface on that node. Can you trim the topology down to two nodes with a trunk port in the middle and try that? Also, while this is about VRF instantiation on a device, VLANs are similar: https://blog.ipspace.net/2024/05/netlab-vrf-instantiation/ |
Beta Was this translation helpful? Give feedback.
-
I apologize, had to go through the whole example several times to spot what you were doing. The parameters for the VLAN interface are defined in the nodes.name.vlans.vlan dictionary, not on an access interface: https://netlab.tools/module/vlan/#vlan-interface-parameters You will need the latest netlab release to make VRRP work though due to #1349 -- your example probably works because you're setting just the right parameters on the access interface. |
Beta Was this translation helpful? Give feedback.
-
Thank you for looking into it, here is now a simplified version of this lab, where it is working as expected (with the fix for VRRP). ---
plugin: [ multilab ]
defaults.multilab.id: 2
defaults.addressing.mgmt.start: 10
addressing.mgmt.ipv4: "10.194.57.0/24"
provider: clab
defaults.devices.eos.clab.image: "ceos:4.32.2F.1"
defaults.devices.linux.clab.image: "ubuntu/nginx"
groups:
s3gws:
device: eos
module: [vlan, gateway, ospf]
members: [ s3xgw1, s3xgw2 ]
vlans:
s3blue:
id: 3032
prefix: 172.16.32.0/24
ospf.passive: true
gateway:
protocol: vrrp
s3red:
id: 3033
prefix: 172.16.33.0/24
ospf.passive: true
gateway:
protocol: vrrp
ipv4: 172.16.33.1/24
nodes:
s3xgw1:
vlans:
s3blue:
gateway.vrrp.priority: 120
s3red:
gateway.vrrp.priority: 100
s3xgw2:
vlans:
s3blue:
gateway.vrrp.priority: 100
s3red:
gateway.vrrp.priority: 120
links:
# Gateway 1 to Gateway 2
- s3xgw1:
s3xgw2:
vlan.trunk: [ s3blue, s3red ]
- s3xgw1-s3xgw2 # interlink for OSPF
|
Beta Was this translation helpful? Give feedback.
I apologize, had to go through the whole example several times to spot what you were doing. The parameters for the VLAN interface are defined in the nodes.name.vlans.vlan dictionary, not on an access interface: https://netlab.tools/module/vlan/#vlan-interface-parameters
You will need the latest netlab release to make VRRP work though due to #1349 -- your example probably works because you're setting just the right parameters on the access interface.