L
L
Laggoman2021-09-03 09:01:57
virtual box
Laggoman, 2021-09-03 09:01:57

Why is the client IP not displayed when connecting to the server on VirtualBox, although it is displayed in VMware?

A little backstory. There is a game server on CentOS 7, it is launched using VMware on Windows Server 2016. It does not work very stably, although judging by the resources involved, there is enough of everything and there are no problems with the network. As an experiment, it was decided to replace VMware with VirtualBox, and then I had to face this problem.

VMware and VirtualBox are installed on Windows Server, each of them runs the same game server on CentOS 7, when connecting to the server on VMware, the IP of the connected players is displayed correctly, but on VirtualBox, instead of the player's IP, 10.0.2.2 is displayed. In each case, Nat is used, with port forwarding.

What is such a significant difference between VirtualBox and VMware networks, and is there a way to make VirtualBox correctly display the IP of everyone who connects?

PS Many hours of searching for information from Google did not lead to anything, a similar problem and solution was not found.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Ruslan Fedoseev, 2021-09-03
@martin74ua

don't use nat, use a bridge. And everything will magically be fine.

L
Laggoman, 2021-09-04
@Laggoman

I have only one IP address with the server, it is unlikely that in this case you can use a bridge

L
lega, 2014-08-02
@Pewget

Something like this:

totals = defaultdict(int)
for order in orders:
    for k in ['qty', 'total_amount', 'cost', 'profit']:
        totals[k] += getattr(order, k)

A
Artem Spiridonov, 2014-08-02
@customtema

Is it possible to iterate over properties in a loop?
I don't remember how it should be in python, but in PHP something like this:

foreach ($orders as $order)
{
  foreach ($order as $property => $value)
  {
    $totals[$property] += $value;
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question