I am running a vm with ip 192.168.122.69 and I want to run a server that must run from host ip 10.0.2.2. The server is running on port 8081 and I can connect to it at 192.168.122.69:8081 from the host.
The exact application is in developing a react app and sharing a react app server instance. However, I am mainly asking this as for educational purposes.. i.e. how do I make it so that connecting to 10.0.2.2:8081 is exactly the same as connecting to 192.168.122.69:8081 on the host or 127.0.0.1:8081 on the guest. I really just can not grasp how the routing, bridges, dns, whatever works so a thorough explanation would be very much appreciated.
I have done countless hours of research into this and while I'm sure I've gone over the answer several times, I haven't been able to grasp it.