Cannot connect to Internet from instance in private subnet2019 Community Moderator ElectionON Premises connectivity issue from Azure (using site-to-site connectivity)Azure Networking: Traffic through VPN to Virtual Machine droppedShould I use IP addresses from the Gateway Subnet in an Azure VPN?How can I connect my Azure App Service web app to a private virtual network subnet (via a virtual network gateway) using PowerShell?Cannot connect to http port on Azure Ubuntu VMWhen is NAT-T natting performed on Azure policy based basic VNet gateway, IKEv1 site-to-site connectionHow can I send traffic between two Virtual Machines which are created on two different virtual networks in azure cloudAzure, connection refused on some ports when accessed from the internetInbound/Outbound Traffic Logging Azure VPN GatewayCannot ping from on-prem machine to an azure vnet

Do I really need to have a scientific explanation for my premise?

How do electrons receive energy when a body is heated?

What materials can be used to make a humanoid skin warm?

Are all players supposed to be able to see each others' character sheets?

Was it really inappropriate to write a pull request for the company I interviewed with?

After `ssh` without `-X` to a machine, is it possible to change `$DISPLAY` to make it work like `ssh -X`?

Does "Until when" sound natural for native speakers?

From an axiomatic set theoric approach why can we take uncountable unions?

How to design an organic heat-shield?

How to resolve: Reviewer #1 says remove section X vs. Reviewer #2 says expand section X

Possible to detect presence of nuclear bomb?

Expressing logarithmic equations without logs

What do you call someone who likes to pick fights?

Doubts in understanding some concepts of potential energy

Which situations would cause a company to ground or recall a aircraft series?

What's the 'present simple' form of the word "нашла́" in 3rd person singular female?

Does a difference of tense count as a difference of meaning in a minimal pair?

I reported the illegal activity of my boss to his boss. My boss found out. Now I am being punished. What should I do?

Doesn't allowing a user mode program to access kernel space memory and execute the IN and OUT instructions defeat the purpose of having CPU modes?

Why is a very small peak with larger m/z not considered to be the molecular ion?

What would be the most expensive material to an intergalactic society?

Making a kiddush for a girl that has hard time finding shidduch

Specifying a starting column with colortbl package and xcolor

What are some noteworthy "mic-drop" moments in math?



Cannot connect to Internet from instance in private subnet



2019 Community Moderator ElectionON Premises connectivity issue from Azure (using site-to-site connectivity)Azure Networking: Traffic through VPN to Virtual Machine droppedShould I use IP addresses from the Gateway Subnet in an Azure VPN?How can I connect my Azure App Service web app to a private virtual network subnet (via a virtual network gateway) using PowerShell?Cannot connect to http port on Azure Ubuntu VMWhen is NAT-T natting performed on Azure policy based basic VNet gateway, IKEv1 site-to-site connectionHow can I send traffic between two Virtual Machines which are created on two different virtual networks in azure cloudAzure, connection refused on some ports when accessed from the internetInbound/Outbound Traffic Logging Azure VPN GatewayCannot ping from on-prem machine to an azure vnet










0















I've set up a minimal environment in Azure with one instance (Linux) in a private subnet and a virtual network gateway to connect to via IPSec. I followed the instuctions in the Azure docs and my setup should have the same setting as the one in the example.



I did all of this in Terraform and I'm using strongSwan as VPN client to connect to the gateway. I can establish a VPN connection via strongSwan with no problems. I've create my test instance in the FrontEnd subnet. To access my machine via SSH I've added another NSG rule to allow access on port 22. Up until this point everything works fine.



My problem is, that I'm not able to access the Internet from this machine.



What I've checked so far:



  • DNS resolution works fine

  • Linux has its default route set to the Azure gateway address (192.168.1.1)

  • The NIC is attached to NSG which only has the default rules for outbound traffic (allowing all outbound traffic)

  • There are no custom routing rules

  • According to the Azure docs SNAT/PAT should be automatically applied in my scenario.

Am I missing something?



Edit: I forgot to mention that the NIC of the instance only has a private IP.










share|improve this question
























  • Ensure you haven't configured a custom User Defined Route on the Vnet. docs.microsoft.com/en-us/azure/virtual-network/…

    – Ken W MSFT
    Mar 6 at 17:53















