Tag : vpn-on-linux
Tag : vpn-on-linux
We can setup script for connect cartier love bangle vpn from command line on centos linux. Following are couple of steps but before that, you need to install pptp and pptpsetup on linux.
Run following command with your credentials …
pptpsetup –create <vpn connection name> –server <vpn host> –username <login username> –password <login password> –encrypt
You need to implement cartier love necklace following service on linux. So we can able to stop and start vpn like …
service vpn-service start|stop|status ##!/bin/bash CHANNEL=&lt;vpn connection name&gt; NAME="Vpn client" case "$1" in start) echo "Starting ${NAME}..." check=$(ps -eo pid,ppid,user,comm,args | grep pptpgw | grep -v grep |awk '{print $1}') if [ -f "/etc/ppp/peers/${CHANNEL}" ];then echo "Channel ${CHANNEL} exist.." else echo "${CHANNEL} doesn't exist! Please use pptp documentation for more information" fi if [ -z "$check" ];then pppd call <a href="http://www.uwst.org/bracelet-replica-car">bracelet replica cartier</a> ${CHANNEL} logfile ~/${CHANNEL}-vpn.log usepeerdns defaultroute ## echo "$(route -n | tail -n1 | awk '{print $2}')" &gt; /tmp/.${CHANNEL}-vpn.log sleep 4 ;route del default ## echo -e "log file is ~/${CHANNEL}-vpn.log" echo "..." echo "Done." else echo "${NAME} already running [pid = $check]" fi ;; stop) echo "killing ${NAME}..." kill -9 $(ps -eo pid,comm,args | grep "pppd call ${CHANNEL}" | grep -v grep |awk '{print $1}') echo "..." echo "Done." echo "Please run this command if any issue - $0 net" ;; net) route add default gw $(cat /tmp/.${CHANNEL}-vpn.log) ;; status) pid_of_dailer=$(ps -eo pid,comm,args | grep "pppd call ${CHANNEL}" | grep -v grep |awk '{print $1}') pid_of_pptp1=$(ps -eo pid,ppid,user,comm,args | grep pptpgw | grep -v grep |awk '{print $1}') pid_of_pptp2=$(ps -eo pid,ppid,user,comm,args | grep pptpcm | grep -v grep |awk '{print $1}') echo -e "${NAME} ~ $pid_of_dailer $pid_of_pptp1 $pid_of_pptp2" ;; *) echo "Usage: $0 {start|stop|status|net}" exit 1 esac exit 0 #DONE
You need add your vpn hosts IP into resolv.conf
# Generated by NetworkManager
nameserver <vpn host ip>
nameserver <vpn host ip>
nameserver 192.168.0.1
Categories: Linux