summaryrefslogtreecommitdiff
path: root/configs/boot/natbox-spec-surge.rcS
diff options
context:
space:
mode:
authorLisa Hsu <hsul@eecs.umich.edu>2004-11-16 22:43:12 -0500
committerLisa Hsu <hsul@eecs.umich.edu>2004-11-16 22:43:12 -0500
commit182425da82976a7bddcd259e8b56fed348c52eab (patch)
treef5aa45d3e733efcde4680726c7d51cb323085202 /configs/boot/natbox-spec-surge.rcS
parent33135a051abcaad29bd04118e9d7028f7529b4a5 (diff)
downloadgem5-182425da82976a7bddcd259e8b56fed348c52eab.tar.xz
add support for NAT under netperf stream, maerts, and spec-surge.
configs/boot/spec-surge-client.rcS: configs/boot/surge-client.rcS: fix this rcS - don't sleep, instead wait for the server to tell you it's done. configs/boot/spec-surge-server.rcS: configs/boot/surge-server.rcS: notify the client you're done starting the server. --HG-- extra : convert_revision : b708bd0a9147e248eed7c27e7078668fbd98b95e
Diffstat (limited to 'configs/boot/natbox-spec-surge.rcS')
-rw-r--r--configs/boot/natbox-spec-surge.rcS51
1 files changed, 51 insertions, 0 deletions
diff --git a/configs/boot/natbox-spec-surge.rcS b/configs/boot/natbox-spec-surge.rcS
new file mode 100644
index 000000000..ed74b71bd
--- /dev/null
+++ b/configs/boot/natbox-spec-surge.rcS
@@ -0,0 +1,51 @@
+#!/bin/sh
+EXTIF=192.168.0.7
+INTIF=10.0.0.1
+CLIENT=10.0.0.2
+
+echo "setting up network..."
+ifconfig lo 127.0.0.1
+ifconfig eth0 $EXTIF txqueuelen 1000
+ifconfig eth1 $INTIF txqueuelen 1000
+
+echo "0" > /proc/sys/net/ipv4/tcp_timestamps
+echo "0" > /proc/sys/net/ipv4/tcp_sack
+echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_rmem
+echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_wmem
+echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_mem
+echo "262143" > /proc/sys/net/core/rmem_max
+echo "262143" > /proc/sys/net/core/wmem_max
+echo "262143" > /proc/sys/net/core/rmem_default
+echo "262143" > /proc/sys/net/core/wmem_default
+echo "262143" > /proc/sys/net/core/optmem_max
+echo "100000" > /proc/sys/net/core/netdev_max_backlog
+
+echo "1" > /proc/sys/net/ipv4/ip_forward
+
+echo "waiting for netserver..."
+/usr/bin/netcat -c -l -p 8000
+
+echo "setting up iptables..."
+IPTABLES=/sbin/iptables
+EXTIF=eth0
+INTIF=eth1
+
+$IPTABLES -P INPUT ACCEPT
+$IPTABLES -F INPUT
+$IPTABLES -P OUTPUT ACCEPT
+$IPTABLES -F OUTPUT
+$IPTABLES -P FORWARD DROP
+$IPTABLES -F FORWARD
+$IPTABLES -t nat -F
+
+$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
+$IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
+$IPTABLES -A FORWARD -j LOG
+
+$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
+
+echo "informing client..."
+echo "server ready" | /usr/bin/netcat -c $CLIENT 8000
+
+echo "starting bash..."
+exec /bin/bash