Quantcast
Channel: Azure Networking (DNS, Traffic Manager, VPN, VNET) forum
Viewing all articles
Browse latest Browse all 6513

No default gateway address on my Azure VM at startup

$
0
0

Hi

I have strange behaviour going on where one of my VMs has no gateway address and we have to set it statically to 10.2.0.1.

I have three VMs, the first of which is a domain controller and DNS server and web server. The other two are SQL servers.
So we have DC, DNS and Web on 10.2.0.52, SQL1 on 10.2.0.53 and SQL2 on 10.2.0.54 all using the gateway of 10.2.0.1 and DNS on 10.2.0.52. All three servers are using the same DHCP server listed as 168.63.129.16.

I have start up script that we can schedule, as these are test servers, which was working great until a few weeks ago. The script also defines the DNS server that the three servers use as 10.2.0.52 then reboots the SQL servers to ensure they are all on the same network type of domain and name resolution is working as expected.

Here is part of the script that sets DNS,
"#Set the DNS Servers to be 10.2.0.52
Write-host "Setting the DNS primary server to be 10.2.0.52 on all servers..."
Write-host " "
$servers = "10.2.0.52","10.2.0.53","10.2.0.54"
foreach($server in $servers) {
Write-Host "Connect to $server..."
$nics = Get-WmiObject Win32_NetworkAdapterConfiguration -ComputerName $server -Credential $Credential -ErrorAction Inquire | Where{$_.IPEnabled -eq "TRUE"}
$newDNS = "10.2.0.52"
 
foreach($nic in $nics) {
Write-Host "`tExisting DNS Servers " $nic.DNSServerSearchOrder
$x = $nic.SetDNSServerSearchOrder($newDNS)
 
if($x.ReturnValue -eq 0) {
Write-Host "`tSuccessfully Changed DNS Servers on " $server
} else {
Write-Host "`tFailed to Change DNS Servers on " $server"

When we start the servers now, before we can connect to the DC, DNS and Web server on 10.2.0.52, we have to RDP to it from SQL1 and then set the gateway to 10.2.0.1. The it starts responding to the outside world!

Why would the server not get a default gateway address from the DHCP server?

Cheers
Alex



Viewing all articles
Browse latest Browse all 6513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>