Skip to content

Instantly share code, notes, and snippets.

View ChristianLutz's full-sized avatar

Christian ChristianLutz

  • inovel systeme AG
  • Germany
View GitHub Profile
@ChristianLutz
ChristianLutz / wsl2-network.ps1
Created September 8, 2022 12:43 — forked from xmeng1/wsl2-network.ps1
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}