OS/ubuntu

ubuntu - openvpn 설치(AWS ubuntu 이용가능)

물방울시드 2023. 4. 18. 09:43

#스크립트 설치

wget https://git.io/vpn -O openvpn-install.sh

 

#스크립트 권한 변경

sudo chmod +x openvpn-install.sh

 

#스크립트를 실행
sudo bash openvpn-install.sh

 

#설치중

Welcome to this OpenVPN road warrior installer!

 

#AWS에서 설치해서 ip를 확인하는듯하다
This server is behind NAT. What is the public IPv4 address or hostname?
Public IPv4 address / hostname [ㅁㅁㅁ.ㅁㅁㅁ.ㅁㅁㅁ.ㅁㅁㅁ]: 1.2.3.4

Which protocol should OpenVPN use?
   1) UDP (recommended)
   2) TCP
Protocol [1]: 1

What port should OpenVPN listen to?
Port [1194]: 1194

#구글DNS를 선택했으나 다른것 선택해도 무방

Select a DNS server for the clients:
   1) Current system resolvers
   2) Google
   3) 1.1.1.1
   4) OpenDNS
   5) Quad9
   6) AdGuard
DNS server [1]: 2


#클라이언트이름
Enter a name for the first client:
Name [client]: testvpn

 

#설치완료 후 ovpn 파일 찾고 이를 이용하여 OPENVPN 접속하자

/root/testvpn.ovpn

 

# 서비스 상태확인
sudo systemctl status openvpn-server@server.service

# 서비스 중지
sudo systemctl stop openvpn-server@server.service

# 서비스 시작
sudo systemctl start openvpn-server@server.service

# 서비스 재시작
sudo systemctl restart openvpn-server@server.service