aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mkbr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mkbr')
-rwxr-xr-xtests/mkbr13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/mkbr b/tests/mkbr
new file mode 100755
index 0000000..1d64e82
--- /dev/null
+++ b/tests/mkbr
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+BR=${1:-"br549"}
+ETH=${2:-"eth0"}
+
+# fetch ip of working eth0
+IP=`/sbin/ifconfig $ETH | sed -n -e 's/^.*inet addr:\([0-9][0-9\.]*\).*$/\1/p'`
+echo "Using IP address $IP"
+
+ifconfig $ETH 0.0.0.0
+brctl addbr $BR
+brctl addif $BR $ETH
+ifconfig $BR $IP