summaryrefslogtreecommitdiff
path: root/fw/simulate-network.sh
diff options
context:
space:
mode:
Diffstat (limited to 'fw/simulate-network.sh')
-rwxr-xr-xfw/simulate-network.sh61
1 files changed, 0 insertions, 61 deletions
diff --git a/fw/simulate-network.sh b/fw/simulate-network.sh
deleted file mode 100755
index 880a5f9..0000000
--- a/fw/simulate-network.sh
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/sh
-
-
-# This Source Code Form is subject to the terms of the Mozilla Public License,
-# v. 2.0. If a copy of the MPL was not distributed with this file, You can
-# obtain one at https://mozilla.org/MPL/2.0/.
-
-# This script provides a simulated network environment for a simulated Zephyr
-# firmware.
-#
-# It is based on providing a simulated layer 2 network interface (TAP) and
-# providing required services as Linux processes there. One example is the
-# radvd service which send router advertisements which are required for IPv6
-# stateless address auto configuration (SLAAC).
-#
-# Root rights are required to run this script. Use your preferred privilege
-# escalation program to call this script like this:
-#
-# sudo ./simulate-network.sh
-#
-# The creation of a TAP interface can be done persistently with NetworkManager
-# too:
-#
-# nmcli connection add type tun con-name zeth ifname zeth mode tap
-
-
-set -euf
-
-
-FW="$(dirname "$0")"
-RADVD_CONF="${FW}/radvd.conf"
-
-INTERFACE='zeth'
-LINUX_IP='fdb3:c9f2:efda:1::2'
-NETMASK='64'
-
-radvd_pid=''
-
-
-cleanup() {
- if test "$radvd_pid" != ""
- then
- kill "$radvd_pid"
- fi
-
- ip link delete "$INTERFACE"
-}
-
-
-trap cleanup EXIT
-
-set -x
-
-ip tuntap add "$INTERFACE" mode tap
-ip link set dev "$INTERFACE" up
-ip addr add "${LINUX_IP}/${NETMASK}" dev "$INTERFACE"
-
-radvd --nodaemon --config "$RADVD_CONF" > /dev/null 2>&1 &
-radvd_pid="$!"
-
-wait