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:
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)?