I would like to change the default gateway of my Solarwinds NPM Server if the default gateway is no longer reachable. My primary is 10.0.0.1 and my backup is 10.0.0.5.
Here is what I have done so far that has not been successful.
- Created a dedicated Local SW account that is a member of the Local Admin Group
- The SolarWinds Alerting Engine is running under that account
- Created a new Alert with the Trigger Action > Execute Program Action
- NETSH ROUTE
- C:\Windows\System32\cmd.exe netsh interface ip set address name="Local Area Connection" static 10.0.0.71 255.255.252.0 10.0.0.5
- POWERSHELL ROUTE - created a file with this script
- Powershell -file ChangeGateway.ps1 -Force
- Remove-NetRoute -InterfaceIndex 12 -NextHop "10.0.0.1"
- New-NetRoute -InterfaceIndex 12 -NextHop "10.0.0.5" -DestinationPrefix "0.0.0.0/0"