OpenVPN Server on Ubuntu 16.04

Following this guide.

NOTE 1: In the part where they edit /etc/openvpn/server.conf

I edited the server directive to read:
server 192.168.155.0 255.255.255.0

then my UFW rules are

# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to ens3 (change to the interface you discovered!)
-A POSTROUTING -s 192.168.155.0/24 -o ens3 -j MASQUERADE
COMMIT
# END OPENVPN RULES

NOTE 2: In the part where UFW is enabled, before doing that I needed to:
sudo ufw allow http
sudo ufw allow http
sudo ufw allow SSH-PORT/TCP

 

NOTE 3: Need to add push "redirect-gateway def1" to server.conf. This pushes a default route to the client. The redirect-gateway directive can also direct DNS as mentioned, although that’s a different command.

yeey

This leads us to rearranging that setup for Mikrotik compatibility

 

I made a duplicate server config without mikrotik support, to create new clients I use these commands:

user@server:~$ cd ~/openvpn-ca
user@server:~/openvpn-ca$ source vars
user@server:~/openvpn-ca$ ./build-key mobile
user@server:~/openvpn-ca$ cd ~/client-configs
user@server:~/client-configs$ ./make_config2.sh mobile

One Reply to “OpenVPN Server on Ubuntu 16.04”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.