xptical
07-19-2005, 08:31 PM
Hi all,
I'm trying to use my Unixshell server to act as a OpenVPN gateway for some online gaming.
Basicly, the game wants all the clients to have TCP and UDP 2934 and 2935 open. Because my home computer is behind a NAT, I figured I could just VPN out and try it.
Here are the iptables lines I'm using.
# Basic NAT for my private IP space.
iptables -t nat -A POSTROUTING -s 172.16.99.0/24 -o eth0 -j MASQUERADE
# TCP/UDP mapping from Internet to private IP
iptables -t nat -A PREROUTING -p udp --dport 2934 -i eth0 -j DNAT --to 172.16.99.6
iptables -t nat -A PREROUTING -p udp --dport 2935 -i eth0 -j DNAT --to 172.16.99.6
iptables -t nat -A PREROUTING -p tcp --dport 2934 -i eth0 -j DNAT --to 172.16.99.6
iptables -t nat -A PREROUTING -p tcp --dport 2935 -i eth0 -j DNAT --to 172.16.99.6
# TCP/UDP mapping from my private IP to the Internet
iptables -t nat -A PREROUTING -p udp --dport 2934 -i tun0 -j DNAT --to 207.210.xxx.xxx
iptables -t nat -A PREROUTING -p udp --dport 2935 -i tun0 -j DNAT --to 207.210.xxx.xxx
iptables -t nat -A PREROUTING -p tcp --dport 2934 -i tun0 -j DNAT --to 207.210.xxx.xxx
iptables -t nat -A PREROUTING -p tcp --dport 2935 -i tun0 -j DNAT --to 207.210.xxx.xxx
It still does not seem to be working.
Is my script mostly right?
Does the upstream provider filter thoes ports?
Thanks.
I'm trying to use my Unixshell server to act as a OpenVPN gateway for some online gaming.
Basicly, the game wants all the clients to have TCP and UDP 2934 and 2935 open. Because my home computer is behind a NAT, I figured I could just VPN out and try it.
Here are the iptables lines I'm using.
# Basic NAT for my private IP space.
iptables -t nat -A POSTROUTING -s 172.16.99.0/24 -o eth0 -j MASQUERADE
# TCP/UDP mapping from Internet to private IP
iptables -t nat -A PREROUTING -p udp --dport 2934 -i eth0 -j DNAT --to 172.16.99.6
iptables -t nat -A PREROUTING -p udp --dport 2935 -i eth0 -j DNAT --to 172.16.99.6
iptables -t nat -A PREROUTING -p tcp --dport 2934 -i eth0 -j DNAT --to 172.16.99.6
iptables -t nat -A PREROUTING -p tcp --dport 2935 -i eth0 -j DNAT --to 172.16.99.6
# TCP/UDP mapping from my private IP to the Internet
iptables -t nat -A PREROUTING -p udp --dport 2934 -i tun0 -j DNAT --to 207.210.xxx.xxx
iptables -t nat -A PREROUTING -p udp --dport 2935 -i tun0 -j DNAT --to 207.210.xxx.xxx
iptables -t nat -A PREROUTING -p tcp --dport 2934 -i tun0 -j DNAT --to 207.210.xxx.xxx
iptables -t nat -A PREROUTING -p tcp --dport 2935 -i tun0 -j DNAT --to 207.210.xxx.xxx
It still does not seem to be working.
Is my script mostly right?
Does the upstream provider filter thoes ports?
Thanks.