I have set up OpenVPN on a server. I am able to connect to OpenVPN as a client. I want to route all the client traffic from the OpenVPN server. I have read all the documentation and tried to follow it but still unsuccessful.
Here is my configuration details:
Server configs:
Code: Select all
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
Code: Select all
push "redirect-gateway def1"
Add the following line in the /etc/sysctl.conf
Code: Select all
net.ipv4.ip_forward = 1
Add the following in the firewall rules /etc/ufw/before.rules
Code: Select all
# START OPENVPN RULES
# NAT table rules
*nat
:POSTROUTING ACCEPT [0:0]
# Allow traffic from OpenVPN client to eth0 (change to the interface you discovered!)
-A POSTROUTING -s 10.8.0.0/8 -o eth0 -j MASQUERADE
COMMIT
# END OPENVPN RULES
Kindly guide me if I am missing anything. I have taken all the steps but it is not working. Thanks