* 우분투 18.04 버전 기반(Ubuntu 18.04)
1. vpnclient 프로그램 설치
sudo apt install vpnc network-manager-vpnc-gnome
2. 설정
root@VL-harbor:~# cat /etc/vpnc/default.conf
#IPSec gateway <gateway>
#IPSec ID <group-id>
#IPSec secret <group-psk>
#IKE Authmode hybrid
#Xauth username <username>
#Xauth password <password>
※ sudo vpnc /etc/vpnc/default.conf 혹은 sudo vpnc \default.conf
3. VPN 연결
# sudo vpnc-connect (끊을때는 sudo vpnc-disconnect)
예시)
root@VL-harbor:~# cat /etc/vpnc/default.conf
IPSec gateway [VPN Public IP]
IPSec ID [VPNGroupID]
IPSec secret [VPNGroup-password]
#IKE Authmode hybrid ---> 주석 처리해도 무방함
Xauth username [VPN Client ID]
Xauth password [VPN Client password]
root@VL-harbor:~#
4. VPN 연결 확인: sudo vpnc-connect 이후 ip addr 에서 tun0 로 client IP 할당 된것 확인가능
root@VL-harbor:~# ip addr
: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1412 qdisc fq_codel state UNKNOWN group default qlen 500 link/none
inet 172.20.38.153/32 scope global tun0 //# Assigned
valid_lft forever preferred_lft forever
inet6 fe80::59bf:bd0d:ee37:3533/64 scope link stable-privacy
valid_lft forever preferred_lft forever
* 혹은 아래처럼 default route가 tun0 로 잡힌것도 확인 가능함
:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 tun0 //# set
121.137.98.146 150.100.200.1 255.255.255.255 UGH 0 0 0 ens3
150.100.200.0 0.0.0.0 255.255.255.0 U 0 0 0 ens3
172.20.38.152 0.0.0.0 255.255.255.248 U 0 0 0 tun0
* VPN 서버에서 split vpn 설정해두었다면, 외부망 ping도 가능
:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=3.87 ms\
위는 CLI 로 하는 방법이며, 리눅스에 GUI 가 있다면 아래 링크를 통해 GUI base 로도 설정 가능함.
https://johnpili.com/how-to-connect-to-a-cisco-vpn-in-ubuntu-18-04-lts/
출처: 부서의 VPN 전문가 선배님