Re: Remapping of starcraft UDP port 6112

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ADSL=$(/sbin/ifconfig hsb0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'|sed -n 1p)

iptables -A PREROUTING -t nat -j DNAT -p udp -d $ADSL --dport 63001 --to-destination 192.168.0.3:6112
iptables -A POSTROUTING -t nat -j SNAT -p udp -s $ADSL --sport 6112 --to-source 192.168.0.3:63001

iptables -A PREROUTING -t nat -j DNAT -p udp -d $ADSL --dport 63002 --to-destination 192.168.0.56:6112
iptables -A POSTROUTING -t nat -j SNAT -p udp -s $ADSL --sport 6112 --to-source 192.168.0.56:63002

Doug, it looks like you might be using the wrong source IP to SNAT your traffic to in your POSTROUTING chain. I would use the following rules and see if they work.

iptables -t nat -A PREROUTING -p udp -d $ADSL --dport 63001 -j DNAT --to-destination 192.168.0.3:6112
iptables -t nat -A POSTROUTING -p udp -s 192.168.0.3 --sport 6112 -j SNAT --to-source $ADSL:63001

iptables -t nat -A PREROUTING -p udp -d $ADSL --dport 63002 -j DNAT --to-destination 192.168.0.56:6112
iptables -t nat -A POSTROUTING -p udp -s 192.168.0.56 --sport 6112 -j SNAT --to-source $ADSL:63002

It looks like you had your IPs backwards in your POSTROUTING rules.  However I'm a bit perplexed that your regular SNATing rules did not take care of this.  You may also need to explicitly allow traffic for these connections in your FORWARD chain if you have set the default policy to DROP.



Grant. . . .


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux