0
votes

How to enable internet connection in ubuntu in Azure

I have Ubuntu VM provisioned from Azure cloud.It seems by default Azure has firewall and it blocks the internet connectivity. The ping to google.com is not working.The command apt-get update gives the below output.

root@linuxserver#apt-get update Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease Temporary failure resolving 'security.ubuntu.com' Err:2 http://archive.ubuntu.com/ubuntu xenial InRelease Temporary failure resolving 'archive.ubuntu.com' Err:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease Temporary failure resolving 'archive.ubuntu.com' Err:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease Temporary failure resolving 'archive.ubuntu.com' Reading package lists... Done W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Temporary failure resolving 'security.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead.

In the /etc/resolve.conf I have IP like 10.x.x.x. ( for security reasons could not give the full IP) How to check whether Internet is blocked at firewall level in Azure or from network level. How to troubleshoot and enable the internet to the Ubuntu VM.

I did google search and read that I should have the Microsoft public DNS server in my configuration. Is that right or wrong.

[EDIT] After adding the Google DNS server 8.8.8.8 to /etc/resolve.conf. The apt-get update worked. so closing this thread.

[closed]

1

1 Answers

1
votes

There is nothing preventing your VM to access the internet. VMs in Azure are deployed in a Cloud Service, which is the layer responsible for assigning a public ip among other features. All routes are created automatically as well and as long as you don't mess with the adapter configuration inside your VM, you should be able to connect to the internet.

Make sure to keep the network configuration inside your Azure VM as automatic (DHCP). Don't set anything by hand. You should also configure a Virtual Network prior VM provisioning to organize your infrastructure and make sure other VMs can communicate with each other.

Create a Virtual Network

https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-create-a-vnet/

If you need a fixed private IP or reserved public IP:

https://azure.microsoft.com/documentation/articles/virtual-networks-reserved-public-ip/

Maybe you are asking this because you are familiar with Amazon AWS. In Amazon you have to deploy a NAT server and assign an Elastic IP to it but in Azure you don't need to do anything to get internet connectivity and a public ip.

Update:

Microsoft Lifecycle Services - Azure Demo Deployment

This specific demo deployment relies on a Domain Controller. Probably the DNS server running on this machine is not configured to forward external dns requests. RDP to this VM and open the DNS Manager console. Right click your server name >> Select Properties >> Select Forwarders Tab >> Add Google DNS 8.8.8.8, 8.8.4.4 and see if you have can browse the internet now.