What is the method for the windows linux subsystem to provide services to the outside world?

王林
Release: 2023-05-15 08:46:05
forward
893 people have browsed it

The default version of the windows linux subsystem is 2. Version 2 only has one NAT address when processing the network. This address can only be accessed from the windows host. If the linux subsystem wants to process other devices on the network The host provides services. There are two options as follows:

Option 1:

Change version 2 to version 1. The command is as follows (powershell):

wsl --set-version kali-linux 1
#kali-linux为linux子系统的名称
Copy after login

Option 2:

Use the netsh command to map the host port to the linux subsystem. The command is as follows:

netsh interface portproxy add v4tov4 listenport=4000 listenaddress=0.0.0.0 connectport=4000 connectaddress=192.168.101.100
Copy after login

Attachment:

The differences between wsl1 and wsl2 are as follows:

windows linux子系统对外提供服务的方法是什么

##The difference in network settings:

When using the WSL 1 distribution, if the computer is set up to be accessible from the LAN, applications running in WSL will also be accessible from the LAN.

This is not the default in WSL 2. WSL 2 has a virtualized Ethernet adapter with its own unique IP address. Currently, to enable this workflow, you need to follow the same steps as a regular virtual machine. (We're looking for ways to improve this experience.)

The above is the detailed content of What is the method for the windows linux subsystem to provide services to the outside world?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!