browse
Overview
This article is intended to serve as a general overview. A list of supported options for updating Umbrella with your dynamic IP is available here
You can use any scripted method to update your IP address using the API. This article will demonstrate how PowerShell may be used.
Prerequisites
- Configure your dashboard as detailed here
- Take note of the name of your dynamic network (Deployments --> Networks )
Using PowerShell to update dynamic IP (Hard coded IP)
- Determine the current external IP address for this network. This must be done from a machine on this network.
$MyIp = Resolve-DnsName myip.opendns.com | Select -ExpandProperty IPAddress - Get the credentials: Note that these must have full admin rights to your dashboard.
$MyCredential = Get-Credential
This will open a pop up box - Enter your email address and password. We can then use these credentials to post an update using the following command:
Invoke-RestMethod -Uri "https://updates.opendns.com/nic/update?hostname=biscuit&myip=$MyIP" -Credential $MyCredential
Method to allow scripting of update to dynamic IP
This will require pre-storing the Credentials for unattended use.
Note:
This method is NOT secure and is provided as an example only. This has been tested on PowerShell 5.1 only
- First we generate an obfuscated file containing the password, this needs to only be run once. Enter the email address and password of any full admin user of the dashboard.
(Get-Credential).Password | ConvertFrom-SecureString | Out-File "C:\MyPassword.txt"
- We can then use this file in a complete script:
$UmbrellaNetwork = "your network name"
$User = "your admin email address"
$MyIp = Resolve-DnsName myip.opendns.com | Select -ExpandProperty IPAddress
$File = "C:\MyPassword.txt"
$MyCredential=New-Object -TypeName System.Management.Automation.PSCredential ` -ArgumentList $User, (Get-Content $File | ConvertTo-SecureString)
Invoke-RestMethod -Uri "https://updates.opendns.com/nic/update?hostname=$UmbrellaNetwork&myip=$MyIp" -Credential $MyCredential