0

I have to connect remotely from client on CentOS to VPN server, hosted on Windows.

What have been done:

  1. Installed packages yum install ppp pptp

  2. Contents of /etc/ppp/peers/harkiv_vpn

    # pty "pptp xxx.xxx.xxx.xxx --nolaunchpppd" # using IP address
    pty "pptp vpn.campus.harkiv.ua --nolaunchpppd"
    lock
    noauth
    nobsdcomp
    nodeflate
    nodefaultroute
    usepeerdns
    name user_name
    remotename harkiv_vpn
    ipparam harkiv_vpn
    refuse-pap
    refuse-eap
    refuse-chap
    refuse-mschap
    require-mppe
    nomppe-stateful
    
  3. Contents of /etc/ppp/chap-secrets

    # Secrets for authentication using CHAP
    # client server secret IP addresses
    
    user_name harkiv_vpn "user_password_in_dblquotes" *
    
  4. Created script start_vpn1.sh

    systemctl stop firewalld            # stop the firewall
    pppd call harkiv_vpn                # start VPN connection
    # pppd call megarvpn debug nodetach # for starting VPN manually
    
  5. Created script stop_vpn.sh

    pkill pptp                # stop VPN connection
    systemctl start firewalld # start the firewall
    systemctl restart network # restarting service recreates the file resolv.conf
    

After all that vpn connection starts, but I still can't access remote resources. What have I missed?

  • 1
    Warning: PPTP is obsolete and insecure. It does not provide privacy or confidentiality and should not be used if you need these. – Michael Hampton Oct 16 '18 at 19:41

1 Answers1

0

After running script start_vpn1.sh, the VPN connection is started, but the gateway in it is taken from the current network connection, not from a remote VPN server. To correct this:

  1. Contents of /etc/resolv.conf

    # Generated by NetworkManager
    search harkiv.local
    nameserver zzz.zzz.zzz.zzz # Remote VPN server gateway <- add this line
    nameserver xxx.xxx.xxx.xxx # DNS1 of network connection
    nameserver yyy.yyy.yyy.yyy # DNS2 of network connection
    
  2. Create script start_vpn2.sh

    cp resolv.conf /etc/
    route add -net 10.0.0.0 netmask 255.0.0.0 gw zzz.zzz.zzz.zzz