Skip to content

Instantly share code, notes, and snippets.

@SnowyPainter
Created October 13, 2024 06:28
Show Gist options
  • Save SnowyPainter/c8efb9de7831df13c076d1b9c1d91fb0 to your computer and use it in GitHub Desktop.
Save SnowyPainter/c8efb9de7831df13c076d1b9c1d91fb0 to your computer and use it in GitHub Desktop.
#먼저 인바운드 규칙을 만드세요.
# PowerShell 스크립트
# 1. 기존 portproxy 설정 삭제
netsh interface portproxy delete v4tov4 listenport=4000 listenaddress=0.0.0.0
# 2. WSL2의 eth0 IP 주소 가져오기
$wslIP = wsl hostname -I | ForEach-Object { $_.Trim() }
# 3. 새로운 portproxy 설정 추가
netsh interface portproxy add v4tov4 listenport=4000 listenaddress=0.0.0.0 connectport=4000 connectaddress=$wslIP
# 4. UFW에서 4000번 포트 허용하고 재시작
wsl sudo ufw allow 4000
wsl sudo ufw disable
wsl sudo ufw enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment