--- trunk/vz-clone.pl 2007/10/16 09:35:59 33 +++ trunk/vz-clone.pl 2008/08/14 22:49:05 50 @@ -169,12 +169,15 @@ my $note = "# modified by $0\n"; +my $ve_clone_ip; + sub fix_ip { my $ip = shift; $ip =~ s/['"]//g; # $ip =~ s/^\d+\./10./; $ip =~ s/^\d+\.\d+\./192.168./; warn "$CVEID new IP number: $ip\n"; + $ve_clone_ip = $ip; return $note . qq{IP_ADDRESS="$ip"}; } @@ -195,4 +198,4 @@ print $n $_; } -print "\nPlease review config file: $conf/$CVEID.conf\nAdd NAT for new VE with: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE\nStart clone of $VEID with: vzctl start $CVEID\n" +print "\nPlease review config file: $conf/$CVEID.conf\nAdd NAT for new VE with: iptables -t nat -A POSTROUTING -s $ve_clone_ip -o eth0 -j MASQUERADE\nStart clone of $VEID with: vzctl start $CVEID\n"