Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ This repository contains example code used at the SReXperts conferences.

Please read the license file [here](./LICENSE)

Looking for the Hackathon? find it [here](https://hack.srexperts.net)
Looking for the Hackathon? find it [here](https://hackathon.srexperts.net)
16 changes: 8 additions & 8 deletions clab/configs/client/client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

ifup -a

mkdir -p /home/user/.ssh
touch /home/user/.ssh/authorized_keys
chmod 600 /home/user/.ssh/authorized_keys
cat /tmp/authorized_keys > /home/user/.ssh/authorized_keys
chown -R user:user /home/user/.ssh
mkdir -p /home/admin/.ssh
touch /home/admin/.ssh/authorized_keys
chmod 600 /home/admin/.ssh/authorized_keys
cat /tmp/authorized_keys > /home/admin/.ssh/authorized_keys
chown -R admin:admin /home/admin/.ssh

echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "user:$USER_PASSWORD" | chpasswd
echo "admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "admin:$USER_PASSWORD" | chpasswd

# Start iperf3 server
iperf3 -s -p 5201 -D
iperf3 -s -p 5201 -D
4 changes: 2 additions & 2 deletions clab/configs/client/interfaces-client12
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ auto bond0.312
iface bond0.312
address 10.30.2.12/24
address fd00:fdfd:0:3002::12/64
post-up ip r a 10.30.0.0/16 via 10.30.2.1 dev eth1.312
post-up ip -6 r a fd00:fdfd::/32 via fd00:fdfd:0:3002::1 dev eth1.312
post-up ip r a 10.30.0.0/16 via 10.30.2.1 dev bond0.312
post-up ip -6 r a fd00:fdfd::/32 via fd00:fdfd:0:3002::1 dev bond0.312
14 changes: 7 additions & 7 deletions clab/configs/dns/dns.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

ifup -a

mkdir -p /home/user/.ssh
touch /home/user/.ssh/authorized_keys
chmod 600 /home/user/.ssh/authorized_keys
cat /tmp/authorized_keys > /home/user/.ssh/authorized_keys
chown -R user:user /home/user/.ssh
mkdir -p /home/admin/.ssh
touch /home/admin/.ssh/authorized_keys
chmod 600 /home/admin/.ssh/authorized_keys
cat /tmp/authorized_keys > /home/admin/.ssh/authorized_keys
chown -R admin:admin /home/admin/.ssh

echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "user:$USER_PASSWORD" | chpasswd
echo "admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "admin:$USER_PASSWORD" | chpasswd

dnsmasq

Binary file modified clab/configs/netbox/config/postgres-init/srx-netbox.sql.gz
Binary file not shown.
14 changes: 7 additions & 7 deletions clab/configs/radius/radius.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

ifup -a

mkdir -p /home/user/.ssh
touch /home/user/.ssh/authorized_keys
chmod 600 /home/user/.ssh/authorized_keys
cat /tmp/authorized_keys > /home/user/.ssh/authorized_keys
chown -R user:user /home/user/.ssh
mkdir -p /home/admin/.ssh
touch /home/admin/.ssh/authorized_keys
chmod 600 /home/admin/.ssh/authorized_keys
cat /tmp/authorized_keys > /home/admin/.ssh/authorized_keys
chown -R admin:admin /home/admin/.ssh

echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "user:$USER_PASSWORD" | chpasswd
echo "admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "admin:$USER_PASSWORD" | chpasswd

/usr/sbin/radiusd -x
14 changes: 7 additions & 7 deletions clab/configs/subscribers/subscribers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ ifup -a

sudo echo '*/5 * * * * ifdown eth1.100; ifup eth1.100' > /etc/crontabs/root

mkdir -p /home/user/.ssh
touch /home/user/.ssh/authorized_keys
chmod 600 /home/user/.ssh/authorized_keys
cat /tmp/authorized_keys > /home/user/.ssh/authorized_keys
chown -R user:user /home/user/.ssh
mkdir -p /home/admin/.ssh
touch /home/admin/.ssh/authorized_keys
chmod 600 /home/admin/.ssh/authorized_keys
cat /tmp/authorized_keys > /home/admin/.ssh/authorized_keys
chown -R admin:admin /home/admin/.ssh

echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "user:$USER_PASSWORD" | chpasswd
echo "admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "admin:$USER_PASSWORD" | chpasswd
16 changes: 8 additions & 8 deletions clab/configs/transit/client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

ifup -a

mkdir -p /home/user/.ssh
touch /home/user/.ssh/authorized_keys
chmod 600 /home/user/.ssh/authorized_keys
cat /tmp/authorized_keys > /home/user/.ssh/authorized_keys
chown -R user:user /home/user/.ssh
mkdir -p /home/admin/.ssh
touch /home/admin/.ssh/authorized_keys
chmod 600 /home/admin/.ssh/authorized_keys
cat /tmp/authorized_keys > /home/admin/.ssh/authorized_keys
chown -R admin:admin /home/admin/.ssh

echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "user:$USER_PASSWORD" | chpasswd
echo "admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
echo "admin:$USER_PASSWORD" | chpasswd

# Download RIS data
curl -fsSL https://data.ris.ripe.net/rrc00/latest-bview.gz -o /tmp/latest-bview.gz
Expand All @@ -28,4 +28,4 @@ gobgp mrt inject global --no-ipv6 /tmp/latest-bview 100
gobgp mrt inject global --no-ipv4 /tmp/latest-bview 100
gobgp global rib add -a ipv6 2406:c800::/32 aspath "38016"
gobgp global rib add -a ipv6 2406:c800:a1ca::/48 aspath "38016"
gobgp global rib add -a ipv6 2406:c800:e000::/48 aspath "38016"
gobgp global rib add -a ipv6 2406:c800:e000::/48 aspath "38016"
91 changes: 31 additions & 60 deletions clab/srx.clab.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright 2024 Nokia
# Licensed under the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
Expand All @@ -18,9 +17,7 @@ topology:
image: vr-sros:25.3.R1
license: /opt/srexperts/license-sros25.txt
nokia_srlinux:
image: ghcr.io/nokia/srlinux:24.10.4
exec:
- bash -c "sr_cli /tools system configuration generate-checkpoint name final-config"
image: ghcr.io/nokia/srlinux:24.10.3
binds:
- configs/srl/lldp-interface-descriptions.py:/opt/srlinux/eventmgr/lldp-interface-descriptions.py:ro
stages:
Expand Down Expand Up @@ -697,11 +694,11 @@ topology:
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"

prometheus:
kind: linux
mgmt-ipv4: 10.128.${INSTANCE_ID}.72
image: prom/prometheus:v2.51.2
image: quay.io/prometheus/prometheus:v2.51.2
binds:
- configs/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
ports:
Expand All @@ -714,7 +711,7 @@ topology:
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"

grafana:
kind: linux
mgmt-ipv4: 10.128.${INSTANCE_ID}.73
Expand Down Expand Up @@ -746,7 +743,7 @@ topology:
syslog:
kind: linux
mgmt-ipv4: 10.128.${INSTANCE_ID}.74
image: linuxserver/syslog-ng:4.5.0
image: quay.io/linuxserver.io/syslog-ng:4.5.0
binds:
- configs/syslog/syslog-ng.conf:/config/syslog-ng.conf:rslave
- configs/syslog/log/messages:/var/log/messages:rslave
Expand All @@ -759,7 +756,7 @@ topology:
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"

promtail:
kind: linux
mgmt-ipv4: 10.128.${INSTANCE_ID}.75
Expand All @@ -773,7 +770,7 @@ topology:
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"

loki:
kind: linux
mgmt-ipv4: 10.128.${INSTANCE_ID}.76
Expand All @@ -787,16 +784,16 @@ topology:
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"

### NETBOX STACK ###
netbox:
kind: linux
image: netboxcommunity/netbox:v4.2-3.2.0
image: quay.io/netboxcommunity/netbox:v4.2-3.2.0
mgmt-ipv4: 10.128.${INSTANCE_ID}.81
ports:
- "8000:8080"
user: unit:root
exec:
exec:
- chown -R unit:root /opt/netbox/netbox/media/
- chown -R unit:root /opt/netbox/netbox/reports/
- chown -R unit:root /opt/netbox/netbox/scripts/
Expand All @@ -808,7 +805,7 @@ topology:
env-files:
- configs/netbox/envs/netbox.env
healthcheck:
test:
test:
- curl -f http://localhost:8080/login/ || exit 1
start-period: 90
timeout: 3
Expand All @@ -819,14 +816,14 @@ topology:
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"

netbox-worker:
kind: linux
image: netboxcommunity/netbox:v4.2-3.2.0
image: quay.io/netboxcommunity/netbox:v4.2-3.2.0
ports: # none
mgmt-ipv4: 10.128.${INSTANCE_ID}.82
user: unit:root
exec:
exec:
- chown -R unit:root /opt/netbox/netbox/media/
- chown -R unit:root /opt/netbox/netbox/reports/
- chown -R unit:root /opt/netbox/netbox/scripts/
Expand All @@ -838,8 +835,8 @@ topology:
env-files:
- configs/netbox/envs/netbox.env
cmd: /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py rqworker
healthcheck:
test:
healthcheck:
test:
- ps -aux | grep -v grep | grep -q rqworker || exit 1
start-period: 20
timeout: 3
Expand All @@ -850,14 +847,14 @@ topology:
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"

netbox-housekeeping:
kind: linux
image: netboxcommunity/netbox:v4.2-3.2.0
image: quay.io/netboxcommunity/netbox:v4.2-3.2.0
ports: # none
mgmt-ipv4: 10.128.${INSTANCE_ID}.83
user: unit:root
exec:
exec:
- chown -R unit:root /opt/netbox/netbox/media/
- chown -R unit:root /opt/netbox/netbox/reports/
- chown -R unit:root /opt/netbox/netbox/scripts/
Expand All @@ -870,7 +867,7 @@ topology:
- configs/netbox/envs/netbox.env
cmd: /opt/netbox/housekeeping.sh
healthcheck:
test:
test:
- ps -aux | grep -v grep | grep -q housekeeping || exit 1
start-period: 20
timeout: 3
Expand All @@ -881,41 +878,41 @@ topology:
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"

postgres:
kind: linux
image: postgres:17-alpine
mgmt-ipv4: 10.128.${INSTANCE_ID}.84
healthcheck:
test:
test:
- pg_isready -q -t 2 -d netbox -U netbox
start-period: 20
timeout: 30
interval: 10
retries: 5
env-files:
env-files:
- configs/netbox/envs/postgres.env
binds:
- ./configs/netbox/config/postgres-init:/docker-entrypoint-initdb.d
- ./configs/netbox/config/postgres-init:/docker-entrypoint-initdb.d
labels:
graph-posX: "665"
graph-posY: "465"
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"

redis:
kind: linux
image: valkey/valkey:8.0-alpine
image: ghcr.io/valkey-io/valkey:8.0-alpine
mgmt-ipv4: 10.128.${INSTANCE_ID}.85
healthcheck: &redis-healthcheck
test:
test:
- '[ $$(valkey-cli --pass "$${REDIS_PASSWORD}" ping) = ''PONG'' ]'
start-period: 5
timeout: 3
interval: 1
retries: 5
env-files:
env-files:
- configs/netbox/envs/redis.env
binds:
- ./configs/netbox/config/redis-data:/data
Expand All @@ -928,10 +925,10 @@ topology:

redis-cache:
kind: linux
image: valkey/valkey:8.0-alpine
image: ghcr.io/valkey-io/valkey:8.0-alpine
mgmt-ipv4: 10.128.${INSTANCE_ID}.86
healthcheck: *redis-healthcheck
env-files:
env-files:
- configs/netbox/envs/redis-cache.env
binds:
- ./configs/netbox/config/redis-cache-data:/data
Expand All @@ -941,33 +938,7 @@ topology:
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"

### DEV TOOLS ###
codeserver:
kind: linux
user: ${NOKIA_UID}:${NOKIA_GID}
mgmt-ipv4: 10.128.${INSTANCE_ID}.90
image: ghcr.io/coder/code-server:latest
binds:
- ${HOME}:/home/coder
- /opt/srexperts/vscode-extensions:/opt/srexperts/vscode-extensions
- ./configs/coder:/entrypoint.d
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/containers:/var/lib/docker/containers
- /usr/bin/containerlab:/usr/bin/containerlab:ro
- /usr/bin/docker:/usr/bin/docker:ro
ports:
- 80:8080
env:
PASSWORD: ${EVENT_PASSWORD}
USER: ${NOKIA_UID}
labels:
graph-posX: "565"
graph-posY: "465"
graph-groupLabelPos: bottom-center
graph-group: Network Tools
graph-level: "1"


links:
# links from P1
- endpoints: ["p1:eth1", "pe1:eth1"]
Expand Down
Loading