Combuster wrote:
I'd allow the 192.168.16.0/24 to be a configurable subnet, and possibly defer automatically to something else if the host's subnet overlaps with the guest subnet.
Possibly a good start is to see if the host has a 192.168.x.x address and provide 10.0.x.x/24 to the client if it does, and provide 192.168.x.x/24 to the guest in other cases. In addition, you can try and forward any connection attempts to the gateway's IP to 127.0.0.1.
By "configurable subnet" do you mean you want to have the possibility to change which subnet the NAT should use as the internal IP range?
Hmm the idea of mapping the gateway's IP to the host IP might be better than the Class E solution.
I will probably write the actual implementation of the NAT as a separate library with a trivial API (init, send, receive, shutdown), and in the end attach it to Bochs as a new "ethmod".