ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • OpenVPN server, client 구축 메뉴얼
    여러가지 2018. 10. 15. 11:07

    ubuntu version :  16.04


    <Install Ubuntu-desktop in aws ec2>

    ubuntu~$ sudo apt-get update

    ubuntu~$ sudo apt-get install --no-install-recommends ubuntu-desktop

    ubuntu~$ sudo apt-get install tightvncserver gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

    ubuntu~$ vncserver :1

    ubuntu~$ vi~/.vnc/xstartup

    #!/bin/sh


    export XKL_XMODMAP_DISABLE=1

    unset SESSION_MANAGER

    unset DBUS_SESSION_BUS_ADDRESS


    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup

    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources

    xsetroot -solid grey


    vncconfig -iconic &

    gnome-panel &

    gnome-settings-daemon &

    metacity &

    nautilus &

    gnome-terminal &

    vncserver -kill :1

    vncserver :1


    <Install openvpn 2.4.6 in Ubuntu 16.04>

    sudo -s

    sudo wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg|apt-key add -
    echo "deb http://build.openvpn.net/debian/openvpn/release/2.4 xenial main" > /etc/apt/sources.list.d/openvpn-aptrepo.list

    sudo apt-get update && apt-get install openvpn

    openvpn version : 2.4.6


    <openvpn setting>


    <Server>

    C:\Program Files\OpenVPN\easy-rsa> init-config

    C:\Program Files\OpenVPN\easy-rsa> vars

    C:\Program Files\OpenVPN\easy-rsa> clean-all

    C:\Program Files\OpenVPN\easy-rsa> build-ca

    C:\Program Files\OpenVPN\easy-rsa> build-key-server server

    commonName : <Server Name>

    C:\Program Files\OpenVPN\easy-rsa> build-dh

    C:\Program Files\OpenVPN\easy-rsa\keys> openvpn --genkey --secret ta.key

    C:\Program Files\OpenVPN\config 폴더에 파일 복사

    ca.crt

    ca.key

    dh1024.pem

    ta.key

    server.crt

    server.key

    C:\Program Files\OpenVPN\sample-config\server.ovpn 파일을
    C:\Program Files\OpenVPN\config 폴더로 복사

    server.ovpn 파일 수정

    C:\Program Files\OpenVPN\config> openvpn server.ovpn

    port 21 열기

    OpenVPN에서 사용할 port 열기 (1195)


    <Client>

    C:\Program Files\OpenVPN\easy-rsa> vars

    C:\Program Files\OpenVPN\easy-rsa> build-key client1

    commonName : <Client Name>

    Client에 파일 복사

    ca.crt

    ca.key

    client1.key=

    client1.crt

    ta.key

    C:\Program Files\OpenVPN\sample-config\client.ovpn 파일을 Client 폴더로 복사

    client.ovpn 파일 수정



    <Openvpn Config set>

    <server.ovpn>

    <client.ovpn>

    port 1195

    proto tcp

    dev tun

    ca ca.crt

    cert server.crt

    key server.key

    dh dh2048.pem

    server 10.8.0.0 255.255.255.0

    ifconfig-pool-persist ipp.txt

    keepalive 10 120

    tls-server

    tls-auth ta.key 0

    cipher SEED-CBC

    ncp-disable

    persist-key

    persist-tun

    status openvpn-status.log

    verb 3

    client

    dev tun

    proto tcp

    remote 54.180.95.47 1195

    resolv-retry infinite

    nobind

    persist-key

    persist-tun

    ca C:/client2/ca.crt

    cert C:/client2/client2.crt

    key C:/client2/client2.key

    tls-client

    remote-cert-tls server

    tls-auth C:/client2/ta.key 1

    cipher SEED-CBC

    ncp-disable

    verb 3


    <Image Transfer Test>


    <Server>

    <Client>

    댓글