p4_testbed/scripts/31-configure_interfaces.sh

20 lines
297 B
Bash
Raw Normal View History

#!/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"