I have currently configured my Ubuntu system to connect to an OpenVPN server on startup. This is done by placing a configuration file in the /etc/openvpn directory.

Additionally, I would like to enable a firewall to ensure all connections go through the VPN. To this end, I have added this line to my OpenVPN configuration:

route-up /etc/openvpn/firewall-enable

Which points to a bash script with the following contents:

ufw enable

However, upon a system reboot, the VPN connection is made successfully, but ufw status reports that the firewall is still inactive.

Edit: stderr output from ufw enable command: https://pastebin.com/UYdh6iHq.

  • First, what is the contents of your script ? If all it has is ufw enable why not call ufw enable directly ? And if ufw is not running the error message is ... (fill in the blank here). Finally, what other commands are you running ? – Panther Jul 18 '17 at 18:15
  • Looking at that error message, two possibilities. 1. Is this a virtual machine ? If so, what virtualization technology ? 2. You edited your iptables rules on a windows machine ? See askubuntu.com/questions/551718/… – Panther Jul 18 '17 at 18:26
  • See also - askubuntu.com/questions/28215/… . What kernel modules are loaded ? – Panther Jul 18 '17 at 18:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.