Skip to content

Commit

Permalink
Fix Cumulus container management IPv4 prefix (#1341)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbemmel authored Oct 5, 2024
1 parent ec17e4f commit 42c85d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion netsim/providers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ def create_extra_files(
file_name = file.replace(out_folder+"/","")
template_name = self.find_extra_template(node,file_name,topology)
if template_name:
node_data = node + { 'hostvars': topology.nodes, 'hosts': get_host_addresses(topology) }
node_data = node + { 'hostvars': topology.nodes,
'hosts': get_host_addresses(topology),
'addressing': topology.addressing } # Needed for subnet prefix
if '/' in file_name: # Create subdirectory in out_folder if needed
pathlib.Path(f"{out_folder}/{os.path.dirname(file_name)}").mkdir(parents=True,exist_ok=True)
try:
Expand Down
2 changes: 1 addition & 1 deletion netsim/templates/provider/clab/cumulus/interfaces.j2
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ iface mgmt

auto eth0
iface eth0 inet static
address {{ mgmt.ipv4 }}
address {{ mgmt.ipv4 }}/{{ addressing.mgmt.prefix }}
vrf mgmt

source /etc/network/interfaces.d/*.intf

0 comments on commit 42c85d2

Please sign in to comment.