SSH连接 NAT型 VirtualBox + LINUX

1、首先登录到虚拟机中的Linux系统,查看一下使用NAT网卡的IP地址。
2、关闭虚拟机。
3、依次点击 “设置 -> 网络 -> (网络地址转换)端口转发”,其中需要添加对应的 端口 转发/forward 规则/rule。

其中,子系统IP就是虚拟机中Linux对应 NAT网卡 的 IP地址。

主机IP 主机端口 子系统IP 子系统端口
127.0.0.1 2222 10.0.3.15 22

A virtual machine with NAT enabled acts much like a real computer that connects to the Internet through a router. The "router", in this case, is the VirtualBox networking engine, which maps traffic from and to the virtual machine transparently. In VirtualBox this router is placed between each virtual machine and the host. This separation maximizes security since by default virtual machines cannot talk to each other.

一个支持 NAT型网络的 虚拟机器或虚拟网络 很像一个 通过 router 连接 Internet 的 实体机器。在这里, 这个 router, 就是 VirtualBox的 网络引擎 。。。。


参考:

注:NAT-Network Address Translation

1、VirtualBox 使用 NAT 方式网络的 SSH 连接
2、How to ssh into a guest using NAT?
3、6.3. Network Address Translation (NAT)

原文地址:https://www.cnblogs.com/xuanyuanchen/p/6124436.html