Skip to content

Commit

Permalink
Merge pull request #33 from mrmrcoleman/develop
Browse files Browse the repository at this point in the history
Fixed ContainerLab networking for restarts
  • Loading branch information
richbibby authored Jan 27, 2025
2 parents 6e55839 + d7a597b commit 4a6797b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions netbox-discovery-quickstart/4_start_network.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
#!/bin/bash
set -euo pipefail

# Check if all required environment variables are set
REQUIRED_VARS=("DOCKER_NETWORK" "DOCKER_SUBNET")

# Create the docker network if it doesn't already exist
if ! docker network inspect "$DOCKER_NETWORK" &>/dev/null; then
echo "Creating Docker network: $DOCKER_NETWORK with subnet: $DOCKER_SUBNET"
docker network create \
--driver=bridge \
--subnet="$DOCKER_SUBNET" \
"$DOCKER_NETWORK"
else
echo "Docker network '$DOCKER_NETWORK' already exists."
fi

# Check if directory parameter is passed
if [ $# -eq 0 ]; then
echo "Usage: $0 <network_directory>"
Expand Down
3 changes: 2 additions & 1 deletion netbox-discovery-quickstart/network/ios.clab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ name: discovery-quickstart-cisco

mgmt:
network: discovery-quickstart
ipv4-subnet: 172.24.0.0/24

topology:
nodes:
ios1:
kind: vr-csr
image: mrmrcoleman/vr-csr:17.03.06
mgmt-ipv4: 172.24.0.100
mgmt-ipv4: 172.24.0.102

0 comments on commit 4a6797b

Please sign in to comment.