i have having problems with your server migration script in your book, i found a typo first of all, and now when i run it all i get returned is the plesk default screen
#!/bin/sh
IPTABLES="/sbin/iptables"
CONFIG="/etc/rc.d/forwarded"
EXTERNAL=eth0
# Enable connection tracking
$IPTABLES -A INPUT -m state \
--state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A OUTPUT -m state \
--state NEW,ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -m state \
--state NEW,ESTABLISHED,RELATED -j ACCEPT
# the working part of the code to redirect it
for i in `cat $CONFIG`; do
SOURCEIP=`echo $i | awk -F: '{print $1}'`
DESTIP=`echo $i | awk -F: '{print $2}'`
echo "Forwarding $SOURCEIP to $DESTIP"
$IPTABLES -A FORWARD -i $EXTERNAL -o $EXTERNAL \
-d $SOURCEIP -m state --state \ <- typo was here -state should have been --state
NEW,ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -t nat -A PREROUTING -i $EXTERNAL \
-d $SOURCEIP -j DNAT --to-destination $DESTIP
$IPTABLES -t nat -A POSTROUTING -d $DESTIP \
-j SNAT --to $SOURCEIP
done
# Enable IP Forwarding in the Kernel
echo "1" > /proc/sys/net/ipv4/ip_forward