misc: Added RELEASE-NOTES.md
[gem5.git] / configs / boot / natbox-spec-surge.rcS
1 #!/bin/sh
2 EXTIF=192.168.0.7
3 INTIF=10.0.0.1
4 CLIENT=10.0.0.2
5
6 echo "setting up network..."
7 ifconfig lo 127.0.0.1
8 ifconfig eth0 $EXTIF txqueuelen 1000
9 ifconfig eth1 $INTIF txqueuelen 1000
10
11 echo "0" > /proc/sys/net/ipv4/tcp_timestamps
12 echo "0" > /proc/sys/net/ipv4/tcp_sack
13 echo "1" > /proc/sys/net/ipv4/tcp_vegas_cong_avoid
14 echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max
15 echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_rmem
16 echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_wmem
17 echo "5000000 5000000 5000000" > /proc/sys/net/ipv4/tcp_mem
18 echo "262143" > /proc/sys/net/core/rmem_max
19 echo "262143" > /proc/sys/net/core/wmem_max
20 echo "262143" > /proc/sys/net/core/rmem_default
21 echo "262143" > /proc/sys/net/core/wmem_default
22 echo "262143" > /proc/sys/net/core/optmem_max
23 echo "100000" > /proc/sys/net/core/netdev_max_backlog
24
25 echo "1" > /proc/sys/net/ipv4/ip_forward
26
27 echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max
28
29 echo "waiting for netserver..."
30 netcat -c -l -p 8000
31
32 echo "setting up iptables..."
33 IPTABLES=/sbin/iptables
34 EXTIF=eth0
35 INTIF=eth1
36
37 $IPTABLES -P INPUT ACCEPT
38 $IPTABLES -F INPUT
39 $IPTABLES -P OUTPUT ACCEPT
40 $IPTABLES -F OUTPUT
41 $IPTABLES -P FORWARD DROP
42 $IPTABLES -F FORWARD
43 $IPTABLES -t nat -F
44
45 $IPTABLES -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
46 $IPTABLES -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
47 $IPTABLES -A FORWARD -j LOG
48
49 $IPTABLES -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
50
51 echo "informing client..."
52 sleep 5
53 echo "server ready" | netcat -c $CLIENT 8000
54
55 echo "starting bash..."
56 exec /bin/bash