Answer the question
In order to leave comments, you need to log in
How can I make a mechanism that controls the external IP and prohibits access to the Internet if the external IP is not equal to the specified one?
Given:
Answer the question
In order to leave comments, you need to log in
In general, thank you all for your thoughts, you advised me exactly the approach that I planned, but did not cover the question in order to get an alternative vision.
As a result:
- raising the OVPN client + traffic routing will remain on pfSense
- wrote a script that will run in the VM and control the external IP and, if it is not the right one, block all network interfaces. The script is executed once every 1 minute.
https://gitlab.com/a.perminov/external-ip-monitor
- there is also a script that also checks if the external IP in all VMs intersects and sends notifications about problems to Discord
I think this will be enough...
The implementation of this functionality on the side of the virtual machine is potentially problematic.
You can do it in any scripting language, native to windows is powershell, plus a task scheduler.
See the link for an example:
woshub.com/get-external-ip-powershell
I didn't check it, but at first glance it looks like a working one.
You can block the network, for example, by disabling the network interface or deleting the route (but to delete the route, you need admin rights, i.e. your script must be run from a privileged account).
But I would recommend implementing this functionality on the network layer.
Please note that the regular windows license does not allow you to use the OS in a virtual machine.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question