Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement automated script for setting up WSL2 port-forwarding ports dynamically #19

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

seanohair22
Copy link
Contributor

PR Checklist

Author Mandatory (to be filled by PR Author/Submitter)

CODE MAINTAINABILITY

  • Commit Message meets guidelines as indicated in the URL*
  • Tests for the changes have been added (required for bug fixes / features). If not, state why not
  • Added labels (these are git labels such as bug or enhancement)
  • For any API changes or service changes, updates to the documentation were made (Swagger APIs & GitHub Docs). If not, state why not
    • Will come in follow on PR
  • Every commit is a single defect fix and does not mix feature addition or changes*

What are the steps to test this PR contribution?

How does a reviewer know it works?

  • Run WSL_Port_Script.ps1 script in Admin Powershell on OEM Device
  • Check status with the following:
    • netsh interface portproxy show all
    • Redirect output of Get-NetFirewallRule -Direction Inbound -Enabled True to a file then search for "Open SSH" (alternatively the rules should be at the bottom)

NOTE:
Remember to delete output of netfirewall file
Unset rules for port forwarding with the following:
- netsh interface portproxy delete v4tov4 listenport=22 listenaddress=0.0.0.0
- netsh interface portproxy delete v4tov4 listenport=2223 listenaddress=0.0.0.0
- netsh advfirewall firewall delete rule name="Open SSH port 22 for WSL2"
- netsh advfirewall firewall delete rule name="Open SSH Tunnel port 2223 for WSL2"

Are there any special instructions beyond standard workflow?

  • WSL2 required (OEM Device setup)
  • Testing requires Admin Powershell

Maintainer Mandatory (to be filled by PR Reviewer/Approving Maintainer)

QUALITY CHECKS

  • Quality of code (At least one should be checked as applicable)*
    • Commit Message meets guidelines
    • Code copyright is correct
    • PR changes adhere to industry practices and standards as well as domain or language specific anti-patterns
    • Adopted domain specific coding standards (Go Coding Standards)
    • Code is adequately commented and documented
    • Confusing logic is explained in comments
    • Error and exception code paths implemented correctly
    • Tracing output are minimized and logic
  • Test coverage shows adequate coverage with required CI functional tests pass on all supported platforms*
  • Static code scan report shows zero critical issues*

Other information

Signed-off-by: Sean O'Hair <sean.ohair@intel.com>
Signed-off-by: Sean O'Hair <sean.ohair@intel.com>
@seanohair22 seanohair22 added the enhancement New feature or request label Aug 12, 2023
@seanohair22 seanohair22 requested a review from a team as a code owner August 12, 2023 00:04
@seanohair22 seanohair22 self-assigned this Aug 12, 2023
@ejlee3
Copy link
Contributor

ejlee3 commented Aug 18, 2023

2 things:

  1. we should update the docs with the steps to use
  2. should we add a follow on script to do the cleanup?

Copy link
Contributor

@ejlee3 ejlee3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - tested on WSL2 (fresh install) and Ubuntu

@seanohair22 seanohair22 merged commit 6feb3c1 into main Aug 21, 2023
1 of 2 checks passed
@seanohair22 seanohair22 deleted the scriptify_wsl_ports branch August 21, 2023 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants