wok-4.x view mirror-tools/stuff/host/install @ rev 5973

mirror-tools: add host scripts
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Aug 08 19:48:39 2010 +0200 (2010-08-08)
parents
children
line source
1 #!/bin/sh
3 grep -qs lguest-slitaz /etc/inittab || {
4 sed -i 's|^tty1::|tty16::respawn:/boot/lguest-slitaz tty16 /boot/guests/mirror.slitaz.org 192.168.0.1\n&|' /etc/inittab
5 cat >> /etc/init.d/local.sh <<EOT
6 . /etc/network.conf
7 iptables -t nat -A POSTROUTING -o $INTERFACE -j MASQUERADE
8 for port in 22 873 ; do
9 iptables -t nat -A PREROUTING -i $INTERFACE --dport $port \
10 -j DNAT --to-destination 192.168.0.6:$port
11 done
12 for port in 80 443 ; do
13 iptables -A INPUT -p tcp -m tcp --dport $port -j ACCEPT
14 done
15 for iface in tap+ ; do
16 iptables -A INPUT -i $iface -j ACCEPT
17 iptables -A OUTPUT -o $iface -j ACCEPT
18 iptables -A FORWARD -i $iface -m state \
19 --state NEW,RELATED,ESTABLISHED,UNTRACKED -j ACCEPT
20 iptables -A FORWARD -o $iface -m state \
21 --state NEW,RELATED,ESTABLISHED,UNTRACKED -j ACCEPT
22 done
23 echo "1" > /proc/sys/net/ipv4/ip_forward
24 EOT
25 }