Created
July 19, 2024 12:57
-
-
Save WindyNova/ac6fd30c1fb597c3447f12db2ac843cd to your computer and use it in GitHub Desktop.
Enable Routing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Self-elevate the script if required | |
| if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) { | |
| if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) { | |
| $CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments | |
| Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine | |
| Exit | |
| } | |
| } | |
| Set-NetIPInterface -Forwarding Disabled | |
| netsh int ipv4 set interface "Z1" forwarding=enabled | |
| netsh int ipv4 set interface "Z2" forwarding=enabled | |
| netsh int ipv4 set interface "VMware Network Adapter VMnet1" forwarding=enabled | |
| # netsh int ipv4 set interface "��̫��" forwarding=enabled |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment