Prevent client from using internet via my RRAS VPN - azure

I have a windows server 2016 running in Azure with RRAS VPN + NAT.
I use this RRAS VPN to be able to RDP to my other VM's in the virtual network.
However, when I connect my client (windows 10) computer to the RRAS VPN, my internet will stop working on the client (because internet access is blocked on the RRAS VM).
How can I prevent the client from trying to use the internet that my RRAS VPN VM provides? I tried disabling the use-default-gateway checkbox, but then I can no longer connect to my other VM's in the virtual network.
Thanks!

According to this link it seems that when you disable the "use-default-gateway checkbox" that the default routes are not added to your machine. In specific:
If “User default gateway on remote network” is turned on, the VPN client on successful VPN tunnel connection adds the default route on VPN interface with highest precedence. This way all the IP packets (except those destined to local subnet) go to VPN server. If this parameter is turned off, the default route is not added on VPN tunnel. This scenario will require user to add specific network specific route on the VPN interface – in order to reach the corpnet resources
So, you are left with editing your routes manually to ensure that they work. You can do this pretty easily in windows by working with the route table. The following article gives the basics of how to set this.
Essentially you will want to run something like this:
route ADD <azure network> MASK <azure mask> <azure gw ip>
After you have done this, you should be able to use the internet (via your local configuration) and access to your Azure servers (via the route you created above).

Related

How do I know that a Virtual Machine in Azure use the Local network gateway route to connect to an on-premise network?

Here a Data engineer who needs your help to setup a connection to an on-premise environment :)!
I have created a virtual network (10.0.0.0/16) with a default subnet (10.0.0.0/24).
Then I created a (Windows) virtual machine which is connected to the vnet/subnet and has allowed ICMP inbound and outbound rules for the ping test. Ping google.com is no problem.
The next step was to create a Virtual network gateway & Local network gateway to connect to an on-premise environment.
The Local network gateway has an Site-to-site (IPsec) connection to a VPN device from a third party (over which I have no control). Status in the Azure portal = 'Connected'.
The third party is able to ping the Virtual Machine in Azure, the 'data in' property on the VPN connection shows that 2 kb (ping) has been received. So that works!
When i try to send a ping command to the ip-address (within the 'address space' specified from the Local network gateway) the ping command fails (Request timed out.).
After a lot of searching on google/stackoverflow I found out that I need to configure a Route Table in Azure because of the BGP = disabled setting. So hopefully I did a good job configure the Routing Table Routes but still I can't perform a successful ping :(!
Do you guys/girls know which step/configuration I have forgotten or where I made a mistake?
I would like to understand why I cannot perform a successful ping to the on-premise environment. If you need more information, please let me know
Site-to-site (IPsec) connection screenshot/config
Routing Table setup screenshot/config
Routing Table Routes in more detail
If you are NOT using BGP between the Azure VPN gateway and this particular network, you must provide a list of valid address prefixes for the Address space in your local network gateway. The address prefixes you specify are the prefixes located on your on-premises network.
In this case, it looks like you have added the address prefixes. Make sure that the ranges you specify here do not overlap with ranges of other networks that you want to connect to. Azure will route the address range that you specify to the on-premises VPN device IP address. There are no other operations that we can do. We don't need to set UDR, especially we don't associate a route table to the Gateway Subnet. Also, avoid associating a network security group (NSG) to the Gateway Subnet. You can check the route table by selecting Effective routes for a network interface in Azure VM. Read more details here.
If you would like to verify the connection from Azure VNet to an on-premise network, ensure that you PING a real private IP address from your on-premise network(I mean the IP address is assigned to an on-premise machine), you can check the IP address with ipconfig/all in local CMD. Moreover, you could Enable ICMP through the Windows firewall inside the Azure VM with the PowerShell command New-NetFirewallRule –DisplayName "Allow ICMPv4-In" –Protocol ICMPv4. Or, instead of using PING, you can use the PowerShell command Test-NetConnection to test a connection to a remote host.
If the problem persists, you could try to reset the Azure VPN gateway and reset the tunnel from the on-premises VPN device. To go further, you could follow these steps to identify the cause of the problem.

Is it possible make requests to the server from another network

To elaborate more on the title, (that I know is confussing, I would appretiate if someone make it better)
I need to connect a PC that is off the office to the server that is being hosted on azure,
but only the calls being made from the office IP are trusted by the server.
I need to be able to connect to it from of the premisses, on my laptop.
Is there any way to do this, with a vpn or something like that?
I think the easies way to achieve your goal without exposing VM to public Internet is Point-to-site VPN:
You add and configure a VPN gateway on Azure Virtual Network where VM is placed
You allocate a private address space to Point-to-site connections and authorize its IP range at VM level (Security Group, Firewall or any other method that you use to protect the traffic in Azure)
You install a VPN client on your laptop and connect to VM with it's private IP address

