NDC & PKI

[Day 5] 3. OpenVPN Setup

D
DITISS Admin
••4 min read

For this lab: we require two machines: Windows and Debian Keep the both machines in NAT

Steps to Configure VPN:

On Debian (Linux) Machine:

  1. Install OpenVPN: Open a terminal and install OpenVPN:

    bash
    sudo apt-get install openvpn
    
  2. Create the

    server.conf
    Configuration File:

    • Create a file named

      server.conf
      in your home directory (e.g.,
      /home/user/
      ).

    • Add the following content to the file:

      plaintext
      proto udp
      port 1194
      dev tun
      auth none
      cipher none
      ifconfig 10.8.0.1 10.8.0.2
      verb 3
      
    • Explanation of settings:

      • proto udp
        : Sets the protocol to UDP.
      • port 1194
        : OpenVPN default port.
      • dev tun
        : TUN device (used for routing packets).
      • auth none
        : No authentication.
      • cipher none
        : No encryption.
      • ifconfig 10.8.0.1 10.8.0.2
        : Assigns IP addresses.
      • verb 3
        : Sets the verbosity level to 3 (detailed logging).
  3. Start the OpenVPN Server: Start OpenVPN using the

    server.conf
    file:

    bash
    sudo openvpn --config server.conf
    

On Windows Machine (VM):

  1. Install OpenVPN:

    • Install OpenVPN on your Windows VM.
  2. Ensure Three Network Adapters:

    • Make sure you have two adapters (one Ethernet and one Bluetooth). Bluetooth might not be there.
    • When OpenVPN is installed, a new virtual network adapter should automatically be created.
    • Press
      Windows + R
      and type
      ncpa.cpl
      . You can check your adapters here.
  3. Create the

    client.conf
    Configuration File:

    • On the Windows machine, create a file (e.g.,

      client.conf
      ).

    • Add the following content:

      plaintext
      remote <vpn_ip>  # Replace <vpn_ip> with the actual IP of your VPN server (Debian machine).
      proto udp
      port 1194
      dev tun
      auth none
      cipher none
      ifconfig 10.8.0.2 10.8.0.1
      verb 3
      
    • Save the file as

      client.conf
      in a location like
      C:\Myfiles\client.conf
      .

  4. Start OpenVPN Client:

    • Go to the OpenVPN directory on the Windows machine:

      C:\Program Files (x86)\OpenVPN Technologies\OpenVPN Client\core
      
    • Run the following command in the terminal:

      bash
      openvpn --config c:\Myfiles\client.conf
      
    • Make sure to provide the correct path where you saved

      client.conf
      .

Testing the VPN Connection:

  1. Ping the VPN IPs:

    • Now, try pinging both IPs:
      • The actual IP (e.g.,
        192.168.80.128
        ).
      • The VPN IP (
        10.8.0.1
        and
        10.8.0.2
        ).

    You should be able to successfully ping both IPs, indicating that the VPN is set up and working properly.

Important Note:

  • Do not close the terminals (both the server and client sessions) while testing the connection.

Read Next

8/26/2026

[Day 5] 4. Working of VPN

### 1. **What a VPN Does:** Think of a VPN as a private, secure tunnel between your device and the internet. Instead of connecting directly to a we...

8/26/2026

[Day 5] 5. Sharing Internet Access Between VMs Using Clear OS

### **Setup Overview** We require two Virtual Machines for this lab: - **VM1 (One Adapter)**: - **Adapter**: Host-only (cannot direct...