1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

VPN on VPS Set up not working - Please Help!

Discussion in 'Site & Server Administration' started by bangduck, Jan 29, 2017.

  1. #1
    Hi everyone, I am trying to set up vpn on vps but it is not working! When i try to connect to it, the error says: cannot connect to remote computer.

    More info: centos 5 32-bit ( also tried centos 6 64bit but also didnt work)
    I already enabled tun/tap and ppp on solusvm.



    Putty shows the following:
    ------

    [root@domainaspuk9 ~]# wget http://soft.kwx.gd/vpn/l2tp_centos.sh

    --12:32:09-- http://soft.kwx.gd/vpn/l2tp_centos.sh

    Resolving soft.kwx.gd...

    198.52.124.123

    Connecting to soft.kwx.gd|198.52.124.123|:80... connected.

    HTTP request sent, awaiting response... 200 OK

    Length: 2624 (2.6K) [application/x-sh]

    Saving to: `l2tp_centos.sh.1'


    100%[=======================================>] 2,624 --.-K/s in 0s


    12:32:20 (277 MB/s) - `l2tp_centos.sh.1' saved [2624/2624]


    [root@domainaspuk9 ~]# sh ./l2tp_centos.sh

    which do you want to?input the number.

    1. install VPN service

    2. repaire VPN service

    3. add VPN user

    1

    begin to install L2TP VPN services

    Loaded plugins: fastestmirror

    Setting up Remove Process

    No Match for argument: pptpd

    Resolving Dependencies

    --> Running transaction check

    ---> Package ppp.i386 0:2.4.4-2.el5 set to be erased

    --> Finished Dependency Resolution


    Dependencies Resolved


    ================================================================================

    Package Arch Version Repository Size

    ================================================================================

    Removing:

    ppp i386 2.4.4-2.el5 installed 811 k


    Transaction Summary

    ================================================================================

    Install 0 Package(s)

    Update 0 Package(s)

    Remove 1 Package(s)


    Downloading Packages:

    Running rpm_check_debug

    Running Transaction Test

    Finished Transaction Test

    Transaction Test Succeeded

    Running Transaction

    Erasing : ppp [1/1]

    warning: /etc/ppp/chap-secrets saved as /etc/ppp/chap-secrets.rpmsave


    Removed: ppp.i386 0:2.4.4-2.el5

    Complete!

    Loaded plugins: fastestmirror

    Loading mirror speeds from cached hostfile

    * base: mirror.vorboss.net

    * updates: mirror.vorboss.net

    * addons: mirror.vorboss.net

    * extras: mirror.vorboss.net

    Setting up Install Process

    Parsing package install arguments

    Package openswan-2.6.32-9.el5.i386 already installed and latest version

    Package gcc-4.1.2-55.el5.i386 already installed and latest version

    Package 14:libpcap-devel-0.9.4-15.el5.i386 already installed and latest version

    Resolving Dependencies

    --> Running transaction check

    ---> Package ppp.i386 0:2.4.4-2.el5 set to be updated

    --> Finished Dependency Resolution


    Dependencies Resolved


    ================================================================================

    Package Arch Version Repository Size

    ================================================================================

    Installing:

    ppp i386 2.4.4-2.el5 base 382 k


    Transaction Summary

    ================================================================================

    Install 1 Package(s)

    Update 0 Package(s)

    Remove 0 Package(s)


    Total download size: 382 k

    Downloading Packages:

    ppp-2.4.4-2.el5.i386.rpm | 382 kB 00:00

    Running rpm_check_debug

    Running Transaction Test

    Finished Transaction Test

    Transaction Test Succeeded

    Running Transaction

    Installing : ppp [1/1]


    Installed: ppp.i386 0:2.4.4-2.el5

    Complete!

    mknod: `/dev/ppp': File exists

    --12:32:32-- http://soft.kwx.gd/vpn/rp-l2tp-0.4.tar.gz

    Resolving soft.kwx.gd... 198.52.124.123

    Connecting to soft.kwx.gd|198.52.124.123|:80... connected.

    HTTP request sent, awaiting response... 200 OK

    Length: 198869 (194K) [application/x-gzip]

    Saving to: `rp-l2tp-0.4.tar.gz.1'


    100%[=======================================>] 198,869 347K/s in 0.6s


    12:32:36 (347 KB/s) - `rp-l2tp-0.4.tar.gz.1' saved [198869/198869]


    rp-l2tp-0.4/

    rp-l2tp-0.4/README

    rp-l2tp-0.4/Makefile.in

    rp-l2tp-0.4/install-sh

    rp-l2tp-0.4/auth.c

    rp-l2tp-0.4/configure

    rp-l2tp-0.4/configure.in

    rp-l2tp-0.4/debug.c

    rp-l2tp-0.4/dgram.c

    rp-l2tp-0.4/l2tp.conf

    rp-l2tp-0.4/l2tp.h

    rp-l2tp-0.4/main.c

    rp-l2tp-0.4/make-release.sh

    rp-l2tp-0.4/md5.c

    rp-l2tp-0.4/md5.h

    rp-l2tp-0.4/network.c

    rp-l2tp-0.4/options.c

    rp-l2tp-0.4/peer.c

    rp-l2tp-0.4/session.c

    rp-l2tp-0.4/tunnel.c

    rp-l2tp-0.4/utils.c

    rp-l2tp-0.4/handlers/

    rp-l2tp-0.4/handlers/Makefile.in

    rp-l2tp-0.4/handlers/cmd-control.c

    rp-l2tp-0.4/handlers/cmd.c

    rp-l2tp-0.4/handlers/dstring.c

    rp-l2tp-0.4/handlers/dstring.h

    rp-l2tp-0.4/handlers/pty.c

    rp-l2tp-0.4/handlers/sync-pppd.c

    rp-l2tp-0.4/man/

    rp-l2tp-0.4/man/l2tpd.8

    rp-l2tp-0.4/man/l2tp.conf.5

    rp-l2tp-0.4/libevent/

    rp-l2tp-0.4/libevent/Makefile.in

    rp-l2tp-0.4/libevent/event.c

    rp-l2tp-0.4/libevent/event.h

    rp-l2tp-0.4/libevent/event_sig.c

    rp-l2tp-0.4/libevent/event_tcp.c

    rp-l2tp-0.4/libevent/event_tcp.h

    rp-l2tp-0.4/libevent/eventpriv.h

    rp-l2tp-0.4/libevent/hash.c

    rp-l2tp-0.4/libevent/hash.h

    rp-l2tp-0.4/libevent/Doc/

    rp-l2tp-0.4/libevent/Doc/flow.fig

    rp-l2tp-0.4/libevent/Doc/libevent.tex

    rp-l2tp-0.4/libevent/Doc/style.tex

    rp-l2tp-0.4/libevent/Doc/libevent.pdf

    loading cache ./config.cache

    checking for gcc... (cached) gcc

    checking whether the C compiler (gcc ) works... yes

    checking whether the C compiler (gcc ) is a cross-compiler... no

    checking whether we are using GNU C... (cached) yes

    checking whether gcc accepts -g... (cached) yes

    checking for a BSD compatible install... (cached) /usr/bin/install -c

    checking for ranlib... (cached) ranlib

    checking for dlopen in -ldl... (cached) yes

    checking how to run the C preprocessor... (cached) gcc -E

    checking for ANSI C header files... (cached) yes

    checking for fcntl.h... (cached) yes

    checking for sys/ioctl.h... (cached) yes

    checking for sys/time.h... (cached) yes

    checking for syslog.h... (cached) yes

    checking for unistd.h... (cached) yes

    checking for libevent directory... libevent

    checking for working const... (cached) yes

    checking for pid_t... (cached) yes

    checking for size_t... (cached) yes

    checking whether time.h and sys/time.h may both be included... (cached) yes

    checking whether gcc needs -traditional... (cached) no

    checking for 8-bit clean memcmp... (cached) yes

    checking return type of signal handlers... (cached) void

    checking for vprintf... (cached) yes

    checking for gethostname... (cached) yes

    checking for gettimeofday... (cached) yes

    checking for socket... (cached) yes

    checking for strdup... (cached) yes

    checking for strerror... (cached) yes

    checking for strtol... (cached) yes

    creating ./config.status

    creating Makefile

    creating libevent/Makefile

    creating handlers/Makefile

    make -C handlers

    make[1]: Entering directory `/tmp/rp-l2tp-0.4/handlers'

    make[1]: Nothing to be done for `all'.

    make[1]: Leaving directory `/tmp/rp-l2tp-0.4/handlers'

    mkdir: cannot create directory `/var/run/xl2tpd/': File exists

    ln: creating symbolic link `/var/run/xl2tpd/l2tp-control' to `/usr/local/sbin/l2tp-control': File exists

    --12:32:37-- http://soft.kwx.gd/vpn/xl2tpd-1.2.8.tar.gz

    Resolving soft.kwx.gd... 198.52.124.123

    Connecting to soft.kwx.gd|198.52.124.123|:80... connected.

    HTTP request sent, awaiting response... 200 OK

    Length: 546214 (533K) [application/x-gzip]

    --12:32:41-- (try: 2) http://soft.kwx.gd/vpn/xl2tpd-1.2.8.tar.gz

    Reusing existing connection to soft.kwx.gd:80.

    HTTP request sent, awaiting response... 416 Requested range not satisfiable


    The file is already fully retrieved; nothing to do.


    install -d -m 0755 /usr/local/sbin

    install -m 0755 xl2tpd /usr/local/sbin/xl2tpd

    install -d -m 0755 /usr/local/share/man/man5

    install -d -m 0755 /usr/local/share/man/man8

    install -m 0644 doc/xl2tpd.8 /usr/local/share/man/man8/

    install -m 0644 doc/xl2tpd.conf.5 doc/l2tp-secrets.5 \

    /usr/local/share/man/man5/

    # pfc

    install -d -m 0755 /usr/local/bin

    install -m 0755 pfc /usr/local/bin/pfc

    install -d -m 0755 /usr/local/share/man/man1

    install -m 0644 contrib/pfc.1 /usr/local/share/man/man1/

    mkdir: cannot create directory `/etc/xl2tpd': File exists

    Saving firewall rules to /etc/sysconfig/iptables: [ OK ]

    Flushing firewall rules: [ OK ]

    Setting chains to policy ACCEPT: nat mangle filter raw [ OK ]

    Unloading iptables modules: [ OK ]

    Applying iptables firewall rules: [ OK ]

    L2TP VPN service is installed, your L2TP VPN username is

    Thank you very much for your help!
     
    bangduck, Jan 29, 2017 IP
  2. godtor

    godtor Greenhorn

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    Hi there, is your firewall UP? In most cases CentOS comes with the firewall enabled so you should add a rule to open the VPN port or just disable the firewall and test the connection to the vpn server :)
     
    godtor, Jan 29, 2017 IP
  3. bangduck

    bangduck Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Could you please teach me how to open the ports via Putty? What do I write on Putty and which ports?

    I am horrible at these things.

    Thanks again!
     
    bangduck, Jan 30, 2017 IP
  4. godtor

    godtor Greenhorn

    Messages:
    17
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #4
    Usually the VPN ports are 443 and 1194:

    1. iptables -I INPUT -p tcp -m tcp --dport 443 -j ACCEPT
    2. iptables -I INPUT -p tcp -m tcp --dport 1194 -j ACCEPT
    3. service iptables save
     
    godtor, Jan 30, 2017 IP
  5. daredashi

    daredashi Well-Known Member

    Messages:
    667
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    120
    #5
    Have you checked iptables compatibility ? Also its not possible to run VPN onto OpenVZ
    You should have KVM or Xen to get VPN work perfectly with all functions and features.
     
    daredashi, Jul 3, 2017 IP