preserve ip during nat forwarding

Discussions related to using VirtualBox on Linux hosts.
Post Reply
canoodler
Posts: 5
Joined: 12. Feb 2020, 13:36

preserve ip during nat forwarding

Post by canoodler »

hello,

virtualbox is great cross-os virtualization and it happens that vms are moved from windows to linux and vice versa, and it works great.

problem: does NAT preserve the original ip?

Code: Select all

==> /var/log/exim/main.log <== 
2020-06-26 19:34:48 dovecot_login authenticator failed for (User) [10.0.2.2]: 535 Incorrect authentication data (set_id=phpthumbdebug@domain.com) 
2020-06-26 19:34:48 dovecot_login authenticator failed for (User) [10.0.2.2]: 535 Incorrect authentication data (set_id=h1@domain.com) 
https://serverfault.com/questions/10230 ... -of-client

ps: the "Notify me when a reply is posted" should be enabled per default (only can be done with nasty hack X-D) https://dwaves.org/2014/12/04/phpbb-not ... r-default/
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: preserve ip during nat forwarding

Post by fth0 »

You can either use the NAT networking mode in combination with the VBoxManage modifyvm <VM-name> --nataliasmode<n> proxyonly command (see 9.8.7. Configuring Aliasing of the NAT Engine), or you can use the NAT Network networking mode.
canoodler
Posts: 5
Joined: 12. Feb 2020, 13:36

Re: preserve ip during nat forwarding

Post by canoodler »

Thanks! that worked!

1) powerdown vm

2) fire up terminal and type:

Code: Select all

VBoxManage modifyvm "vmname" --nataliasmode1 proxyonly
3) start vm again

now the proper client IPs are forwarded to the VM show up in the /var/logs ! :)

does this have any security implications?

Code: Select all

--nataliasmode<1-N> default|[log],[proxyonly],[sameports]
was not enough:

Code: Select all

VBoxManage modifyvm "vmname" --nataliasmode1 log
what does the 1 stand for?
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: preserve ip during nat forwarding

Post by fth0 »

canoodler wrote:does this have any security implications?
Nobody can guarantee that this has no security implications, because you usually cannot prove that something is secure. You can only prove that something is not insecure regarding known insecurities. That being said, I wouldn't expect forwarding the original source IP address during port forwarding to be insecure. Many port forwarding implementations do this.
canoodler wrote:what does the 1 stand for?
It's the number of the network adapter provided to the VM (e.g. 1, 2, 3, 4).
Post Reply