Home  >  Article  >  Operation and Maintenance  >  What is the method for the windows linux subsystem to provide services to the outside world?

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

王林
王林forward
2023-05-15 08:46:05881browse

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子系统的名称

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

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!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete