Sharon demonstrates how to configure or modify the public, private, static and dynamic IP addresses after the virtual network has been provisioned.
- [Instructor] If you did not set the IP addressing for your virtual machines while provisioning them, you can do so after the virtual machine has been created. As you can see, I'm in the VirtualNetworks resource group. I have three VMs. I have a DC, Web1, and Web2. We're going to go ahead and configure IP addressing on the DC and Web2. Let's start off with the DC system. When we look at the overview of our DC VM, you will notice that we have a public IP. We do not have a DNS name label, and we can tell that this is the Production virtual network in the BackEnd.
We want to modify some of these settings. The first thing we want to do is remove the public IP. We do not want this machine available to the internet, and remember we're going to do this through Network interfaces. Back in the olden days of on-premise, we'd go into the network configuration properties for that system and configure it there. Do not do that on your virtual machines. We do it all through the portal or through PowerShell. I'm going to click on Network interfaces, and then click on the network interface that's associated with this virtual machine, and we can see our public IP, and we can see it's attached to virtual machine DC.
And our private IP address is an IP address from our range of that subnet. To modify these settings, click IP configurations. We could go ahead and change the subnet if we wanted to do so at this point. We could change it to the front end. I'm going to leave it in the backend. We're going to go ahead and modify the network interface, ipconfig1. You'll see here we are set to enabled. I'm going to go ahead and click Disable. I do not want this virtual machine to be able to access the internet directly.
Next, because this is a DC, I want to provide a static IP. I'm going to go ahead and click Static. At this point I could go ahead and pick an IP from our subnet, but I'm going to go ahead and leave the default. Click Save, this will take a moment. I'm going to go ahead and close this blade, and you will notice that the public IP address is now removed from that network interface, and our private IP address is now Static. I'm going to go ahead and close this blade, and I'm going to click on Overview. You will notice that our Connect option is now not available to us.
Again because this machine is no longer available on the internet. Our network interface was successfully saved. I'm going to go ahead and close this blade. Now let's take a look at Web2. This virtual machine is sitting in a production network, and it's on the FrontEnd subnet, so we want this machine to have a public IP. Right now it does not. Typically when you create a virtual machine, by default you will have a dynamic public IP address. So we need to go ahead and give this machine a public IP address, and we want it to be static.
To do so, I'm actually going to pop into the public IP Address, which happens to be named Web2-ip, and then we're going to click on Configuration. I want to go ahead and assign an IP address and a DNS name to this public IP address. I'm going to click on Configuration. I'm going to go ahead and click Static. I can set the idle timeout, and this just means, how long do you want to keep the connection open without the clients sending keep-alive messages? By default, it is four minutes, and next we can add a DNS name label.
Now be careful when you're naming this. You have to have a unique name, because you'll be sharing the same domain name space as in, in this case, eastus2cloudapp.azure.com. Let's see if that works. sharonswebserver is available, so we'll use that. Then click Save. We now have a static IP assigned to Web2 IP configuration. I'm going to go ahead and close this. Next, let's take a look at the network interface to ensure that that IP address is on that interface. It can take a couple of minutes. I'm going to go ahead and click on IP configurations, and then our Primary, and we can see the public IP address has not come up yet, and that is because we need to enable it in the network interface as well.
Now we have to assign that IP address to it. As you recall, it was Web2-ip. Click Save. If your public IP address had been enabled by default, you wouldn't have to come back in and do this step. What you see on your screen may or may not look the same as what I'm looking at. Just keep that in mind. I'm going to go ahead, click Close, and you'll notice now, we have our public IP address now available within that network interface. To recap those steps to set a public static IP, you have to turn it on in the public IP address interface.
Clicking Configuration ensured that it is static. If it's not associated with your network interface, you'll have to come in and associate it via IP configurations. So it can be a two step process, so keep that in mind. And that's all you need to do to setup your IP addresses for your Azure virtual machines, keeping in mind, you do not want to go into the virtual machine to do this. Do it all through the portal or through PowerShell. It's outside the virtual machine.
- Creating an Azure virtual network
- Creating a virtual network using PowerShell
- Deploying a VM into a virtual network
- Modifying IP addresses
- Working with Azure DNS
- Configuring NSGs
- Setting up load balancers
- Configuring Azure load balancers
- Creating an application gateway
- Setting up on-premises connectivity
- Adding gateway VPNs
- Validating VPN devices
- Configuring VNet
- Creating site connections