Skip to content
INSIGHTS & GUIDES · NETCLOUD24

Connecting two routed sites through an RRAS IKEv2 interface

Connect two sites using an RRAS IKEv2 interface with machine certificates, complementary subnet routes and matched responder policy, then verify application traffic and retain a controlled renewal and rollback plan.

Read the article ↓
Editorial illustration: How to Configure a Site-to-Site VPN Interface in RRAS

Platform: Windows Server 2019, 2022 and 2025, with the version and hosting restrictions described below.

Agree the two-sided service, not just a tunnel name

A site-to-site VPN joins networks whose hosts depend on a predictable routed path. Both gateways must agree on peer identity, IPsec policy and the networks carried through the tunnel. Each LAN must also return traffic through its own gateway. A Connected status establishes only the tunnel; it does not show that an application on one site can complete a request to the other.

For a managed Netcloud24 deployment, the infrastructure team coordinates both ends and the permitted application flows. Customers should receive the agreed connection and escalation arrangements rather than having to reconcile cryptographic settings themselves. This guide provides the administrator’s workflow for an IKEv2 interface using machine certificates and explicit subnet routes.

Create a peer configuration record

Record the reachable endpoint at each side, any upstream NAT, the two local networks, certificate names and issuers, IKE/IPsec transforms, rekey lifetimes, routing metrics and traffic selectors where required. Include the device and software version at the other end; a non-Windows gateway can have different defaults or policy-based routing requirements.

For illustration, the main network is 172.24.1.0/24 and the branch is 172.24.2.0/24. Replace both with reviewed non-overlapping ranges. A subnet route must identify the network behind the remote gateway, not the gateway’s public endpoint. Avoid installing a tunnel default route simply because the intended remote subnet is missing.

Agree which applications may cross and enforce that scope through appropriate firewall and routing policy. Linking two sites should not silently give every host unrestricted access to the other network. Identify the normal LAN routers and arrange the remote-subnet return routes there if clients do not use RRAS directly.

Verify platform, certificate and transport prerequisites

Install the required RRAS VPN and Routing components on a supported platform. Confirm the hosting provider permits transit traffic and the IPsec path. Microsoft’s restriction on deploying Windows Remote Access inside Azure VMs also applies to this role design; other virtual platforms need their own support assessment.

Each gateway requires its appropriate machine certificate and private key. Validate purposes, peer identity, chain, expiry and revocation access from both ends. An imported certificate without its key cannot authenticate the local gateway. Plan renewal and retain the identity-mapping requirement so a replacement certificate does not unexpectedly break inbound matching.

Get-WindowsFeature DirectAccess-VPN,Routing
Get-Service RemoteAccess
Get-ChildItem Cert:\LocalMachine\My |
  Select-Object Subject,Thumbprint,NotAfter,HasPrivateKey
Get-VpnS2SInterface

Permit the required IKE/IPsec traffic, including UDP 500 and 4500 for the actual NAT traversal design and ESP where applicable. Scope peer access where possible. A TCP port check is not a test of those exchanges.

Build the main-side interface from the peer record

Use the local certificate selected by its exact reviewed thumbprint. The example creates a persistent main-side interface towards the branch and a route for the branch LAN. Its name reflects the expected peer certificate identity: RRAS incoming certificate-authenticated connections use the peer subject to match an interface, so an arbitrary friendly label can cause a subtle mismatch.

$gatewayThumbprint = 'REPLACE_WITH_LOCAL_GATEWAY_CERTIFICATE_THUMBPRINT'
$gatewayCert = Get-Item ('Cert:\LocalMachine\My\' + $gatewayThumbprint) -ErrorAction Stop
if (-not $gatewayCert.HasPrivateKey) { throw 'A usable local private key is required.' }
Add-VpnS2SInterface -Name 'branch-gateway.corp.example' `
  -Destination 'branch-vpn.corp.example' -Protocol IKEv2 `
  -AuthenticationMethod MachineCertificates -Certificate $gatewayCert `
  -IPv4Subnet '172.24.2.0/24:80' -Persistent -AdminStatus $true

The :80 suffix is the route metric, not a destination TCP port. Configure the branch with its own local certificate, correct peer mapping and the complementary route to 172.24.1.0/24. Do not copy the same remote-prefix value to both sides. Inspect existing interfaces before creation so a name conflict does not lead to deleting a live connection.

Check responder policy as well as the initiating interface

With machine-certificate authentication, per-interface IPsec settings govern the initiating side, while server configuration governs incoming responder behaviour. A custom policy applied only to the interface can therefore produce one-direction success and reverse-initiation failure. Review the complete negotiation model on both gateways.

Use the organisation’s approved modern cryptographic suite and confirm the peer supports it. If custom settings are necessary, document encryption, integrity, DH/PFS and lifetime values and configure the corresponding interface and server settings through the supported commands. Do not reuse an old compatibility snippet containing obsolete groups merely because it connects.

Pre-shared-key authentication has different matching and per-destination limitations. Switching to it during diagnosis is a new security and operational decision, not a harmless test. If it is the approved design, use secure secret storage and rotation rather than embedding the key in a public transcript. This example keeps certificate authentication throughout.

Test from hosts behind both gateways

Initiate the interface and inspect its state and route. Then use an authorised main-site client to reach a permitted branch application, and repeat in the opposite direction. Router-originated tests can hide missing LAN return routes or a host firewall that only affects real clients.

Connect-VpnS2SInterface -Name 'branch-gateway.corp.example'
Get-VpnS2SInterface -Name 'branch-gateway.corp.example'
Get-NetRoute -AddressFamily IPv4 |
  Where-Object DestinationPrefix -eq '172.24.2.0/24'
# On an authorised main-site client:
Test-NetConnection '172.24.2.25' -Port 443

Check DNS for application names and confirm a prohibited flow remains blocked. Record source and destination addresses, protocol, port and time for each result. A successful ping is useful but insufficient when the service depends on a particular TCP port and authentication path.

Separate negotiation faults from routed-traffic faults

If no tunnel forms, inspect endpoint resolution, transport filtering, certificate validation, incoming identity matching and transform compatibility. Compare evidence from both sides at the same time. A one-sided initiation problem often merits responder-policy review rather than a route change.

If the tunnel is established but applications fail, check local and remote routes, return paths, selectors, host firewalls and NAT exemptions. An overlapping network can route packets locally instead of into the tunnel. Large-transfer failures with successful small probes may involve MTU or fragmentation. Preserve targeted evidence rather than repeatedly disconnecting a working tunnel to see whether the next attempt is different.

Plan disconnection, renewal and recovery

Before removing or changing the interface, identify dependent services and arrange the alternate route or outage. Restore only the routes and policies introduced for this connection. A stale preferred route through an unavailable tunnel can black-hole traffic, while deleting an unrelated route can affect management or another site.

Retain the peer record, certificates and logs until the change is accepted. Do not uninstall RRAS while other gateway functions depend on it. Monitor reconnects and rekeys, test renewal in a planned window and keep the customer-facing service owner informed of meaningful changes. The durable result is a documented routed service with a recoverable trust relationship, not merely a green tunnel icon.

Further reading


Was this answer helpful?

« Back
Contact

Write to us

Do you have questions about our services or need a quote? Write to us and we will respond as soon as possible.

Contact form

Fields marked * are required.