└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # HOW TO MAKE YOUR PHONE HOST A `OpenVPN` SERVER USING TERMUX 2 | 3 | > I dont know why i'm doing this... BUT 4 | 5 | ## Step 1: Install Termux 6 | First, you need to `install Termux` from the Google Play Store or `F-Droid`. (I like to install it using `F-Droid`) 7 | 8 | ## Step 2: Install OpenVPN 9 | `OpenVPN` is a popular VPN protocol that is highly secure and easy to set up. You can install it on Termux by running the following commands: 10 | ``` 11 | pkg update 12 | pkg install openvpn 13 | ``` 14 | Very simple :P 15 | 16 | ## Step 3: Generate Certificates and Keys 17 | OpenVPN requires a set of `certificates and keys` to function. 18 | 19 | You can generate these using the `easy-rsa` package. Install it and then use it to generate your keys: 20 | ``` 21 | pkg install easy-rsa 22 | easyrsa init-pki 23 | easyrsa build-ca 24 | easyrsa gen-dh 25 | easyrsa build-server-full server nopass 26 | easyrsa build-client-full client nopass 27 | ``` 28 | This will create a set of certificates and keys in the `pki` directory under your home directory. 29 | 30 | 31 | ## Step 4: Configure OpenVPN 32 | You need to create a configuration file for OpenVPN. Create a new file named `server.conf` and add the following content: 33 | 34 | ``` 35 | port 1194 36 | proto udp 37 | dev tun 38 | ca /path/to/your/pki/ca.crt > Replace path! 39 | cert /path/to/your/pki/server.crt > Replace path! 40 | key /path/to/your/pki/server.key > Replace path! 41 | dh /path/to/your/pki/dh.pem > Replace path! 42 | server 10.8.0.0 255.255.255.0 43 | ifconfig-pool-persist ipp.txt 44 | push "redirect-gateway def1 bypass-dhcp" 45 | push "dhcp-option DNS 208.67.222.222" 46 | push "dhcp-option DNS 208.67.220.220" 47 | keepalive 10 120 48 | cipher AES-256-CBC 49 | user nobody 50 | group nogroup 51 | persist-key 52 | persist-tun 53 | status openvpn-status.log 54 | verb 3 55 | ``` 56 | Replace `/path/to/your/pki/` with the actual path to your `pki` directory. 57 | 58 | ## Step 5: Start OpenVPN Server 59 | Now you can start the OpenVPN server by running: 60 | ``` 61 | openvpn --config /path/to/your/server.conf 62 | ``` 63 | 64 | ## Step 7: Connect to the VPN 65 | On a differant device, use an OpenVPN client app to connect to the VPN using the `client.ovpn` file. You will need to enter the username and password you set when generating the client certificate. 66 | --------------------------------------------------------------------------------