VirtualBox端口转发不适用于NAT适配器

编程入门 行业动态 更新时间:2024-10-28 16:28:35
本文介绍了VirtualBox端口转发不适用于NAT适配器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用VirtualBox进行简单的端口转发,并且看来VirtualBox.exe在主机上侦听该端口,但实际上并未将连接转发给来宾.我尝试了多个端口,并多次重启了VirtualBox.另一方面,来宾与主机之间的连接很好.这是信息:

I'm trying simple port forwarding with VirtualBox and it appears VirtualBox.exe is listening on the host to the port, but not actually forwarding the connection to the guest. I've tried on multiple ports, and I've restarted VirtualBox several times. Guest to host connectivity, on the other hand, is fine. Here's the info:

Host: Win7 x64 Guest: Win7 x64 VirtualBox version: VirtualBox 4.2.10 Firewalls: All firewalls on host and guest disabled. Virtual Box > Machine Settings > Network Adapter 1: Attached to: NAT Cable Connected : True Port Forwarding: Rule 1: TCP, HostIP=127.0.0.1, HostPort=8081, GuestIP=127.0.0.1, GuestPort=8081 On Host: [VirtualBox.exe] TCP 127.0.0.1:8081 IBM-6KT5OPCF76P:0 LISTENING On Guest: I never get the connection request on port 8081 or any others I've tried.

有什么想法吗?由于多种原因,我想避免使用VirtualBox的桥接适配器.我的印象是,使用VirtualBox进行NAT端口转发相对简单.

Any ideas? I'd like to avoid using VirtualBox's bridged adapter for multiple reasons. I was under the impression that NAT port forwarding was relatively straightforward with VirtualBox.

谢谢!

推荐答案

您以错误的方式指出了来宾ip,它应该是来宾的ip(如果您为来宾静态分配了ip地址)或将其留空.请注意,您将主机ip指向127.0.0.1,这意味着您只能从端口访问要转发的端口(如果不是您想要的端口,则也应该为空).

You've pointed guest ip in wrong manner it should be ip of guest (if you're statically assign ip address to guest) or leave it empty. Note you're pointed host ip as 127.0.0.1 it means that port you're forwarding will be accessible only from port (if it isn't what you're desired it should be empty as well).

VBoxManage modifyvm "win" --natpf1 ",tcp,,8081,,8081"

也许这是您想要做的. (请在此处查看更多详细信息)

perhaps this is something you've wanted to do. (please look here for more details)

更多推荐

VirtualBox端口转发不适用于NAT适配器

本文发布于:2023-10-07 12:27:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1469386.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:适配器   端口   不适用于   VirtualBox   NAT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!