0















I've set up a minimal environment in Azure with one instance (Linux) in a private subnet and a virtual network gateway to connect to via IPSec. I followed the instuctions in the Azure docs and my setup should have the same setting as the one in the example.



I did all of this in Terraform and I'm using strongSwan as VPN client to connect to the gateway. I can establish a VPN connection via strongSwan with no problems. I've create my test instance in the FrontEnd subnet. To access my machine via SSH I've added another NSG rule to allow access on port 22. Up until this point everything works fine.



My problem is, that I'm not able to access the Internet from this machine.



What I've checked so far:



  • DNS resolution works fine

  • Linux has its default route set to the Azure gateway address (192.168.1.1)

  • The NIC is attached to NSG which only has the default rules for outbound traffic (allowing all outbound traffic)

  • There are no custom routing rules

  • According to the Azure docs SNAT/PAT should be automatically applied in my scenario.

Am I missing something?



Edit: I forgot to mention that the NIC of the instance only has a private IP.










share|improve this question
























  • Ensure you haven't configured a custom User Defined Route on the Vnet. docs.microsoft.com/en-us/azure/virtual-network/…

    – Ken W MSFT
    Mar 6 at 17:53













0












0








0








I've set up a minimal environment in Azure with one instance (Linux) in a private subnet and a virtual network gateway to connect to via IPSec. I followed the instuctions in the Azure docs and my setup should have the same setting as the one in the example.



I did all of this in Terraform and I'm using strongSwan as VPN client to connect to the gateway. I can establish a VPN connection via strongSwan with no problems. I've create my test instance in the FrontEnd subnet. To access my machine via SSH I've added another NSG rule to allow access on port 22. Up until this point everything works fine.



My problem is, that I'm not able to access the Internet from this machine.



What I've checked so far:



  • DNS resolution works fine

  • Linux has its default route set to the Azure gateway address (192.168.1.1)

  • The NIC is attached to NSG which only has the default rules for outbound traffic (allowing all outbound traffic)

  • There are no custom routing rules

  • According to the Azure docs SNAT/PAT should be automatically applied in my scenario.

Am I missing something?



Edit: I forgot to mention that the NIC of the instance only has a private IP.










share|improve this question
















I've set up a minimal environment in Azure with one instance (Linux) in a private subnet and a virtual network gateway to connect to via IPSec. I followed the instuctions in the Azure docs and my setup should have the same setting as the one in the example.



I did all of this in Terraform and I'm using strongSwan as VPN client to connect to the gateway. I can establish a VPN connection via strongSwan with no problems. I've create my test instance in the FrontEnd subnet. To access my machine via SSH I've added another NSG rule to allow access on port 22. Up until this point everything works fine.



My problem is, that I'm not able to access the Internet from this machine.



What I've checked so far:



  • DNS resolution works fine

  • Linux has its default route set to the Azure gateway address (192.168.1.1)

  • The NIC is attached to NSG which only has the default rules for outbound traffic (allowing all outbound traffic)

  • There are no custom routing rules

  • According to the Azure docs SNAT/PAT should be automatically applied in my scenario.

Am I missing something?



Edit: I forgot to mention that the NIC of the instance only has a private IP.







azure azure-virtual-network azure-vpn






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 6 at 15:08







raidlman

















asked Mar 6 at 14:27









raidlmanraidlman

11511




11511












  • Ensure you haven't configured a custom User Defined Route on the Vnet. docs.microsoft.com/en-us/azure/virtual-network/…

    – Ken W MSFT
    Mar 6 at 17:53

















  • Ensure you haven't configured a custom User Defined Route on the Vnet. docs.microsoft.com/en-us/azure/virtual-network/…

    – Ken W MSFT
    Mar 6 at 17:53
















Ensure you haven't configured a custom User Defined Route on the Vnet. docs.microsoft.com/en-us/azure/virtual-network/…

– Ken W MSFT
Mar 6 at 17:53





Ensure you haven't configured a custom User Defined Route on the Vnet. docs.microsoft.com/en-us/azure/virtual-network/…

– Ken W MSFT
Mar 6 at 17:53












