Tagged: Server RSS Toggle Comment Threads | Keyboard Shortcuts

  • dikmansn 6:17 pm on 7 February 2010 Permalink | Reply
    Tags: , , Server,   

    Pengujian Jaringan OpenVPN di GNU/Linux Ubuntu 

    Pengujian dilakukan pada server dan client VPN yang telah terinstal software OpenVPN. Pengujian ini untuk memastikan terbentuknya IP Virtual dan saling terhubungnya jaringan VPN yang telah dibuat.

    Menjalankan server VPN

    # /etc/init.d/openvpn start

    Starting virtual private network daemon: server(OK).

    Checking Interfaces server

    root@dikmansn-laptop:/home/dikmansn# ifconfig

    eth0 Link encap:Ethernet HWaddr 00:16:D4:89:E8:78

    inet addr:192.168.17.17 Bcast:192.168.17.255

    Mask:255.255.255.0

    inet6 addr: fe80::216:d4ff:fe89:e878/64 Scope:Link

    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

    RX packets:541342 errors:0 dropped:0 overruns:0 frame:0

    TX packets:203581 errors:0 dropped:0 overruns:0

    carrier:0

    collisions:0 txqueuelen:1000

    RX bytes:817465405 (779.5 MB) TX bytes:13607752 (12.9

    MB)

    lo Link encap:Local Loopback

    inet addr:127.0.0.1 Mask:255.0.0.0

    inet6 addr: ::1/128 Scope:Host

    UP LOOPBACK RUNNING MTU:16436 Metric:1

    RX packets:8702 errors:0 dropped:0 overruns:0 frame:0

    TX packets:8702 errors:0 dropped:0 overruns:0 carrier:0

    collisions:0 txqueuelen:0

    RX bytes:8126621 (7.7 MB) TX bytes:8126621 (7.7 MB)

    tap0 Link encap:Ethernet HWaddr 00:FF:0B:64:F6:4B

    inet addr:10.8.0.1 Bcast:10.8.0.255 Mask:255.255.255.0

    inet6 addr: fe80::2ff:bff:fe64:f64b/64 Scope:Link

    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

    RX packets:0 errors:0 dropped:0 overruns:0 frame:0

    TX packets:25 errors:0 dropped:0 overruns:0 carrier:0

    collisions:0 txqueuelen:100

    RX bytes:0 (0.0 b) TX bytes:3990 (3.8 KB)

    Cek interfaces adalah untuk memastikan telah terbentuknya device tap0 dengan IP Virtual setelah mengaktifkan OpenVPN.

    Menjalankan client VPN

    # /etc/init.d/openvpn start

    Starting virtual private network daemon: client(OK).

    Memeriksa interfaces client VPN

    root@dikmansn-desktop:/home/dikmansn# ifconfig

    eth1 Link encap:Ethernet HWaddr 00:19:5B:0A:BF:BA

    inet addr:192.168.17.18 Bcast:192.168.17.255

    Mask:255.255.255.0

    inet6 addr: fe80::219:5bff:fe0a:bfba/64 Scope:Link

    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

    RX packets:203702 errors:0 dropped:0 overruns:0 frame:0

    TX packets:541780 errors:0 dropped:0 overruns:0

    carrier:0

    collisions:0 txqueuelen:1000

    RX bytes:13625036 (12.9 MB) TX bytes:817514671 (779.6

    MB)

    Interrupt:20 Base address:0xac00

    lo Link encap:Local Loopback

    inet addr:127.0.0.1 Mask:255.0.0.0

    inet6 addr: ::1/128 Scope:Host

    UP LOOPBACK RUNNING MTU:16436 Metric:1

    RX packets:9260 errors:0 dropped:0 overruns:0 frame:0

    TX packets:9260 errors:0 dropped:0 overruns:0 carrier:0

    collisions:0 txqueuelen:0

    RX bytes:7193603 (6.8 MB) TX bytes:7193603 (6.8 MB)

    tap0 Link encap:Ethernet HWaddr 00:FF:1F:C8:DE:35

    inet addr:10.8.0.2 Bcast:10.8.0.255 Mask:255.255.255.0

    inet6 addr: fe80::2ff:1fff:fec8:de35/64 Scope:Link

    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

    RX packets:9 errors:0 dropped:0 overruns:0 frame:0

    TX packets:72 errors:0 dropped:0 overruns:0 carrier:0

    collisions:0 txqueuelen:100

    RX bytes:1691 (1.6 KB) TX bytes:10347 (10.1 KB)

    Cek interfaces adalah untuk memastikan telah terbentuknya device tap0 dengan IP Virtual setelah mengaktifkan OpenVPN.

    Log server OpenVPN:

    root@dikmansn-laptop:/etc/openvpn# openvpn –config /etc/openvpn/server.conf

    Mon Jun 23 10:10:23 2008 OpenVPN 2.0.9 i686-pc-linux [SSL] [LZO] [EPOLL] built on May 24 2008

    Mon Jun 23 10:10:23 2008 Diffie-Hellman initialized with 1024 bit key

    Mon Jun 23 10:10:23 2008 TLS-Auth MTU parms [ L:1590 D:138 EF:38 EB:0 ET:0 EL:0 ]

    Mon Jun 23 10:10:23 2008 TUN/TAP device tap0 opened

    Mon Jun 23 10:10:23 2008 /sbin/ifconfig tap0 10.8.0.1 netmask 255.255.255.0 mtu 1500 broadcast 10.8.0.255

    Mon Jun 23 10:10:23 2008 Data Channel MTU parms [ L:1590 D:1450 EF:58 EB:135 ET:32 EL:0 AF:3/1 ]

    Mon Jun 23 10:10:23 2008 UDPv4 link local (bound): [undef]:5000

    Mon Jun 23 10:10:23 2008 UDPv4 link remote: [undef]

    Mon Jun 23 10:10:23 2008 MULTI: multi_init called, r=256 v=256

    Mon Jun 23 10:10:23 2008 IFCONFIG POOL: base=10.8.0.2 size=10

    Mon Jun 23 10:10:23 2008 Initialization Sequence Completed

    Mon Jun 23 10:10:32 2008 MULTI: multi_create_instance called

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 Re-using SSL/TLS context

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 LZO compression initialized

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 Control Channel MTU parms [ L:1590 D:138 EF:38 EB:0 ET:0 EL:0 ]

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 Data Channel MTU parms [ L:1590 D:1450 EF:58 EB:135 ET:32 EL:0 AF:3/1 ]

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 Local Options hash (VER=V4): ’26e19fc0′

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 Expected Remote Options hash (VER=V4): ‘b498be7c’

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 TLS: Initial packet from 192.168.17.18:32773, sid=17696634 32d0c640

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 VERIFY OK: depth=1, /C=ID/ST=JT/L=Surabaya/O=UBAYA/OU=Elektro/CN=Server/emailAddress=die_xy@yahoo.co.id

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 VERIFY OK: depth=0, /C=ID/ST=JT/O=UBAYA/OU=Elektro/CN=client1/emailAddress=die_xy@yahoo.co.id

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 Data Channel Encrypt: Cipher ‘AES-128-CBC’ initialized with 128 bit key

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 Data Channel Encrypt: Using 160 bit message hash ‘SHA1′ for HMAC authentication

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 Data Channel Decrypt: Cipher ‘AES-128-CBC’ initialized with 128 bit key

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 Data Channel Decrypt: Using 160 bit message hash ‘SHA1′ for HMAC authentication

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA

    Mon Jun 23 10:10:32 2008 192.168.17.18:32773 [client1] Peer Connection Initiated with 192.168.17.18:32773

    Mon Jun 23 10:10:34 2008 client1/192.168.17.18:32773 PUSH: Received control message: ‘PUSH_REQUEST’

    Mon Jun 23 10:10:34 2008 client1/192.168.17.18:32773 SENT CONTROL [client1]: ‘PUSH_REPLY,ping 10,ping-restart 120,ifconfig 10.8.0.2 255.255.255.0′ (status=1)

    Mon Jun 23 10:10:34 2008 client1/192.168.17.18:32773 MULTI: Learn: 00:ff:7a:f9:9e:05 -> client1/192.168.17.18:32773

    Dari hasil log server didapat bahwa server VPN telah me-remote client VPN dengan mem-verify client yang mempunyai key dan sertifikat yang sesuai dengan key dan sertifikat dari server. Sehingga client VPN 192.168.17.18 mendapatkan IP Virtual dengan alamat IP 10.8.0.2

    Log dari client OpenVPN:

    root@dikmansn-desktop:/etc/openvpn# openvpn –config /etc/openvpn/client.conf

    Sat Jun 21 23:00:47 2008 OpenVPN 2.0.9 i486-pc-linux-gnu [SSL] [LZO] [EPOLL] built on May 21 2007

    Sat Jun 21 23:00:47 2008 LZO compression initialized

    Sat Jun 21 23:00:47 2008 Control Channel MTU parms [ L:1590 D:138 EF:38 EB:0 ET:0 EL:0 ]

    Sat Jun 21 23:00:47 2008 TUN/TAP device tap1 opened

    Sat Jun 21 23:00:47 2008 Data Channel MTU parms [ L:1590 D:1450 EF:58 EB:135 ET:32 EL:0 AF:3/1 ]

    Sat Jun 21 23:00:47 2008 Local Options hash (VER=V4): ‘b498be7c’

    Sat Jun 21 23:00:47 2008 Expected Remote Options hash (VER=V4): ’26e19fc0′

    Sat Jun 21 23:00:47 2008 UDPv4 link local: [undef]

    Sat Jun 21 23:00:47 2008 UDPv4 link remote: 192.168.17.17:5000

    Sat Jun 21 23:00:47 2008 TLS: Initial packet from 192.168.17.17:5000, sid=2d9a3293 e4cd7b3b

    Sat Jun 21 23:00:47 2008 VERIFY OK: depth=1, /C=ID/ST=JT/L=Surabaya/O=UBAYA/OU=Elektro/CN=Server/emailAddress=die_xy@yahoo.co.id

    Sat Jun 21 23:00:47 2008 VERIFY OK: nsCertType=SERVER

    Sat Jun 21 23:00:47 2008 VERIFY OK: depth=0, /C=ID/ST=JT/O=UBAYA/OU=Elektro/CN=Server/emailAddress=die_xy@yahoo.co.id

    Sat Jun 21 23:00:48 2008 Data Channel Encrypt: Cipher ‘AES-128-CBC’ initialized with 128 bit key

    Sat Jun 21 23:00:48 2008 Data Channel Encrypt: Using 160 bit message hash ‘SHA1′ for HMAC authentication

    Sat Jun 21 23:00:48 2008 Data Channel Decrypt: Cipher ‘AES-128-CBC’ initialized with 128 bit key

    Sat Jun 21 23:00:48 2008 Data Channel Decrypt: Using 160 bit message hash ‘SHA1′ for HMAC authentication

    Sat Jun 21 23:00:48 2008 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA

    Sat Jun 21 23:00:48 2008 [Server] Peer Connection Initiated with 192.168.17.17:5000

    Sat Jun 21 23:00:49 2008 Initialization Sequence Completed

    Dari hasil log client didapatkan bahwa client telah mendapatkan persetujuan dari server VPN. Sehingga jaringan VPN antara server dan client terbentuk.

    • Menguji konektivitas jaringan server VPN (10.8.0.1) dengan client VPN (10.8.0.2) dengan menggunakan perintah ping dari komputer server ke client dan sebaliknya:

    root@dikmansn-laptop:/etc/openvpn# ping 10.8.0.2

    PING 10.8.0.2 (10.8.0.2) 56(84) bytes of data.

    64 bytes from 10.8.0.2: icmp_seq=1 ttl=64 time=0.587 ms

    64 bytes from 10.8.0.2: icmp_seq=2 ttl=64 time=0.524 ms

    64 bytes from 10.8.0.2: icmp_seq=3 ttl=64 time=0.647 ms

    64 bytes from 10.8.0.2: icmp_seq=4 ttl=64 time=0.826 ms

    64 bytes from 10.8.0.2: icmp_seq=5 ttl=64 time=0.528 ms

    64 bytes from 10.8.0.2: icmp_seq=6 ttl=64 time=0.646 ms

    64 bytes from 10.8.0.2: icmp_seq=7 ttl=64 time=0.841 ms

    64 bytes from 10.8.0.2: icmp_seq=8 ttl=64 time=0.535 ms

    64 bytes from 10.8.0.2: icmp_seq=9 ttl=64 time=0.634 ms

    64 bytes from 10.8.0.2: icmp_seq=10 ttl=64 time=0.523 ms

    64 bytes from 10.8.0.2: icmp_seq=11 ttl=64 time=0.528 ms

    — 10.8.0.2 ping statistics —

    11 packets transmitted, 11 received, 0% packet loss, time 10000ms

    rtt min/avg/max/mdev = 0.523/0.619/0.841/0.116 ms


    root@dikmansn-desktop:/etc/openvpn# ping 10.8.0.1

    PING 10.8.0.1 (10.8.0.1) 56(84) bytes of data.

    64 bytes from 10.8.0.1: icmp_seq=1 ttl=64 time=0.891 ms

    64 bytes from 10.8.0.1: icmp_seq=2 ttl=64 time=0.859 ms

    64 bytes from 10.8.0.1: icmp_seq=3 ttl=64 time=0.710 ms

    64 bytes from 10.8.0.1: icmp_seq=4 ttl=64 time=0.847 ms

    64 bytes from 10.8.0.1: icmp_seq=5 ttl=64 time=0.703 ms

    64 bytes from 10.8.0.1: icmp_seq=6 ttl=64 time=0.850 ms

    64 bytes from 10.8.0.1: icmp_seq=7 ttl=64 time=0.719 ms

    64 bytes from 10.8.0.1: icmp_seq=8 ttl=64 time=1.10 ms

    64 bytes from 10.8.0.1: icmp_seq=9 ttl=64 time=0.723 ms

    64 bytes from 10.8.0.1: icmp_seq=10 ttl=64 time=0.892 ms

    64 bytes from 10.8.0.1: icmp_seq=11 ttl=64 time=0.887 ms

    64 bytes from 10.8.0.1: icmp_seq=12 ttl=64 time=0.882 ms

    — 10.8.0.1 ping statistics —

    12 packets transmitted, 12 received, 0% packet loss, time 11001ms

    rtt min/avg/max/mdev = 0.703/0.839/1.108/0.112 ms

     
    • panjul 2:58 am on 28 May 2011 Permalink | Reply

      maaf mas
      Saya mau tanya,,,
      ketika saya koneksiin openvpn client ke server koneksi tidak ada error..dan bisa ping

      1. namun yang saya bggung ketika saya konek ke openvpn server tidak ada athentifikasi username dan password dr client??padahal saya sudah buat.
      2. ketika saya buka ftp server dr server openvpn username dan password ftp saya di ketahui dan tidak ter enkripsi???(saya lacak menggunakan wiresharke)

      mohon bantuannya…
      terima kasih..

      • dikmansn 10:33 pm on 29 June 2011 Permalink | Reply

        Mohon maaf, mas.. saya tidak dapat menjawab pertanyaannya… saya sudah tidak menggeluti bidang tersebut lagi… silahkan bertanya ke yang lebih kompeten… saya sarankan ke pak onno… Terima kasih…

  • dikmansn 5:11 pm on 7 February 2010 Permalink | Reply
    Tags: , Server,   

    Instalasi dan Konfigurasi Server OpenVPN di GNU/Linux Ubuntu 

    Langkah-langkah untuk instalasi dan konfigurasi OpenVPN di komputer server adalah sebagai berikut:
    Untuk menginstal server VPN dengan OpenVPN dibutuhkan beberapa paket-paket ekstra pendukung diantaranya: liblzo1, liblzo-dev, libssl-dev, vtun dan opnnssl.

    # apt-get install liblzo1 liblzo-dev libssl-dev vtun and openssl

    Download OpenVPN dari source code di alamat http://openvpn.net/.  Pada tulisan ini dibuat menggunakan OpenVPN versi 2.0.9. Salin hasil download ke folder /usr/local/src

    # cp openvpn-2.0.9.tar.gz /usr/local/src/

    Buka dan ekstrak file source code

    # cd /usr/local/src

    1. tar zxvf openvpn-2.0.9.tar.gz
  • Kompilasi dan instalasi OpenVPN

    # cd /usr/local/src/openvpn-2.0.9

    1. ./configure
    2. make
    3. make install

    Menggunakan Menuconfig untuk mengaktifkan TUN/TAP Support

    # cd /usr/src/linux-headers 2.6.22-14-generic

    1. make menuconfig
    • Pilih Device Drivers dan tekan Enter
    • Pilih Network device support dan tekan Enter,
    • Pada pilihan Network Device Support aktifkan Universal TUN/TAP device driver support dengan menggunakan spacebar dengan memberikan pilihan module. Dimana pemilihan ke mode module akan mengakibatkan TUN/TAP hanya akan bekerja apabila dibutuhkan

    Konfigurasi Server OpenVPN

    Mempersiapkan key pada OpenVPN dapat dilakukan dengan bantuan tools easy-rsa, dimana tools tersebut terdapat di /usr/share/doc/openvpn/examples. Salin tools tersebut ke direktori /etc/openvpn/

    # cp –Rf /usr/share/doc/openvpn/examples/easy-rsa/* /etc/openvpn/

    Edit file vars di /etc/openvpn

    # mcedit /etc/openvpn/vars

    Tambahkan parameter berikut:

    export D=”/etc/openvpn”

    export KEY_CONFIG=”$D/openssl.cnf”

    export KEY_DIR=$D/keys

    export KEY_SIZE=1024

    export KEY_COUNTRY=ID

    export KEY_PROVINCE=JT

    export KEY_CITY=Surabaya

    export KEY_ORG=”UBAYA”

    export KEY_EMAIL=die_xy@yahoo.co.id

    Keterangan:

    • export D=”/etc/openvpn” adalah direktori utama yang digunakan oleh semua file konfigurasi server VPN ditentukan berada pada /etc/openvpn.
    • export KEY_CONFIG=”$D/openssl.cnf ” adalah file yang akan digunakan sebagai pembuat kunci sertifikat keamanan pada server dan client yaitu openssl.cnf dan file tersebut ditentukan berada pada direktori /etc/openvpn.
    • export KEY_DIR=”$D/keys” adalah semua file yang berupa sertifikat atau kunci keamanan yang dibuat oleh openssl.cnf yaitu ca.crt, ca.key, server.crt, server.c.r, server.key, client1.crt, client1.csr, client1.key, dh1024.pem diletakkan pada folder keys dalam /etc/openvpn.
    • export KEY_SIZE=1024 adalah panjang kunci keamanan pada server yang dibuat sebesar 1024 bit dan maksimum adalah 2048 bit. (semakin besar jumlah bit untuk kunci dibuat, maka semakin lama waktu yang dibutuhkan untuk memproses pembuatan kunci tersebut). Panjang kunci tersebut akan digunakan untuk membuat Diffie-Hellman key atau yang dikenal dengan dhxxxx.pem (xxxx = panjang kunci)
    • export KEY_COUNTRY=”ID” adalah identitas client berada atau berasal dari negara mana. Dituliskan inisial ”ID” adalah Indonesia.
    • export KEY_PROVINCE=”JT adalah identitas client berada atau berasal dari popinsi mana. Dituliskan inisial ” JT ” adalah Jawa Timur.
    • export KEY_CITY=”Surabaya adalah identitas client berada atau berasal dari kota mana. Dituliskan ” Surabaya”.
    • export KEY_ORG=”UBAYA” adalah identitas client berada atau berasal dari organisasi mana. Dituliskan ”UBAYA”.
    • export KEY_EMAIL=”die_xy@yahoo.co.id” adalah identitas client berupa email.

    Pembuatan Certificate Authority (CA)

    # cd /etc/openvpn/

    # . ./vars

    # ./clean-all

    # ./build-ca

    Generating a 1024 bit RSA private key

    ..++++++

    …..++++++

    writing new private key to ‘ca.key’

    —–

    You are about to be asked to enter information that will be

    Incorporated into your certificate request.

    What you are about to enter is what is called a Distinguished

    Name or a DN.

    There are quite a few fields but you can leave some blank

    For some fields there will be a default value,

    If you enter ‘.’, the field will be left blank.

    —–

    Country Name (2 letter code) [ID]:

    State or Province Name (full name) [JT]:

    Locality Name (eg, city) [Surabaya]:

    Organization Name (eg, company) [UBAYA]:

    Organizational Unit Name (eg, section) []:Elektro

    Common Name (eg, your name or your server’s hostname)[]:Server

    Email Address [die_xy@yahoo.co.id]:

    Pembuatan Diffie-Hellman Key

    # ./build-dh

    Generating DH parameters, 1024 bit long safe prime, generator 2

    This is going to take a long time

    ……………………………………………..+…………….++*++*++*

    Pembuatan Certificate dan Key untuk server OpenVPN

    # cd /etc/openvpn/

    # ./build-key-server server

    Generating a 1024 bit RSA private key

    ……………………………………++++++

    ……++++++

    writing new private key to ‘server.key’

    —–

    You are about to be asked to enter information that will be incorporated into your certificate request.

    What you are about to enter is what is called a Distinguished Name or a DN.

    There are quite a few fields but you can leave some blank

    For some fields there will be a default value,

    If you enter ‘.’, the field will be left blank.

    —–

    Country Name (2 letter code) [ID]:

    State or Province Name (full name) [JT]:

    Locality Name (eg, city) [Surabaya]:

    Organization Name (eg, company) [UBAYA]:

    Organizational Unit Name (eg, section) []:Elektro

    Common Name (eg, your name or your server’s hostname) []:Server

    Email Address [die_xy@yahoo.co.id]:

    Please enter the following ‘extra’ attributes

    to be sent with your certificate request

    A challenge password []:1234

    An optional company name []:Ubaya

    Using configuration from /etc/openvpn/openssl.cnf

    Check that the request matches the signature

    Signature ok

    The Subject’s Distinguished Name is as follows

    countryName : PRINTABLE:’ID’

    stateOrProvinceName : PRINTABLE:’JT’

    localityName : PRINTABLE:’Surabaya’

    organizationName : PRINTABLE:’UBAYA’

    organizationalUnitName: PRINTABLE:’Elektro’

    commonName : PRINTABLE:’Server’

    emailAddress :IA5STRING:’die_xy@yahoo.co.id’

    Certificate is to be certified until May 21 21:27:40 2018 GM

    (3650 days)

    Sign the certificate? [y/n]:y

    1 out of 1 certificate requests certified, commit? [y/n]y

    Write out database with 1 new entries

    Data Base Updated

    Pembuatan Certificate dan Key untuk client OpenVPN

    # cd /etc/openvpn/

    # ./build-key client1

    Generating a 1024 bit RSA private key

    ……………++++++

    ………..++++++

    writing new private key to ‘client1.key’

    —–

    You are about to be asked to enter information that will be

    incorporated into your certificate request.

    What you are about to enter is what is called a Distinguished

    Name

    or a DN.

    There are quite a few fields but you can leave some blank

    For some fields there will be a default value,

    If you enter ‘.’, the field will be left blank.

    —–

    Country Name (2 letter code) [ID]:

    State or Province Name (full name) [JT]:

    Locality Name (eg, city) [Surabaya]:

    Organization Name (eg, company) [UBAYA]:

    Organizational Unit Name (eg, section) []:Elektro

    Common Name (eg, your name or your server’s hostname) []:Server

    Email Address [die_xy@yahoo.co.id]:

    Please enter the following ‘extra’ attributes

    to be sent with your certificate request

    A challenge password []:1234

    An optional company name []:Ubaya

    Using configuration from /etc/openvpn/openssl.cnf

    Check that the request matches the signature

    Signature ok

    The Subject’s Distinguished Name is as follows

    countryName : PRINTABLE:’ID’

    stateOrProvinceName : PRINTABLE:’JT’

    localityName : PRINTABLE:’Surabaya’

    organizationName : PRINTABLE:’UBAYA’

    organizationalUnitName: PRINTABLE:’Elektro’

    commonName : PRINTABLE:’client1′

    emailAddress :IA5STRING:’die_xy@yahoo.co.id’

    Certificate is to be certified until May 21 21:30:53 2018 GMT

    (3650 days)

    Sign the certificate? [y/n]:y

    1 out of 1 certificate requests certified, commit? [y/n]y

    Write out database with 1 new entries

    Data Base Updated

    Pembuatan certificate dan key untuk client2 dan client3 pada server OpenVPN menggunakan cara yang sama dengan pembuatan certificate dan key untuk client1, hanya saja untuk commonName-nya harus menggunakan nama yang berbeda antar client.

    Pemindahan Keys dan Certificate untuk Server dan Client OpenVPN

    Setelah membuat key dan certificate, diperoleh key dan certificate yang disimpan di direktori “keys”. Pindahkan key dan certificate tersebut pada direktori /etc/openvpn. Untuk lebih jelasnya dapat dilihat tabel berikut ini.

    Nama File Lokasi Pemindahan Kegunaan Rahasia
    ca.crt server + client Sertifikat root CA Tidak
    ca.key Server Key root CA Ya
    Dh{n}.pem Server Parameter DH Tidak
    Server.crt Server Sertifikat server Tidak
    server.key Server Key server Ya
    client1.crt Client Sertifikat client1 Tidak
    client1.key Client Key client1 Ya
    client2.crt Client Sertifikat client2 Tidak
    client2.key Client Key client2 Ya
    client3.crt Client Sertifikat client3 Tidak
    client3.key Client Key client3 Ya

    Untuk server OpenVPN dibutuhkan file dh1024.pem, ca.* dan server.* yang akan dipindahkan ke folder /etc/openvpn dari /etc/openvpn/keys dengan cara:

    # cd /etc/openvpn/keys

    # cp dh1024.pem /etc/openvpn

    # cp ca.* /etc/openvpn

    # cp server.* /etc/openvpn

    Salin konfigurasi server.conf OpenVPN yang terdapat di folder /usr/share/doc/openvpn/examples/sample-config-files dengan cara:

    # gunzip –c /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz > /etc/openvpn/server.conf

    Edit server.conf OpenVPN menggunakan editor mc:

    # mcedit /etc/openvpn/server.conf

    mode server

    tls-server

    port 5000

    proto udp

    dev tap

    ca ca.crt

    cert server.crt

    key server.key

    dh dh1024.pem

    ifconfig 10.8.0.1 255.255.255.0

    ifconfig-pool 10.8.0.2 10.8.0.11 255.255.255.0

    keepalive 10 120

    cipher AES-128-CBC

    comp-lzo

    status openvpn-status.log

    verb 3

    Keterangan :

    • mode server dan tls-server adalah menandakan bahwa komputer ini bertindak sebagai server pada jaringan OpenVPN.
    • port 5000 adalah port yang digunakan oleh jaringan adalah port 5000 (ini bisa diubah sesuai kebutuhan).
    • proto udp adalah protokol yang digunakan dan diproteksi adalah UDP karena digunakan untuk aplikasi VoIP. Sedangkan pada protokol TCP pada komunikasi VoIP hanya digunakan sebagai proses signaling saja jadi tidak perlu diproteksi secara khusus. Oleh karena itu digunakan protokol UDP dan digunakan port 5000. Untuk menggunakan protokol TCP tinggal mengganti proto UDP dengan proto TCP. (Keterangan: OpenVPN ini saya implementasikan ke jaringan VoIP)
    • dev tap adalah perangkat jaringan virtual yang dibuat pada saat terjadinya koneksi secara peer-to-peer pada VPN tunnel menggunakan OpenVPN. Modul yang digunakan adalah modul interface tap dan diberikan nama tap, karena model jaringan yang digunakan adalah model jaringan Ad-Hoc sehingga tidak memerlukan fasilitas routing. Sedangkan modul interface TUN digunakan apabila jaringan menggunakan model infrastruktur karena dibutuhkan fasilitas routing yang merupakan implementasi modul interface TUN.
    • ca ca.crt adalah tempat penyimpanan file CA umum (ca.crt) pada komputer server berada pada direktori /etc/openvpn/.
    • cert server.crt adalah tempat penyimpanan file sertifikat server (server.crt) pada server berada pada direktori /etc/openvpn/
    • key server.key adalah tempat penyimpanan file Key server (server.key) pada komputer server berada pada direktori /etc/openvpn/.
    • dh dh1024.pem adalah tempat penyimpanan file alogaritma Diffie-Hellman (dh1024.pem) pada komputer server berada pada direktori /etc/openvpn/.
    • cipher AES-128-CBC adalah adalah mode enkripsi yang digunakan pada jaringan Openvpn yaitu cipher AES-128-CBC.
    • ifconfig-pool 10.8.0.2 10.8.0.11 255.255.255 adalah ip pool atau range ip yang disediakan oleh server OpenVPN yaitu mulai 10.8.0.2 sampai 10.8.0.11 dengan subnet 255.255.255.0
    • keepalive 10 120 adalah memeriksa koneksi dengan cara mengirimkan data (seperti perintah ping) dengan durasi setiap 10 detik dan apabila server OpenVPN tidak merespon selama 120 detik dinyatakan client down (mati).
    • comp-lzo adalah metode kompresi data pada tunnel yang digunakan yaitu LZO ( Lempel Ziv Oberhumer). LZO sudah ter-install secara otomatis pada saat meng-install software OpenVPN.
    • status openvpn-status.log adalah file tempat menyimpan semua log hasil koneksi dari client ke server OpenVPN.
    • verb 3 adalah jenis tampilan log yang akan digunakan pada saat koneksi.
 
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel
Follow

Get every new post delivered to your Inbox.