p4_testbed/scripts/31-configure_interfaces.sh
Tuan-Dat Tran 5857beeaf6 feat(automation/deployment): Added script to autodeploy and setup wedge and nodes
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
2024-12-31 15:17:29 +01:00

20 lines
297 B
Bash
Executable File

#!/bin/bash
NS=$1
IF=$2
IP=$3
# Add interfaces to namespaces
ip link set "$IF" netns "$NS"
# Set IP Addresses
ip netns exec "$NS" ip addr add dev "$IF" "$IP"
# Turn on Links
ip netns exec "$NS" ip link set up "$IF"
# For Debugging
#
# # Show interface info
# ip netns exec "$NS" ip a s "$IF"