1 Answer
1






active

oldest

votes


















1














It's likely that you could not verify the internet connectivity correctly from that Azure VM. I have the same scenario as this question. You could try to verify this via ping bing.com on the Azure machine. It seems that some websites could not ping, however, you could access these websites directly via Web Browser or curl to download content from the internet.



I have set up a P2S VPN connection on windows local desktop with one Azure VNet, which has a GatewaySubnet and a VMsubnet. One windows VM and one ubuntu VM in the VMsubnet. Both VMs do not have instance-level public IP.



Generally, Azure VM has a system default gateway locally in the same subnet. This gateway helps route all outbound traffic from the primary network interface. If a VPN gateway set up, Azure will generate automatically a route to P2S on-premise subnet. By default, there is also a default route 0.0.0.0/0 to the Internet in the effective routes.



enter image description here



I could access the google.com and bing.com in the web explorer but can not directly ping google.com, can ping bing.com on the windows VM.
enter image description here



With the same situation, I also can not directly ping google.com, but can ping bing.com on the Linux VM or curl www.google.com.



enter image description here



Hope this helps, let me know if you have any question.






share|improve this answer

























  • Thanks for pointing this out. curl/wget are working as expected. I knew that google does not respond to pings so I usually use some other site or the google DNS service. Strangely, it seems like I cannot ping any public IP in my setup. Any idea why this is? My effective outbound rules say that all outgoint traffic to Internet is allowed. Does this not include ICMP packages?

    – raidlman
    2 days ago










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55025433%2fcannot-connect-to-internet-from-instance-in-private-subnet%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














It's likely that you could not verify the internet connectivity correctly from that Azure VM. I have the same scenario as this question. You could try to verify this via ping bing.com on the Azure machine. It seems that some websites could not ping, however, you could access these websites directly via Web Browser or curl to download content from the internet.



I have set up a P2S VPN connection on windows local desktop with one Azure VNet, which has a GatewaySubnet and a VMsubnet. One windows VM and one ubuntu VM in the VMsubnet. Both VMs do not have instance-level public IP.



Generally, Azure VM has a system default gateway locally in the same subnet. This gateway helps route all outbound traffic from the primary network interface. If a VPN gateway set up, Azure will generate automatically a route to P2S on-premise subnet. By default, there is also a default route 0.0.0.0/0 to the Internet in the effective routes.



enter image description here



I could access the google.com and bing.com in the web explorer but can not directly ping google.com, can ping bing.com on the windows VM.
enter image description here



With the same situation, I also can not directly ping google.com, but can ping bing.com on the Linux VM or curl www.google.com.



enter image description here



Hope this helps, let me know if you have any question.






share|improve this answer

























  • Thanks for pointing this out. curl/wget are working as expected. I knew that google does not respond to pings so I usually use some other site or the google DNS service. Strangely, it seems like I cannot ping any public IP in my setup. Any idea why this is? My effective outbound rules say that all outgoint traffic to Internet is allowed. Does this not include ICMP packages?

    – raidlman
    2 days ago















1














It's likely that you could not verify the internet connectivity correctly from that Azure VM. I have the same scenario as this question. You could try to verify this via ping bing.com on the Azure machine. It seems that some websites could not ping, however, you could access these websites directly via Web Browser or curl to download content from the internet.



I have set up a P2S VPN connection on windows local desktop with one Azure VNet, which has a GatewaySubnet and a VMsubnet. One windows VM and one ubuntu VM in the VMsubnet. Both VMs do not have instance-level public IP.



Generally, Azure VM has a system default gateway locally in the same subnet. This gateway helps route all outbound traffic from the primary network interface. If a VPN gateway set up, Azure will generate automatically a route to P2S on-premise subnet. By default, there is also a default route 0.0.0.0/0 to the Internet in the effective routes.



enter image description here



I could access the google.com and bing.com in the web explorer but can not directly ping google.com, can ping bing.com on the windows VM.
enter image description here



With the same situation, I also can not directly ping google.com, but can ping bing.com on the Linux VM or curl www.google.com.



enter image description here



Hope this helps, let me know if you have any question.






