VirtualBox

16 年 前 建立

16 年 前 結束

16 年 前 更新

#3182 closed enhancement (wontfix)

NAT: VM to VM comunication and Host to VM not possible

回報者: Luiz Angelo Daros de Luca 負責人:
元件: network/NAT 版本: VirtualBox 2.1.2
關鍵字: 副本:
Guest type: other Host type: Linux

描述

Hello,

As all my VM gets IP 10.0.2.15, I imagine that I cannot access a NAT VM from another NAT VM or even Host PC. I believe that implementing a (optional) common network would help a lot.

For example, I cannot install a DC and a Win Workstation and test them together while using NAT.

更動歷史 (10)

comment:1 16 年 前Sander van Leeuwen 編輯

狀態: newclosed
處理結果: wontfix

This works as designed and the NAT limitations are documented. Use host interface networking.

comment:2 16 年 前Lars Rasmusson 編輯

This is very bad IMHO.

comment:3 16 年 前Frank Mehnert 編輯

I would suggest you to learn how NAT works. A machine behind a NAT router is never directly accessible from the outer network, and this is not different with VirtualBox.

comment:4 16 年 前Lars Rasmusson 編輯

The problem is that port forwarding doesn't work correctly.

It doesn't work for VMs on the same host, but it works as it should between VMs on different hosts.

If port 5000 on the host is forwarded the host to VM1, then the VM1 should be reachable on that port by NATed VMs. Irrespective of whether they are on the same physical host or not.

回覆:  4 comment:5 16 年 前vasily Levchenko 編輯

Replying to larsr:

The problem is that port forwarding doesn't work correctly.

It doesn't work for VMs on the same host, but it works as it should between VMs on different hosts.

If port 5000 on the host is forwarded the host to VM1, then the VM1 should be reachable on that port by NATed VMs. Irrespective of whether they are on the same physical host or not.

Let's assume VM1 and VM2 with NAT networking. Do you mean that it's impossible for co-exists two VMs with the same port-forwarding, e.g. 5000 for VM1 and 5000 for VM2? or two VM with any port-forwardings?

comment:6 16 年 前Lars Rasmusson 編輯

I mean:

On host1 there are two NATed VMs: VM1 and VM2 On host2 there is one NATed VM: VM3

host one forwards port 5000 to VM1

VM2 can't connect to host1:5000 but VM3 _can_ connect to host1:5000

回覆:  6 comment:7 16 年 前vasily Levchenko 編輯

Replying to larsr:

I mean:

On host1 there are two NATed VMs: VM1 and VM2 On host2 there is one NATed VM: VM3

host one forwards port 5000 to VM1

VM2 can't connect to host1:5000 but VM3 _can_ connect to host1:5000

Thanks for clarification. Does it make any difference if you use 10.0.2.2 or host1 IP while accessing VM1 from VM2?

comment:8 16 年 前Lars Rasmusson 編輯

Thanks for your suggestion. Something really strange happens:

When I use the IP address to telnet to the port, either 10.0.2.2 or the globally routable IP address of the host, it WORKS!

However, when I use the DNS name of the host, I get the error

Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused

See here:

vm1:~$ telnet 193.10.64.215 40022
Trying 193.10.64.215...
Connected to 193.10.64.215.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.1p1 Debian-5ubuntu1
^C
Connection closed by foreign host.
vm1:~$ host cluster5.sics.se
cluster5.sics.se has address 193.10.64.215
cluster5.sics.se mail is handled by 0 fsmsg1.sics.se.
vm1:~$ telnet cluster5.sics.se 40022
Trying 127.0.1.1...
telnet: Unable to connect to remote host: Connection refused

This must be related to Ubuntu in some way.

I was unable to replicate this bug in Windows XP. The Windows machine could connect to the VMs on the same physical host.

comment:9 16 年 前Lars Rasmusson 編輯

SOLVED. The problem was caused by an entry in /etc/hosts that aliased the DNS name to 127.0.0.1 When the entry was removed, everything worked as expected.

I will see if that entry is put there by Ubuntu during install. I suspect it is, because I don't know where it would have come from if not...

回覆:  9 comment:10 16 年 前vasily Levchenko 編輯

Replying to larsr:

SOLVED. The problem was caused by an entry in /etc/hosts that aliased the DNS name to 127.0.0.1 When the entry was removed, everything worked as expected.

I will see if that entry is put there by Ubuntu during install. I suspect it is, because I don't know where it would have come from if not...

Thanks for update.

注意: 瀏覽 TracTickets 來幫助您使用待辦事項功能

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette