Skip to main content

在WSL中执行Windows10系统命令,用于端口转发,防火墙管理

Project description

WSL Management Tool

Django Kelove Setting Version Python Version

Repository

https://gitee.com/itxq/wslm.git

Installation

pip install wslm

Help

# eg:
wslm -h
wslm port -h
wslm port add -h

Base

# set encoding , PowerShell.exe PATH
wslm -e utf-8 -s PowerShell.exe
# eg:
wslm -e utf-8 -s PowerShell.exe port add -p 3306 3307 -w
wslm -e gbk -s PowerShell.exe port add -p 3306 3307 -w

Ports info

# view ports info
wslm port info

# show
Ports Info:
+---------------+------------+----------------+-------------+
| ListenAddress | ListenPort | ConnectAddress | ConnectPort |
+---------------+------------+----------------+-------------+
|    0.0.0.0    |    3306    |  172.23.60.88  |     3306    |
|    0.0.0.0    |    6379    |  172.23.60.88  |     6379    |
+---------------+------------+----------------+-------------+

NetFireWallRules Info:
+-------------------------------------+-----------+--------+---------+
|             DisplayName             | Direction | Action | Enabled |
+-------------------------------------+-----------+--------+---------+
| WSL 2 Firewall Unlock Outbound 3306 |  Outbound | Allow  |   True  |
|  WSL 2 Firewall Unlock Inbound 3306 |  Inbound  | Allow  |   True  |
| WSL 2 Firewall Unlock Outbound 6379 |  Outbound | Allow  |   True  |
|  WSL 2 Firewall Unlock Inbound 6379 |  Inbound  | Allow  |   True  |
+-------------------------------------+-----------+--------+---------+

Add Ports

# add ports
wslm port add -p 3306 3307
# add ports with firewall
wslm port add -p 3306 3307 -w
# add ports with firewall Inbound
wslm port add -p 3306 3307 -w Inbound
# add ports with firewall Outbound
wslm port add -p 3306 3307 -w Outbound

Delete Ports

# del ports
wslm port del -p 3306 3307
# del ports with firewall
wslm port del -p 3306 3307 -w
# del ports with firewall Inbound
wslm port del -p 3306 3307 -w Inbound
# del ports with firewall Outbound
wslm port del -p 3306 3307 -w Outbound

Reset Ports

# reset ports
wslm port reset
# reset ports with firewall
wslm port reset -w

WSL2 info

# view wsl info
wslm wsl info

# show
WSL2 Info:
+-------------+---------------+---------------+--------------------+
|     name    |     state     |    version    |     is_default     |
+-------------+---------------+---------------+--------------------+
|    Ubuntu   |    Running    |       2       |        True        |
|     WLE     |    Stopped    |       2       |       False        |
+-------------+---------------+---------------+--------------------+

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wslm-1.0.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file wslm-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: wslm-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.7.10 Linux/5.11.0-051100-generic

File hashes

Hashes for wslm-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 28d09ccca6b0ee4a47a5c1addaec1c53597824aad88dad6af0311fe96cada8f9
MD5 53eeb769c9f768d9609bb4f33b848f2a
BLAKE2b-256 1954afd2a922207c320593015e9a7ab4ca9fd36fd3eb923ef1255eabe5af34bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page