Connect to server behind

I have a newly installed MikroTik switch, and have successfully configured it for VPN traffic. However, behind the switch is a Linux server to which I am unable to connect via PuTTY. I can see the server and its IP address in Winbox->IP->DHCP Server->Leases, but as I say, I can't connect from within the VPN. I've made several attempts to add a rule to the firewall that would permit access and I've even gone so far as to uncheck the firewall router box in Quick Set, but no matter what I've tried, it always times out. To be clear, I'd like the server to be visible to all machines connected to the switch - both via ethernet and via pp2p.
I've been googling for hours, and I'm completely new to network engineering, so any help would be greatly appreciated.
I think the problem may be due to NAT and your VPN IP Subnet. I have my VPN users in 192.168.4.0/24 the main subnet is 192.168.0.0/22. In Winbox got to IP>Firewall then in the NAT tab make sure you have a masquerade action on your VPN subnet. I think the VPN quick set adds one but if your using different subnets it gets confused. See the image for what I have set for my VPN users to access servers and resources on the main network.

Starting with AZURE VPN. IPSEC as method and Cisco 2611 router (4.x vpn client)

I'm starting with Azure's VPN network.
I'm little bit confused about site-to-site and point-to-point methods.
What I need to do is, connect to a remote server that runs some SIP & H323 PBX server. The cisco router is used as a FXO/FXS lines/phone gateway.
I mean this cisco router is not used as router only as a H323 gateway, is like a remote client connecting trough a VPN and running a softphone.
So.. client-to-client is the easy method.. or is site to site ( I don't have any other device or host in my router so is not a remote site is only one terminal)
The thing with this router is the IOs version (12.2) a little bit older. It runs IPSEC client 4.X.. So it will work ?
Test first witha IPSEC in a PC first is a good idea I think
Ideas & comments are welcome !!!
Best Regards!!
Frank
I am not familiar with the model (2611). In general though, if this box is really acting as an endpoint (client or server), you have two choices:
Connect from 2611 directly to the virtual machine (VIP) without using Azure VPN. Of course you will need to ensure the connection is secure.
Create an Azure VPN gateway and establish a S2S VPN tunnel between your network and the Azure virtual network hosting your VM. Azure uses standard IPsec/IKE VPN (for route-based VPN, you will need IKEv2, policy-based VPN uses IKEv1).
Either option should work. Point-to-site VPN will not work for you though. Point-to-site requires a Windows machine as a VPN client connecting to Azure.
Please let us know if you have any questions.
Thanks,
Yushun [MSFT]

Connecting Site-to-Site VPN on Azure via RRAS Help - Connected, but only 1 way ping

need some expert advice.
I've set up a Site to Site VPN connection between Azure and my on premise setup by following the guides below.
The Remote and Routing Access Server (RRAS) runs on top of a Windows Server 2012 VM.
A FW sits infront of the Internet, and routes all the traffic of a given Public IP address to this RRAS server.
The RRAS server has a ROUTE ADD setting added to direct 10.100.0.0/17 traffic to itself as the GW.
A secondary VM maps this RRAS server as the GW.
All connections worked, and the RRAS dialup is connected fine.
Now, my VM HyperV-Local1 is able to ping 10.100.0.4, same for my RRAS server.
But my VM-1 on Azure is unable to ping/access back to my on-premise servers.
View RRAS Setup Guide 1,
View RRAS Setup Guide 2
Ok fixed the issue.
Problem was I should not have added the route add for 10.100.0.0/17 to my RRAS server. The RRAS connection will insert that route by itself. Cos there's 2 interface on the machine (1) Ethernet, (2) the RRAS dialup. By manually inserting that route, it diverted traffic to the wrong interface.
Remember to check and enable ICMPv4 on Windows Firewall on both sides (RRAS VM and Azure VM)!
For other servers, they do not have to set their GW to the RRAS server. as long as you add a Route Add 10.100.0.0/17 to your RRAS server will do.
Some info on my setup environment:
My onpremise firewall has a public ip mapped to my internal VM (RRAS server)
Followed the guide on a new Windows Server 2012 setup without Remote Access installed.
Run the Azure powershell script as per the guide for VPN connection setup.

Resources