My intention is to create a VPN server.
So i created and configured an instance on AWS as a VPN server (Pfsense), then i added in the security groups the destination 0.0.0.0/0 of the VPN port (1194). It works very well.
When I connect to the VPN, my public IP address is changed to the one on the VPN.
Now my intention is to restrict access to ports 80, 443 and 22 to only the public IP address of the VPN. With other servers it works but with itself it doesn't.
Why can i restrict access to another server but I can't do with the same server?
Also I didn't see any logical explanation for this problem to occur, has anyone faced this same problem?