JavaScript must be enabled in order for you to see "WP Copy Data Protect" effect. However, it seems JavaScript is either disabled or not supported by your browser. To see full result of "WP Copy Data Protector", enable JavaScript by changing your browser options, then try again.

Setup a relay station for VPN connection/VNC


Well, well, well, I need to post a rubbish because there isn’t enough about the quantity of writing the article. Today’s topic is how to setup a relay station for VPN connection/VNC, because we want to solve the problem about accessing the websites from internet and be connected w/ VPN at the same time, so we can use a relay station for avoiding this condition. How to setup it? Let’s keep reading:

1) Finish OS installation and improve the fine tuning w/ CentOS 6.7 x64

2) Download and install the packages about openconnect
#mkdir -p openconnect && cd openconnect
#wget ftp://mirror01.idc.hinet.net/epel/6Server/x86_64/NetworkManager-openconnect-0.8.6.0-2.el6.x86_64.rpm
#wget ftp://mirror01.idc.hinet.net/epel/6Server/x86_64/NetworkManager-vpnc-0.8.0-1.git20100411.el6.x86_64.rpm
#wget ftp://mirror01.idc.hinet.net/epel/6Server/x86_64/openconnect-5.03-3.el6.x86_64.rpm
#wget ftp://195.220.108.108/linux/epel/6/x86_64/vpnc-0.5.3-4.el6.x86_64.rpm
#rpm -ivh NetworkManager-openconnect-0.8.6.0-2.el6.x86_64.rpm
#rpm -ivh NetworkManager-vpnc-0.8.0-1.git20100411.el6.x86_64.rpm
#rpm -ivh vpnc-0.5.3-4.el6.x86_64.rpm
#rpm -ivh openconnect-5.03-3.el6.x86_64.rpm

3) Record the weblink for VPN connection and create into everyone’s folder automatically
#cd /etc/skel
#cat weblink

http://<URL_You_Want_To_Access>

4) Create a new user, and configure the part of VNC server
#adduser testuser
#passwd testuser
#su - testuser
$vncserver -> For setup the passwd of VNC
$exit
#lsof -i :5901

5) Configure the rc.local for setting of startup
#cat /etc/rc.d/rc.local
echo '<VPN_PASSWORD>' | openconnect -u <VPN_ACCOUNT> --passwd-on-stdin --no-cert-check --background <VPN_SITE_URL>
su - testuser -c 'vncserver'

6) Configure the crontab for VPN connection(Exec per 5 mins)
#cat /etc/vpnconnect.sh
#! /bin/bash
###
DRC=`ifconfig | grep -i tun0 | wc -l`
if [ $DRC -lt 1 ] ; then
echo '<VPN_PASSWORD>' | openconnect -u <VPN_ACCOUNT> --passwd-on-stdin --no-cert-check --background <VPN_SITE_URL>
fi
#chmod a+x /etc/vpnconnect.sh
#crontab -e
#service crond restart
#crontab -l
*/5 * * * * /etc/vpnconnect.sh

7) Disable the notification for setting of network proxy about VNC session(Refer here)
#vi /etc/xdg/autostart/gpk-update-icon.desktop
# Add to bottom of file
X-GNOME-Autostart-enabled=false

8) Configure the func of quota for every users
#cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Fri Jan 8 20:34:46 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=e4e9c6b8-29e7-484b-8779-b9f2eaa1bde4 / ext4 defaults,usrquota,grpquota 1 1
UUID=7191b717-2aa7-4d2b-94d0-03d118427b74 /boot ext4 defaults 1 2
UUID=b3dd1faa-9269-411c-8b5a-d3524da31455 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
#init 6
#cat /proc/mounts | grep -i usr
#quotacheck -avmcug
#edquota -u testuser
#quotaon -av
#repquota -auvs

9) Check the result of ipconfig for the part of tunnel
#ifconfig

◎、Above information is about setup a relay station for VPN connection/VNC, but there is a limitation about accessing the VNC server. You can’t connect to the VNC server if you use the IP that is different w/ the network of VNC server. That’s all for today, see you next time!

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

 
This site is protected by WP-CopyRightPro