File tree Expand file tree Collapse file tree
systemvm/patches/debian/config/root Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ doHairpinNat () {
6161 local guestVmIp=$4
6262 local guestPort=$( echo $5 | sed ' s/:/-/' )
6363 local op=$6
64+ local destPort=$5
6465 logger -t cloud " $( basename $0 ) : create HairPin entry : public ip=$publicIp \
6566 instance ip=$guestVmIp proto=$proto portRange=$guestPort op=$op "
6667
@@ -71,7 +72,7 @@ doHairpinNat () {
7172 (sudo iptables -t nat $op POSTROUTING -s $vrGuestIPNetwork -d $guestVmIp -j SNAT -o eth0 --to-source $vrGuestIP & >> $OUTFILE || [ " $op " == " -D" ])
7273 else
7374 (sudo iptables -t nat $op PREROUTING -d $publicIp -i eth0 -p $prot --dport $port -j DNAT --to-destination $guestVmIp :$guestPort & >> $OUTFILE || [ " $op " == " -D" ]) &&
74- (sudo iptables -t nat $op POSTROUTING -s $vrGuestIPNetwork -p $prot --dport $port -d $guestVmIp -j SNAT -o eth0 --to-source $vrGuestIP & >> $OUTFILE || [ " $op " == " -D" ])
75+ (sudo iptables -t nat $op POSTROUTING -s $vrGuestIPNetwork -p $prot --dport $destPort -d $guestVmIp -j SNAT -o eth0 --to-source $vrGuestIP & >> $OUTFILE || [ " $op " == " -D" ])
7576 fi
7677}
7778
You can’t perform that action at this time.
0 commit comments