※ 참고 (2026년 기준) easy-rsa 2.0 방식 대신 easy-rsa 3 를 쓴다 (글 끝 “Ubuntu 에서 변경” 참고). comp-lzo 는 VORACLE 취약점 때문에 쓰지 않는 것이 좋고, DH 키는 2048 비트 이상(dh2048.pem)을 쓴다. SELinux 의 openvpn_disable_trans 옵션은 RHEL 5 이후 없어졌다.
yum install openvpn
그러면 설치가 완료된다. ㅋㅋ
이제 CA 인증서를 생성하고 Server 인증서를 생성하고 Client에서 사용할 인증서를 생성하고 서버와 클라이언트에 환경파일을 맞춰 준후에 재시작하면 된다.
먼저 /usr/share/doc/openvpn-X.X.X/easy-rsa/2.0 에 vars 파일 가장 아래쪽 인증서 구성한후
|
1 2 3 4 5 |
export KEY_COUNTRY=KR export KEY_PROVINCE=NA export KEY_CITY=SEOUL export KEY_ORG="anyons" |
|
1 |
source ./vars |
로 환경구성
1-4. 그 뒤에아래 Command로 인증서 생성 마무리
|
1 |
./build-dh |
2-1. 서버 환경파일 편집 /etc/openvpn/server.conf
|
1 2 3 4 5 |
server 10.1.1.0 255.255.255.0 client-to-client duplicate-cn max-clients 100 plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so login |
2-2 서버 환경 폴더에 필요한 파일들
|
1 2 3 4 5 6 7 |
ca.crt ca.key dh1024.pem server.conf server.crt server.csr server.key |
2-3 마지막 selinux 설정
|
1 2 |
setsebool -P openvpn_enable_homedirs 1 setsebool -P openvpn_disable_trans on |
2-4 클라이언트 환경파일 편집 C:\Program Files\OpenVPN\config\client.ovpn
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
client dev tun proto udp remote 218.145.31.188 1194 resolv-retry infinite nobind persist-key persist-tun ca ca.crt cert client.crt key client.key comp-lzo verb 3 auth-user-pass |
2-5 클라이언트 환경 폴더에 필요한 파일들
|
1 2 3 4 5 |
ca.crt client.crt client.csr client.key client.ovpn |
3-1. Ubuntu 에서 변경
|
1 2 3 4 5 |
./easyrsa gen-req clientname ./easyrsa sign-req clientname pki/issued/clientname.crt pki/private/clientname.key |
로 변경
관련 글: SELinux 사용 예



