OVPN Client (Linux Server): Difference between revisions

From AbahDoku Wiki
No edit summary
No edit summary
Line 36: Line 36:
  dev tun
  dev tun
  proto tcp
  proto tcp
  remote example.com 1194
  remote <host/domain> 1194 --> untuk experiment ini penulis menggunakan host example.my
  resolv-retry infinite
  resolv-retry infinite
  nobind
  nobind
  persist-key
  persist-key
  persist-tun
  persist-tun
  ca ca.crt
  ca CA.crt
  cert client.crt
  cert client.crt
  key client.key
  key client.key
  remote-cert-tls server
  remote-cert-tls server
  cipher AES-128-CBC
  cipher AES-256-CBC
  auth SHA1
  auth SHA1
  auth-user-pass
  auth-user-pass
  redirect-gateway def1
  redirect-gateway def1
  verb 3
 
selain itu tambahkan host pada file /etc/hosts, misalnya seperti berikut ini :
  127.0.0.1  localhost arm-64
::1        localhost arm-64 ip6-localhost ip6-loopback
fe00::0    ip6-localnet
ff00::0    ip6-mcastprefix
ff02::1    ip6-allnodes
ff02::2    ip6-allrouters
103.82.92.217 desagugah.info.gf

Revision as of 14:20, 17 January 2024

Catatan orat-oret dulu ya ..

Login ke server via ssh.

masuk ke folder /etc/openvpn/client

cd /etc/openvpn/client

copy certificate untuk client yang akan di pasang pada armbian server linux, file tersebut antara lain : cert_export_CA.crt, cert_export_client2.crt dan cert_export_client2.key

sementara ini belum tau cara mengambil file di dalam mikrotik menggunakan command di terminal linmux. jadi penulis mendownloadnya melalui winbox aja ya .. hehe

nati kita cari tau caranya

file yang sudah di download antara lain :

cert_export_CA.crt
cert_export_client.crt
cert_export_client.key

biar lebih mudah mengcopynya ke armbian server, penulis rename aja ya, biar namanya lebih pendek, oke

kali ini penulis menduplikatnya saja dengan command berikut :

cp cert_export_CA.crt CA.crt
cp cert_export_client.crt client.crt
cp cert_export_client.key client.key

upload file tersebut di atas ke server (ketikkan password server jika di minta) :

scp CA.crt user@10.10.10.6 (ketikkan password server jika di minta)
scp client.crt user@10.10.10.6
scp client.key user@10.10.10.6

Buat file konfigurasi ovpn

nano /etc/openvpn/client/client.ovpn

isinya

client
dev tun
proto tcp
remote <host/domain> 1194 --> untuk experiment ini penulis menggunakan host example.my
resolv-retry infinite
nobind
persist-key
persist-tun
ca CA.crt
cert client.crt
key client.key
remote-cert-tls server
cipher AES-256-CBC
auth SHA1
auth-user-pass
redirect-gateway def1

selain itu tambahkan host pada file /etc/hosts, misalnya seperti berikut ini :

127.0.0.1   localhost arm-64
::1         localhost arm-64 ip6-localhost ip6-loopback
fe00::0     ip6-localnet
ff00::0     ip6-mcastprefix
ff02::1     ip6-allnodes
ff02::2     ip6-allrouters
103.82.92.217 desagugah.info.gf