[2025-12-04] WSL 내의 웹페이지 배포(같은 공유기)

본인의 경우에는 포워딩을 했는 데도 안되는 상황이었다. localhost로 안 들어가지는 상태

  1. WSL 네트워크 리셋

     wsl --shutdown          //WSL 종료
     netsh winsock reset     // PC 재부팅 -> WSL 가상 네트워크 새로 생성
    
  2. 재부팅 후 새 WSL IP 확인

     hostname -I | awk '{print $1}'
    
  3. 기존 규칙 삭제

     netsh interface portproxy reset
    
    • 확인 : 아무것도 없어야 함
     netsh interface portproxy show all
    
  4. 등록

     netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8443 connectaddress=<WSL_IP> connectport=8443
    
  5. firewall 확인

     netsh advfirewall firewall add rule name="WSL8443" dir=in action=allow protocol=TCP localport=8443
    

같은 공유기에서 접근

  1. 방화벽 LAN 접근

     netsh advfirewall firewall add rule name="WSL LAN 8443" dir=in action=allow protocol=TCP localport=8443
    
  2. 안되는 경우에는 규칙 삭제 및 등록

    • 규칙 확인

        netsh interface portproxy show all
      
    • 규칙 삭제

        netsh interface portproxy reset
      
    • 규칙 등록

        netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8443 connectaddress=<WSL_IP> connectport=8443
      

Categories:

Updated:

Leave a comment