Open NfreerCom opened 1 year ago
58.124.221.191
192.168.35.100
1 TCP 62121:62121 192.168.35.100 80:80 2 TCP 52121:52121 192.168.35.100 443:443 3 TCP 32000:32000 192.168.35.100 22:22
systemctl start docker && k3d cluster start master-worker
k3d cluster stop master-worker && systemctl stop docker
sudo systemctl restart sshd.service
$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; }
$ports=@(80,22,443,1000,2000,3000,5000);
$addr='0.0.0.0'; $ports_a = $ports -join ",";
iex "Remove-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' ";
iex "New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Outbound -LocalPort $ports_a -Action Allow -Protocol TCP"; iex "New-NetFireWallRule -DisplayName 'WSL 2 Firewall Unlock' -Direction Inbound -LocalPort $ports_a -Action Allow -Protocol TCP";
for( $i = 0; $i -lt $ports.length; $i++ ){ $port = $ports[$i]; iex "netsh interface portproxy delete v4tov4 listenport=$port listenaddress=$addr"; iex "netsh interface portproxy add v4tov4 listenport=$port listenaddress=$addr connectport=$port connectaddress=$remoteport"; }
centos systemctl D-bus connection 에러시
wsl unregister
wsl 기본 VM 설정
wsl export
wsl import
wsl 인스턴스 다른 ip 설정 (중요:실행은 /usr/local/sbin/wsl-netns.sh 숫자)