우분투 18.04 에 openvpn 서버 구축
우분투 18.04 환경에서 vpn 서비스를 위한 openvpn 서버 구축 방법이다. openvpn 서버 구축에는 openvpn-installer 스크립트를 이용한다.
git clone https://github.com/Nyr/openvpn-install.git cd openvpn-install/ chmod +x openvpn-install.sh sudo ./openvpn-install.sh
openvpn-install.sh 파일을 실행하면 아래의 내용이 터미널에 표시되면서 설치를 진행하게 된다.
root@ncube:~/openvpn-install# ./openvpn-install.sh Welcome to this OpenVPN "road warrior" installer! I need to ask you a few questions before starting the setup. You can leave the default options and just press enter if you are ok with them. First, provide the IPv4 address of the network interface you want OpenVPN listening to. IP address: 10.4.0.9 This server is behind NAT. What is the public IPv4 address or hostname? Public IP address / hostname: 192.168.0.20 Which protocol do you want for OpenVPN connections? 1) UDP (recommended) 2) TCP Protocol [1-2]: 1 What port do you want OpenVPN listening to? Port: 1194 Which DNS do you want to use with the VPN? 1) Current system resolvers 2) 1.1.1.1 3) Google 4) OpenDNS 5) Verisign DNS [1-5]: 1 Finally, tell me your name for the client certificate. Please, use one word only, no special characters. Client name: client1 Okay, that was all I needed. We are ready to set up your OpenVPN server now. Press any key to continue...
위 내용 중 Public IP address / hostname: 192.168.0.20
부분은 ip 대신 도메인(example.com) 을 입력해도 된다. 설치가 완료되면 /root/client1.ovpn 설정파일이 생성되는데 이 설정 파일을 이용해 openvpn 서버에 연결하게 된다.
참고자료
https://computingforgeeks.com/easy-way-to-install-and-configure-openvpn-server-on-ubuntu-18-04-ubuntu-16-04/
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-18-04