Results 1 to 6 of 6

Thread: Can't open OpenVPN port 1194

  1. #1
    Join Date
    Nov 2010
    Beans
    15

    Can't open OpenVPN port 1194

    Hi!

    I was hoping that someone here could help me.
    So, I've installed and configured OpenVPN on Ubuntu server 10.04, but I can't connect to it. When i try connecting from another ubuntu machine it's "connection attempt timed out" and i can't seem to fix it. I think the problem is that port 1194 (which i've configured openvpn to use) isn't open. I've created iptables rules, but no luck.

    Here are the rules:
    Code:
    sudo iptables -L -nv
    Chain INPUT (policy ACCEPT 1033K packets, 58M bytes)
     pkts bytes target     prot opt in     out     source               destination         
        9   384 fail2ban-postfix  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           multiport dports 25,465 
       42  1708 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:1194 
        0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:1194
    When I run:
    Code:
    sudo nmap -sU -p 1194 localhost
    
    Starting Nmap 5.00 ( http://nmap.org ) at 2010-11-17 17:31 EET
    Interesting ports on localhost (127.0.0.1):
    PORT     STATE  SERVICE
    1194/udp closed unknown
    
    Nmap done: 1 IP address (1 host up) scanned in 0.20 seconds
    I also tried to see using
    Code:
     sudo netstat -tulnp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    ...
    udp        0      0 192.168.1.45:1194       0.0.0.0:*                           7837/openvpn    
    ...
    It should be running:
    Code:
    $ sudo /etc/init.d/openvpn start
     * Starting virtual private network daemon(s)...                                                                                                                         *   Autostarting VPN 'server'
    Can you please help me. I've tried searching everywhere for the answer but no luck.

  2. #2
    Join Date
    Nov 2008
    Beans
    555
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Can't open OpenVPN port 1194

    Have you enabled iptables and rebooted? also check ufw status

  3. #3
    Join Date
    Nov 2010
    Beans
    15

    Re: Can't open OpenVPN port 1194

    Quote Originally Posted by uncaspi View Post
    Have you enabled iptables and rebooted? also check ufw status
    I don't know if ufw was enabled but it is now. I also rebooted but nothing seems to have changed. Port still seems to be closed. (How do I check if iptables is enabled, because there's no /etc/init.d/iptables)

    Any thoughts?
    Last edited by majjj; November 17th, 2010 at 05:56 PM. Reason: Actually I think iptables starts always at starup so it can't be the problem:

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,754
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Can't open OpenVPN port 1194

    Try setting net.ipv4.ip_forward to 1 in /etc/sysctl.conf. You're probably being blocked because Ubuntu by default doesn't permit forwarding between interfaces.

    You can do a quick test by running

    Code:
    sudo echo '1' > /proc/sys/net/ipv4/ip_forward
    and see if that fixes the problem. To make the fix permanent, you need to change the entry in sysctl.conf and reboot.

  5. #5
    Join Date
    Nov 2010
    Beans
    15

    Re: Can't open OpenVPN port 1194

    Quote Originally Posted by SeijiSensei View Post
    Code:
    sudo echo '1' > /proc/sys/net/ipv4/ip_forward
    Tried to do it, but it said "Permission denied"?! Then I changed it in the configuration file like you suggested, rebooted, but it doesn't seem to have made any difference.

    Syslog shows now though
    Code:
    Nov 17 20:00:00 ubuntuserver ovpn-server[4396]: TLS Error: cannot  locate HMAC in incoming packet from [AF_INET]192.168.1.37:54934
    But when I try to connect outside my lan (android) it doesn't show any logs. I have port forwarding and firewall on my router set up so that should be fine.

  6. #6
    Join Date
    Nov 2010
    Beans
    15

    Re: Can't open OpenVPN port 1194

    YEAH! It finally works. The problem was that for some reason port 1194 didn't work. I changed it to 1193.

    And for the
    Nov 17 21:14:39 ubuntuserver ovpn-server[2655]: TLS Error: cannot locate HMAC in incoming packet from
    error i disabled
    Code:
    #tls-auth ta.key 0 # This file is secret
    which caused the error. I will probably will have to just configure it also for my client so that it will work. For now though it's fixed I got connection to VPN

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •