0

I have the following setup:

  • 1 VPS with public IP 222 running Wordpress
  • 1 VPS with public IP 444 running OpenVPN server

The login pages of the Webserver are restricted to requests from 444 using ufw to prevent any bruteforce attempts. To setup the VPN server I used the following script: https://github.com/Nyr/openvpn-install It forwards all VPN traffic to its public IP 444. So far, so good.

Now my hosting provider offers virtual networks for internal routing. The webserver has e.g. 10.0.0.2 and the VPN Server 10.0.0.4. What I want is that the VPN server routes all traffic addressed to 222 through its 10.0.0.4 interface to 10.0.0.2. All other traffic should go to the public interface 444. How do I set this up (Ubuntu 20.40)?

0

The basic setup here is to add routes On VPN server: ip route add 222 via 10.0.0.2 dev x The webserver needs to allow this traffic, and also route back.

When you have these basic routes and iptables rules figured out, you can start into applying them to the distros (Ubuntus) standard network configuration tools.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.