Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a debian server at home, that I use to have a VPN access to my home computers.

I've redirected the openvpn port on the port 2000 : in my file "server.conf", I've added this :

mode server 
proto udp 
port 2000

With the connexion tracking, I allow all the related and response connexions.

I've set up a rule, allowing everybody on the port 2000 :

iptables -t filter -A INPUT -p tcp --dport 2000 -j ACCEPT

however, it doesn't allow me to connect to my VPN (if I disable the firewall, I can connect without any problem).

So, what haven't I understood? does openvpn need another port?

share|improve this question
compare: openvpn config: proto udp vs. iptables: -p tcp, I guess you need to sync these. – peterph Jun 10 '13 at 12:22
up vote 2 down vote accepted

You need to modify your iptables rule: It should be for UDP, not for TCP. Additionally, your server gets the UDP traffic to port 2000 as your router rewrites the destination port and IP:

    iptables -t filter -A INPUT -p udp --dport 2000 -j ACCEPT
share|improve this answer
Sorry, i made an error while copy/pasting. I've edited my question. Thank you for the UDP error, this was the problem. – patxy Jun 10 '13 at 12:20

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.