当前位置:网站首页>vm虛擬機中使用NAT模式特別說明
vm虛擬機中使用NAT模式特別說明
2022-06-12 08:08:00 【喜歡打籃球的普通人】
1.環境
- VM
- VM中使用ubuntu虛擬機
- 宿主機環境:win10
2.問題:vm配置了NAT,但是還是無法ping通宿主機,也無法連接外網
vm使用NAT模式需要,ubuntu靜態配置ip,靜態配置的ip配置方法:
打開VMware WorkStation的“編輯”-“虛擬網絡編輯器”:
選擇更改設置,打開VMnet8,打開DHCP設置,DHCP裏面的內容按照默認生成即可,別自己分配
然後在ubuntu中按照上述DHCP配置重新配置個靜態IP即可
這樣,然後在ubuntu中保存下配置網絡配置,即可連接外網咯

重啟網絡的方式如下:
在ubuntu中可以看到結果
3.VM使用NAT模式下實現ssh互通
本機主機:win10+vm(使用ubuntu,裏面已安裝好ssh服務)
ssh中注意修改/etc/ssh/sshd_config中如下的配置:以支持root登錄
PermitRootLogin yes
其他主機:win10
- win10查看所有端口映射
netstat -ano
- vm配置
打開 Vmware — 點擊「編輯」— 選擇「虛擬網絡編輯器」
在彈出框選擇「NAT模式」 — 點擊「更改設置」— 點擊之後可以根據自己需要修改虛擬機網關
點擊「NAT模式」— 選擇「NAT設置」
在「端口轉發」下邊選擇「添加」
添加端口,然後進行保存
4.通過映射的端口進行連接測試
端口連接測試
SSH 連接: ssh [email protected] -p 10022
登錄之後查看 ip: ip addr
- git自帶ssh的客戶端


5.主機防火牆開放端口
同時按 Win + R ,輸入 control 進入控制面板
選擇「系統和安全」
選擇「防火牆」設置
選擇左側的「高級設置」
進入防火牆的「高級設置」之後,選擇「入站規則」,然後點擊「新建規則」
選擇「端口」
選擇「TCP」— 選擇「特定本地端口」,並填寫端口(需要和前邊 Vmware 中設置的一致)


給新建的規則起名
边栏推荐
- vm虚拟机中使用NAT模式特别说明
- Cookies and sessions
- The R language converts the data of the specified data column in the dataframe data from decimal to percentage representation, and the data to percentage
- . net mysql Too many connections
- Topic 1 Single_ Cell_ analysis(3)
- Interview questions on mobile terminal, Android and IOS compatibility
- CONDA reports an error when creating a virtual environment, and the problem is solved
- How SQLite limits the total number of data in a table
- 2021.11.3-7 scientific research log
- Rnorm function of R language generates positive distribution data, calculates descriptive statistical summary information of vector data using sum function of epidisplay package, and visualizes ordere
猜你喜欢

MATLAB image processing - Otsu threshold segmentation (with code)

Pytorch installation (GPU) in Anaconda (step on pit + fill pit)

Explanation and explanation on the situation that the volume GPU util (GPU utilization) is very low and the memory ueage (memory occupation) is very high during the training of pytoch

Record the treading pit of grain Mall (I)

2、 Eight, ten and hexadecimal conversion

Search and rescue strategy of underwater robot (FISH)

Clarify the division of IPv4 addresses

离散 第一章

C # hide the keyboard input on the console (the input content is not displayed on the window)

KAtex problem of vscade: parseerror: KAtex parse error: can't use function '$' in math mode at position
随机推荐
Strvec class mobile copy
20220526 loss function
Compiling principle on computer -- functional drawing language (IV): semantic analyzer
Compiling principle on computer -- function drawing language (III): parser
Debug debugging cmake code under clion, including debugging process under ROS environment
(P36-P39)右值和右值引用、右值引用的作用以及使用、未定引用类型的推导、右值引用的传递
S-msckf/msckf-vio technical route and code details online blog summary
Vision Transformer | Arxiv 2205 - TRT-ViT 面向 TensorRT 的 Vision Transformer
Literature reading: deep neural networks for YouTube recommendations
DUF:Deep Video Super-Resolution Network Using Dynamic Upsampling Filters ...阅读笔记
visual studio2019的asp.net项目添加日志功能
2021.10.26 scientific research log
Compiling principle on computer -- functional drawing language (I)
The R language converts the data of the specified data column in the dataframe data from decimal to percentage representation, and the data to percentage
Quaternion Hanmilton and JPL conventions
How SQLite limits the total number of data in a table
C语言printf输出整型格式符简单总结
Vision Transformer | CVPR 2022 - Vision Transformer with Deformable Attention
(P27-P32)可调用对象、可调用对象包装器、可调用对象绑定器
FPGA generates 720p video clock