share|improve this answer

























  • Thanks for pointing this out. curl/wget are working as expected. I knew that google does not respond to pings so I usually use some other site or the google DNS service. Strangely, it seems like I cannot ping any public IP in my setup. Any idea why this is? My effective outbound rules say that all outgoint traffic to Internet is allowed. Does this not include ICMP packages?

    – raidlman
    2 days ago













1












1








1







It's likely that you could not verify the internet connectivity correctly from that Azure VM. I have the same scenario as this question. You could try to verify this via ping bing.com on the Azure machine. It seems that some websites could not ping, however, you could access these websites directly via Web Browser or curl to download content from the internet.



I have set up a P2S VPN connection on windows local desktop with one Azure VNet, which has a GatewaySubnet and a VMsubnet. One windows VM and one ubuntu VM in the VMsubnet. Both VMs do not have instance-level public IP.



Generally, Azure VM has a system default gateway locally in the same subnet. This gateway helps route all outbound traffic from the primary network interface. If a VPN gateway set up, Azure will generate automatically a route to P2S on-premise subnet. By default, there is also a default route 0.0.0.0/0 to the Internet in the effective routes.



enter image description here



I could access the google.com and bing.com in the web explorer but can not directly ping google.com, can ping bing.com on the windows VM.
enter image description here



With the same situation, I also can not directly ping google.com, but can ping bing.com on the Linux VM or curl www.google.com.



enter image description here



Hope this helps, let me know if you have any question.






share|improve this answer















It's likely that you could not verify the internet connectivity correctly from that Azure VM. I have the same scenario as this question. You could try to verify this via ping bing.com on the Azure machine. It seems that some websites could not ping, however, you could access these websites directly via Web Browser or curl to download content from the internet.



I have set up a P2S VPN connection on windows local desktop with one Azure VNet, which has a GatewaySubnet and a VMsubnet. One windows VM and one ubuntu VM in the VMsubnet. Both VMs do not have instance-level public IP.



Generally, Azure VM has a system default gateway locally in the same subnet. This gateway helps route all outbound traffic from the primary network interface. If a VPN gateway set up, Azure will generate automatically a route to P2S on-premise subnet. By default, there is also a default route 0.0.0.0/0 to the Internet in the effective routes.



enter image description here



I could access the google.com and bing.com in the web explorer but can not directly ping google.com, can ping bing.com on the windows VM.
enter image description here



With the same situation, I also can not directly ping google.com, but can ping bing.com on the Linux VM or curl www.google.com.



enter image description here



Hope this helps, let me know if you have any question.







share|improve this answer














share|improve this answer



share|improve this answer








edited 2 days ago

























answered Mar 7 at 9:52









Nancy XiongNancy Xiong

3,6121110




3,6121110












  • Thanks for pointing this out. curl/wget are working as expected. I knew that google does not respond to pings so I usually use some other site or the google DNS service. Strangely, it seems like I cannot ping any public IP in my setup. Any idea why this is? My effective outbound rules say that all outgoint traffic to Internet is allowed. Does this not include ICMP packages?

    – raidlman
    2 days ago

















  • Thanks for pointing this out. curl/wget are working as expected. I knew that google does not respond to pings so I usually use some other site or the google DNS service. Strangely, it seems like I cannot ping any public IP in my setup. Any idea why this is? My effective outbound rules say that all outgoint traffic to Internet is allowed. Does this not include ICMP packages?

    – raidlman
    2 days ago
















Thanks for pointing this out. curl/wget are working as expected. I knew that google does not respond to pings so I usually use some other site or the google DNS service. Strangely, it seems like I cannot ping any public IP in my setup. Any idea why this is? My effective outbound rules say that all outgoint traffic to Internet is allowed. Does this not include ICMP packages?

– raidlman
2 days ago





Thanks for pointing this out. curl/wget are working as expected. I knew that google does not respond to pings so I usually use some other site or the google DNS service. Strangely, it seems like I cannot ping any public IP in my setup. Any idea why this is? My effective outbound rules say that all outgoint traffic to Internet is allowed. Does this not include ICMP packages?

– raidlman
2 days ago



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55025433%2fcannot-connect-to-internet-from-instance-in-private-subnet%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко