Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I currently installed openvpn on CentOS 6 64bit and everything is working fine but I want to portforward a client "user" so they can use that port. Here is what I thought it should work

iptables -t nat -A PREROUTING -p udp -d SERVERIP --dport 3074 -j DNAT --to-destination 10.8.0.6:3074

After running that command the firewall output is this

[root@RUVPN ~]# iptables -L -n 
Chain INPUT (policy ACCEPT) target prot opt source destination 
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT all -- 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy ACCEPT) target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED 
ACCEPT all -- 10.8.0.0/24 0.0.0.0/0

Chain OUTPUT (policy ACCEPT) target prot opt source destination

What have I done wrong?

share|improve this question
1  
That should work. What's your question? –  SmallClanger Feb 20 '13 at 13:46
1  
Issue iptables -t nat -n -L -v and you will see your rule added to PREROUTING chain of nat table. –  slimsuperhero Feb 20 '13 at 14:31
    
# iptables -t nat -n -L -v Chain PREROUTING (policy ACCEPT 29 packets, 1218 bytes) pkts bytes target prot opt in out source destination 0 0 DNAT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:33891 to:10.8.0.6:3389 0 0 DNAT udp -- * * 0.0.0.0/0 –  Spetsnaz Feb 20 '13 at 18:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.