2004-11-17 04:43:12 +01:00
|
|
|
#!/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
|
2005-01-28 21:57:40 +01:00
|
|
|
echo "1" > /proc/sys/net/ipv4/tcp_vegas_cong_avoid
|
2005-04-30 17:00:43 +02:00
|
|
|
echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max
|
2004-11-17 04:43:12 +01:00
|
|
|
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
|
|
|
|
|
2005-04-28 22:13:30 +02:00
|
|
|
echo "262144" > /proc/sys/net/ipv4/ip_conntrack_max
|
|
|
|
|
2004-11-17 04:43:12 +01:00
|
|
|
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..."
|
2005-04-30 17:00:43 +02:00
|
|
|
sleep 5
|
2004-11-17 04:43:12 +01:00
|
|
|
echo "server ready" | /usr/bin/netcat -c $CLIENT 8000
|
|
|
|
|
|
|
|
echo "starting bash..."
|
|
|
|
exec /bin/bash
|