본문
CentOS7 PPTP VPN 클라이언트 설정하기
# CentOS7 PPTP VPN 클라이언트 설정하기
아래의 정보를 기반으로 VPN 설정을 진행한다.
- VPN hostname : pptp.vpn.nixcraft.com (Microsoft PPTP vpn server)
- VPN username : vivek
- VPN password : VpnPassword
- VPN connection name : delhi-idc-01
1. pptp 설치
# yum install pptp
2. /etc/ppp/chap-secrets 에서 아래 추가 (userName PPTP password *)
# vi /etc/ppp/chap-secrets
vivek PPTP VpnPassword *
3. /etc/ppp/peers/delhi-idc-01 생성 및 설정
# vi /etc/ppp/peers/delhi-idc-01
pty "pptp pptp.vpn.nixcraft.com --nolaunchpppd"
name vivek
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam delhi-idc-01
4. ppp0를 위한 경로 설정 - VPN 연결 활성화시 실행되는 스크립트
# vi /etc/ppp/ip-up.local
1 2 3 4 5 | #!/bin/bash NET="10.0.0.0/8" # set me IFACE="ppp0" # set me #IFACE=$1 route add -net ${NET} dev ${IFACE} |
* 10.0.0.0/8 으로 가는 경로가 ppp0로 됨
* Private network (사설IP 대역 설명): https://en.wikipedia.org/wiki/Private_network
5. /etc/ppp/ip-up.local 실행권한 추가
# chmod +x /etc/ppp/ip-up.local
6. VPN 접속
# pppd call delhi-idc-01
7. 확인
# tail -f /var/log/messages
Dec 15 10:15:49 www pppd[4798]: pppd 2.4.4 started by root, uid 0
Dec 15 10:15:49 www pptp[4799]: anon log[main:pptp.c:314]: The synchronous pptp option is NOT activated
Dec 15 10:15:49 www pppd[4798]: Using interface ppp0
Dec 15 10:15:49 www pppd[4798]: Connect: ppp0 <--> /dev/pts/2
Dec 15 10:15:49 www pptp[4806]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 1 'Start-Control-Connection-Request'
Dec 15 10:15:49 www pptp[4806]: anon log[ctrlp_disp:pptp_ctrl.c:739]: Received Start Control Connection Reply
Dec 15 10:15:49 www pptp[4806]: anon log[ctrlp_disp:pptp_ctrl.c:773]: Client connection established.
Dec 15 10:15:50 www pptp[4806]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 7 'Outgoing-Call-Request'
Dec 15 10:15:50 www pptp[4806]: anon log[ctrlp_disp:pptp_ctrl.c:858]: Received Outgoing Call Reply.
Dec 15 10:15:50 www pptp[4806]: anon log[ctrlp_disp:pptp_ctrl.c:897]: Outgoing call established (call ID 0, peer's call ID 896).
Dec 15 10:15:50 www pppd[4798]: CHAP authentication succeeded
Dec 15 10:15:50 www pppd[4798]: MPPE 128-bit stateless compression enabled
Dec 15 10:15:51 www pppd[4798]: local IP address 192.168.0.50
Dec 15 10:15:51 www pppd[4798]: remote IP address 192.168.0.1
# ifconfig
...
ppp0 Link encap:Point-to-Point Protocol
inet addr:192.168.0.50 P-t-P:192.168.0.1 Mask:255.255.255.255 <--- vpn 서버에서 설정한 client ip가 지정되었음
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1496 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:72 (72.0 b) TX bytes:78 (78.0 b)
# netstat -nr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
.....
192.168.0.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 ppp0 <----------- ip-up.local에서 설정한 network 가 추가됨
...
8. VPN 연결 종료
# killall pppd
# tail -f /var/log/messages
Dec 15 10:16:40 www pppd[4798]: Terminating on signal 15
Dec 15 10:16:40 www pppd[4798]: Connect time 0.9 minutes.
Dec 15 10:16:40 www pppd[4798]: Sent 0 bytes, received 0 bytes.
Dec 15 10:16:40 www pptp[4806]: anon log[callmgr_main:pptp_callmgr.c:258]: Closing connection (shutdown)
Dec 15 10:16:40 www pptp[4806]: anon log[ctrlp_rep:pptp_ctrl.c:251]: Sent control packet type is 12 'Call-Clear-Request'
Dec 15 10:16:40 www pptp[4806]: anon log[call_callback:pptp_callmgr.c:79]: Closing connection (call state)
Dec 15 10:16:40 www pppd[4798]: MPPE disabled
Dec 15 10:16:40 www pppd[4798]: Modem hangup
Dec 15 10:16:40 www pppd[4798]: Connection terminated.
Dec 15 10:16:40 www pppd[4798]: Exit.
1) CentOS 6에서 pptp VPN 서버 설정 (CentOS에 vpn 설치 후 (CentOS6에 PPTP VPN Server 구축 후 Windows OS로 접속 TEST)
http://dewnine.tistory.com/39
2) How To Setup Your Own VPN With PPTP on Linux (CentOS, Ubuntu, Debian) - PPTP VPN Client/Server Side
3) 리눅스(Ubuntu)에서 PPTP VPN 연결하기 (GUI)
http://citylock-note.tistory.com/entry/%EB%A6%AC%EB%88%85%EC%8A%A4%EC%97%90%EC%84%9C-PPTP-VPN-%EC%97%B0%EA%B2%B0%ED%95%98%EA%B8%B0-using-Network-Manager-GUI
댓글