맛집 여행 캠핑 일상 생활

CentOS 7.x VPN 서버 설정하기 본문

LAMP

CentOS 7.x VPN 서버 설정하기

영은파더♥ 2016. 4. 2. 22:42

CentOS 7.x VPN 서버 설정하기


리눅스에 VPN Virtual Private Network 설치 및 설정에 대해서 알아보자.


▶ PPTPD 관련 패키지 설치

# rpm -Uvh http://linux.mirrors.es.net/fedora-epel//epel-release-latest-7.noarch.rpm

# yum install -y ppp pptpd


▶ /etc/ppp/options.pptpd 파일 수정

ms-dns 8.8.8.8

ms-dns 8.8.4.4

ms-dns 를 찾아서 위와 같이 주석을 풀고 dns IP를 적어주고 저장


▶ /etc/ppp/chap-secrets 파일에 VPN 접속 계정 추가

itrooms  *  itroomsPW  *

* 대신에 ip를 넣어줘도 된다.


▶ /etc/pptpd.conf 파일에 아래 내용 추가

connections 200

localip 192.168.1.1

remoteip 192.168.1.2-254


▶ /etc/sysctl.conf 파일에 아래 내용 추가

net.ipv4.ip_forward = 1

# sysctl -p 명령어 실행


▶ 방화벽 포트 추가

# firewall-cmd --permanent --new-service=pptp

# sed -i 's/<service>/<service>\n\t<port\ protocol=\"tcp\"\ port=\"1723\"\/>/g' /etc/firewalld/services/pptp.xml

# firewall-cmd --permanent --zone=public --add-service=pptp

# firewall-cmd --permanent --zone=public --add-masquerade

# firewall-cmd --reload


▶ pptpd 데몬 시작 및 시작데몬 등록

# systemctl start pptpd.service

# systemctl enable pptpd.service


이렇게 하면 되어야 하는데


ConoHa VPS 에서는 안 먹힌다. 커스텀 ISO를 올려서 설치를 해봐도 안된다.


커스텀 이미지 설치하는 방법은 여기를 참고하자. https://ivps.tistory.com/10


Apr  7 14:13:02 conoha pptpd[28011]: CTRL: Starting call (launching pppd, opening GRE)

Apr  7 14:13:02 conoha pppd[28012]: Plugin /usr/lib64/pptpd/pptpd-logwtmp.so loaded.

Apr  7 14:13:02 conoha pppd[28012]: pppd 2.4.5 started by root, uid 0

Apr  7 14:13:02 conoha pppd[28012]: Using interface ppp0

Apr  7 14:13:02 conoha pppd[28012]: Connect: ppp0 <--> /dev/pts/1

Apr  7 14:13:02 conoha NetworkManager[639]: <info>  (ppp0): new Generic device (carrier: UNKNOWN, driver: 'unknown', ifindex: 6)

Apr  7 14:13:32 conoha pppd[28012]: LCP: timeout sending Config-Requests

Apr  7 14:13:32 conoha pppd[28012]: Connection terminated.

Apr  7 14:13:32 conoha NetworkManager[639]: <warn>  (ppp0): failed to disable userspace IPv6LL address handling

Apr  7 14:13:32 conoha pppd[28012]: Modem hangup

Apr  7 14:13:32 conoha pppd[28012]: Exit.

Apr  7 14:13:32 conoha pptpd[28011]: GRE: read(fd=6,buffer=7f1527c1a480,len=8196) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax and pppd logs

Apr  7 14:13:32 conoha pptpd[28011]: CTRL: PTY read or GRE write failed (pty,gre)=(6,7)


이유가 뭘까??


코노하는 막힌 것 같다. (Conoha 는 안됨, DigitalOcean, Linode, Vultr 는 PPTD 가능)


Vultr, Linode, DigitalOcean 에서 성공하였으며 설정 방법은 https://ivps.tistory.com/61 여기를 참고하자.




Trackback : | Comments :