티스토리 뷰

VPN

PPTPD VPN 설치 (centos7)

CHOMAN 2018. 1. 31. 16:39

설치전 사전 작업

cat /etc/sysconfig/selinux

SELINUX=disabled

vi /etc/sysctl.conf

net.ipv4.ip_forward = 1

적용

sysctl -p

epel 저장소 설치

yum install epel-release

pptpd 설치

yum install pptp pptpd

pptp 는 클라이언트, pptpd 서버

pptpd 데몬시작

service pptpd start

/etc/pptpd.conf

option /etc/ppp/options.pptpd
logwtmp
localip 10.0.1.1
remoteip 10.0.1.2-254

/etc/ppp/options.pptpd

auth
name pptpd
ms-dns 8.8.8.8
ms-dns 168.126.63.1
idle 0

vim /etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
takakocap * passwordxxx *
takakocap1 pptpd passwordxxx 10.0.1.2

설명

client (ID)
server (daemon) : pptpd 명시하만 pptpd에서만 참조, * 는 l2tp 등의 데몬에서 저 chap-secret 참조 가능
secret (password) : 특수문자 '#' 를 비밀번호에 포함시키면 주석으로 인식하기 때문에 넣지 않는다
IP address : client 에게 할당할 아이피 지정

iptables 방화벽 설정

iptables -A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 1723 -j ACCEPT
iptables -A RH-Firewall-1-INPUT -p 47 -j ACCEPT
iptables -t nat  -A POSTROUTING -s 10.0.0.0/8 -o eth0 -j MASQUERADE

firewalld 설정

# pptp 통신 관련
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p gre -j ACCEPT
firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -p tcp --dport 1723 -j ACCEPT 

# MASQ 설정
firewall-cmd --permanent --direct --add-rule ipv4 filter POSTROUTING 0 -t nat -o eth0 -j MASQUERADE 

# 클라이언트 연결후 외부혹은 내부 통신 관련
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i ppp+ -o eth0 -j ACCEPT 
firewall-cmd --permanent --direct --add-rule ipv4 filter FORWARD 0 -i eth0 -o ppp+ -j ACCEPT

# 영구 적용
firewall-cmd --reload

이더넷 포트 (사설, 공인) 여부와 OS 버전에 따라 이더넷 번호 (eth0) 을 달라질수 있음

'VPN' 카테고리의 다른 글

L2TP에서 logwtmp 옵션이용하기  (0) 2018.02.26
터널링 (ipip, gre) 리눅스  (0) 2018.02.09
softether router 설정  (0) 2018.01.24
openvpn bridge mode  (0) 2017.12.29
L2TP on ipsec (with xl2tpd, libreswan) centos7  (0) 2017.12.05
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함