Showing posts with label vpnc. Show all posts
Showing posts with label vpnc. Show all posts

Wednesday, December 11, 2013

Prevent SSH connection from freezing

Recently I have experinced my ssh connection to remote server is hung after idle time. this is very annoying because ssh connection was established over vpn and take time to reconnect the session again. If your ssh connection hung/freeze time to time following solution may be helpful.


1) Open the ssh_config file.


location may differ,in centos
vim /etc/ssh/ssh_config

2) Add following lines


Host *
    ServerAliveInterval 300
    ServerAliveCountMax 2



Remember, this configuration is done at client side. client send keep alive message to server every 180 seconds and server send ack (acknowledgement) message.If 2 consecutive ack messages are lost from server side. connection will be dropped as server is not available.

Sunday, November 17, 2013

Installing vpnc - Linux VPN Client for Cisco VPN

This tutorial, I will show you how to configure vpnc on Linux and  connect  Cisco devices through vpn using pcf file. The vpnc is an alternative Linux software for Cisco vpn client.
all the things are done on centos 6.3 but steps should be same for any Linux system.


1) Installing EPEL repo

Since centos repo doesn't contain the vpnc, we need to configure additional repo call EPEL.
It is straightforward installation and  document can be found form here.

http://fedoraproject.org/wiki/EPEL/FAQ#How_can_I_install_the_packages_from_the_EPEL_software_repository.3F

Please find "How can I install the packages from the EPEL software repository? " from content and install it. you may need to enable EPEL repo sometime.

2) Installing vpnc

once you enabled the rpmforge repo, type following command to install vpnc  
[root@localhost ~]#yum install vpnc

3)Chang folder permission

I installed the vpnc as root.if you wish to run vpnc as normal user other than root .change file permission of vpnc installaion directory
/etc/vpnc/vpnc-script

4)Download pcf2vpnc

[root@localhost ~]#wget http://svn.unix-ag.uni-kl.de/vpnc/trunk/pcf2vpnc

5)Convert pcf file

[root@localhost ~]#perl pcf2vpnc demopcf.pcf demovpnc.conf
change ownership of *.conf file if you need

6)copy *.conf to /etc/vpnc/ 

[root@localhost ~]#cp demovpnc.conf /etc/vpnc/

7)Start vpnc

[root@localhost ~]#vpnc demovpnc
Enter password for user@A.B.C.D:
(A.B.C.D is public ip address where you need to connect, user is username , you need to enter password )

8)disconnect vpnc

[root@localhost ~]#vpnc-disconnect

Related Posts