Dzubayyan Ahmad
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Install dan Konfigurasi OpenVPN Server di CentOS 8 / RHEL 8 ###### tags: `Tag(Tulisan Mas Dzub!)` Halo teman-teman semua, di tutorial kali ini akan menjelaskan bagaimana cara install dan konfigurasi OpenVPN di CentOS 8 / RHEL 8. Sebuah VPN (Virtual Private Network) membuat melewati jaringan / network yang tidak di kenali atau tidak di percaya keamanannya seolah teman-teman berada di dalam jaringan yang LAN yang aman. OpenVPN adalah sebuah solusi VPN dengan SSL yang mempunyai licensi opensource dan mempunyai fitur lengkap yang mendukung berbagai konfigurasi. Dengan OpenVPN, teman-teman dapat dengan mudah menggunakan jaringan yang aman meskipun sedang menggunakan koneksi public atau koneksi yang tidak di percaya keamanannya, semua aktifitas keluar masuk trafik atau lalu lintas data akan di enkripsi sehingga teman-teman akan memperpacayai informasi yang di terima dari sisi lainnya. Nah di artikel ini kita akan mengulas cara install dan konfigurasi OpenVPN di CentOS 8 / RHEL 8 ## Teknik Install OpenVPN Server di CentOS 8 / RHEL 8 Untuk menginstall OpenVPN Server di Centos 8 / RHEL 8 terdapat 2 teknik. 1. Install OpenVPN Server secara manual - akan memakan waktu yang 2. Install OpenVPN Server dengan script otomatis - lebih mudah dan lebih cepat Dan untuk di tulisan kali ini kita akan akan menggunakan script otomatis untuk menginstall dan mengkonfigurasi OpenVPN server. Dan kali ini kita akan menggunakan script [openvpn-install](https://github.com/masdzub/openvpn-install), script tersebut akan menginstall dan mengkonfigurasi VPN di server teman-teman sendiri dalam beberapa menit. script ini juga di design lebih mudah bagi teman-teman yang belum pernah menginstall OpenVPN sebelumnya. ## Install dan Konfigurasi OpenVPN Server di CentOS 8 / RHEL 8 ### 1. Menambahkan repository EPEL dan Install git Untuk langkah pertama adalah menambahkan repository EPEL di CentOS 8 / RHEL 8 ke dalam system, ini diperlukan untuk menginstall OpenVPN dan paket depensi yang di perlukan. Untuk menginstallnya bisa menggunaka link di bawah ini. [Install dan Mengaktifkan EPEL Repository di CentOS 8](https://tulisan.masdzub.com/install-dan-mengaktifkan-epel-repository-di-centos-8.aspx) Selain itu teman-teman memerlukan git untuk mengambil kode script dari github. Dan pastikan terinstall di system. Untuk menginstallnya bisa menggunakan cara di bawah ini. ``` # yum install git ``` ### 2. Mengkloning script openvpn-install dari github Dan langkah selanjutnya adalah mengkloning / mengambil script `openvpn-install` dari github menggunakan git. ``` # cd ~ # git clone https://github.com/masdzub/openvpn-install.git remote: Enumerating objects: 395, done. remote: Total 395 (delta 0), reused 0 (delta 0), pack-reused 395 Receiving objects: 100% (395/395), 120.87 KiB | 270.00 KiB/s, done. Resolving deltas: 100% (197/197), done. ``` ### 3. Menjalankan script OpenVPN-install Selanjutnya masuk ke directory `openvpn-install` dan menjalankan script installernya, kurang lebih seperti ini ``` # cd openvpn-install # chmod +x openvpn-install.sh # ./openvpn-install.sh ``` Dan teman-teman akan mendapatkan tampilan seperti ini. Dan silahkan di ikuti untuk perintahnya. ``` Welcome to this OpenVPN road warrior installer! I need to ask you a few questions before starting setup. You can use the default options and just press enter if you are ok with them. What IPv4 address should the OpenVPN server bind to? 1) 178.128.18.212 2) 10.15.0.5 3) 10.130.158.23 IPv4 address [1]: 1 Which protocol do you want for OpenVPN connections? 1) UDP (recommended) 2) TCP Protocol [1]: 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]: 1 Finally, tell me a name for the client certificate. Client name [client]: namauser Okay, that was all I needed. We are ready to set up your OpenVPN server now. Press any key to continue... ``` Untuk konfig di atas itu teman-teman mensetting : - IP Address Server di gunakan untuk VPN - Protokol OpenVPN yang digunakan - TCP atau UDP - Port OpenVPN - DNS NameServer yang digunakan untuk VPN - Membuat profile konfigurasi untuk client File Konfigurasi utama OpenVPN berada di `/etc/openvpn/server/server.conf` dan teman-teman dapat merubah konfigirasi yang ada. Untuk isi dari file tersebut kuranglebih seperti berikut ini ``` # cat /etc/openvpn/server/server.conf local 178.128.18.212 port 1194 proto udp dev tun ca ca.crt cert server.crt key server.key dh dh.pem auth SHA512 tls-crypt tc.key topology subnet server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 67.207.67.2" push "dhcp-option DNS 67.207.67.3" keepalive 10 120 cipher AES-256-CBC user nobody group nobody persist-key persist-tun status openvpn-status.log verb 3 crl-verify crl.pem explicit-exit-notify ``` Dan setelah instalasi akan muncul virtual interface yang di buat setelah proses. Dan virtual interface ini di gunakan untuk subnet client OpenVPN. Untuk virtual interfacenya bernama `tun0`, untuk melakukan pengecheckan bisa mengikuti cara ini : ``` # ip addr | grep tun0 4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 100 inet 10.8.0.1/24 brd 10.8.0.255 scope global tun0 ``` Untuk interface defaultnya menggunakan subnet 10.8.0.0/24, dan OpenVPN server akan menggunakan IP 10.8.0.1. ### 4. Membuat User profile OpenVPN (.ovpn file) Setelah itu akan akan memproses instalasi. Dan akan men-generate profil konfigurasi untuk openvpn nya. Dan untuk lokasi filenya profil konfigurasinya ada di `~/namauser.ovpn` Namun jika ingin menambah user profile OpenVPN teman-teman bisa menjalankan command seperti waktu instalasi. Dan kemudian pilih Add a new user. Kurang lebih seperti berikut ini. ``` # ./openvpn-install.sh Looks like OpenVPN is already installed. What do you want to do? 1) Add a new user 2) Revoke an existing user 3) Remove OpenVPN 4) Exit Select an option: 1 Tell me a name for the client certificate. Client name: juuub Using SSL: openssl OpenSSL 1.1.1c FIPS 28 May 2019 Generating a RSA private key ...................................+++++ .....................................................................+++++ writing new private key to '/etc/openvpn/server/easy-rsa/pki/private/juuub.key.m5xOJr8td6' ----- Using configuration from ./safessl-easyrsa.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows commonName :ASN.1 12:'juuub' Certificate is to be certified until Mar 4 16:13:25 2030 GMT (3650 days) Write out database with 1 new entries Data Base Updated Client juuub added, configuration is available at: /root/juuub.ovpn ``` Setelah menambahkan user bisa di cek di directory /root. ``` # ls /root/ | grep .ovpn juuub.ovpn masdzub.ovpn ``` Jika sudah, File `.ovpn` tersebut bisa di download dan di gunakan untuk konfigurasi vpn di laptop

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully