cancel
Showing results for 
Search instead for 
Did you mean: 
Administration & Architecture
Explore discussions on Databricks administration, deployment strategies, and architectural best practices. Connect with administrators and architects to optimize your Databricks environment for performance, scalability, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 

Private network gateway (ALL_TRAFFIC): serverless can't reach on-prem by raw IPv4, only by hostname

Ignacio_Soler
New Contributor

Hi all,

We're testing the private network gateway (Beta) on Azure Databricks so that serverless compute egresses through a subnet in our VNet and reaches on-prem resources (through a hub firewall + ExpressRoute/VPN) from a predictable IP range.

Setup
- Azure Databricks (Premium, VNet-injected, no public IP), westus. Hub-and-spoke network.
- Private network gateway in ALL_TRAFFIC mode, created via the account REST API. State ESTABLISHED, no destinations.
- Gateway subnet: 10.230.52.192/27, in the workspace's spoke VNet, delegated as the docs require.
- private_dns_resolvers: 168.63.129.16 (Azure-provided DNS).
- Routing: the gateway subnet's route table sends 0.0.0.0/0 to an Azure Firewall in the hub. The hub is peered to a VNet that simulates our on-prem network (172.20.27.0/24). In production that hop is ExpressRoute.
- On-prem services (simulated):
- 172.20.27.13:1433: a TCP service that echoes back the client IP it sees, standing in for SQL Server.
- 172.20.27.14:8080: a small HTTP service that does the same.
- On-prem DNS: a DNS server in the simulated on-prem network, authoritative for corp.example.local.
- DNS from Azure: an Azure DNS Private Resolver with a forwarding ruleset (corp.example.local → on-prem DNS, through the outbound endpoint). The ruleset is linked to the workspace VNet, so 168.63.129.16 queried from the gateway subnet resolves both public names and corp.example.local. We don't point the gateway at the resolver's inbound endpoint.
- The NCC also has private endpoint rules (Unity Catalog storage), which keep working as expected.

What works
- Connecting by hostname (sqlserver.corp.example.local:1433) works. The on-prem server sees the client as an IP from the gateway subnet (10.230.52.196), as expected.
- Connecting to a public name that resolves to the on-prem IP (172.20.27.13.nip.io) also works.

What doesn't work
- Connecting to the raw IP (172.20.27.13:1433) from a serverless notebook times out, and the firewall logs show nothing.

socket.create_connection(("sqlserver.corp.example.local", 1433), timeout=5) # OK
socket.create_connection(("172.20.27.13", 1433), timeout=5) # TimeoutError

What we found while debugging

1. The serverless container has nameserver 192.168.200.6, an IPv4 default route via 169.254.1.1 and an IPv6 default route via fe80::1.

2. Every name, private or public, resolves only to AAAA records in what looks like a NAT64 prefix (RFC 8215, 64:ff9b:1::/48), with the IPv4 in the last 32 bits: sqlserver.corp.example.local -> 64:ff9b:1::100:ac14:1b0d (172.20.27.13) ifconfig.me -> 64:ff9b:1::100:22a0:6f91 (34.160.111.145)
This also explains why socket.gethostbyname() (A records only) fails with EAI_AGAIN while create_connection() works.

3. Building the NAT64 address by hand works, even for an IP whose name was never resolved: 64:ff9b:1::100:ac14:1b0e reaches 172.20.27.14:8080, and the server sees a gateway-subnet source IP. So the translation looks stateless.

4. A raw public IPv4 also bypasses the gateway. http://34.160.111.145/ip reports the Databricks default serverless egress IP. The same host through its NAT64 address reports our firewall's public IP.

5. We can't add routes from the notebook (RTNETLINK answers: Operation not permitted), which is expected.

Our reading is that the gateway path depends on DNS: the Databricks resolver returns NAT64 addresses, and only traffic to that prefix goes through the gateway. An IPv4 literal skips DNS and falls through to the default serverless egress, the last row of the routing-priority table in the docs.

Questions
1. Is this the intended behavior? Are raw IPv4 destinations out of scope for the private network gateway, even in ALL_TRAFFIC? The docs say ALL_TRAFFIC "routes all outbound traffic from serverless compute through the gateway", and we didn't find any mention of IP literals.
2. Is there a plan to support IP / CIDR destinations? Today destination_type only accepts DNS_NAME.
3. Is the recommended approach to always connect by FQDN, with a DNS record for every on-prem target that the gateway's resolvers can resolve? Any guidance for legacy code or JDBC URLs with hardcoded IPs?
4. Is the NAT64 prefix stable or documented anywhere, or should we treat it as an internal detail and avoid relying on it?
5. In ALL_TRAFFIC, is it expected that a public IP literal egresses through the default Databricks egress instead of the customer firewall? From an egress-control point of view, that means ALL_TRAFFIC doesn't capture all traffic.

Related: the private network gateway docs, and this thread, where it's mentioned that interception "depends on hostname matching" for NCC private endpoints.

Thanks!

1 REPLY 1

sumitPanda
Databricks Partner

Your tests show that DNS64/NAT64-addressed connections use the gateway, while a raw IPv4 connection can use Databricks’ default egress. That behavior is not described as an exception in the current docs. They say ALL_TRAFFIC routes all outbound traffic through the gateway except traffic matched by a higher-priority path, such as Private Link or an Azure service endpoint. A raw IP connection to your on-prem host does not appear to match either exception

1. Is this intended? Are IP literals out of scope?

The documentation does not say that IP literals are out of scope for ALL_TRAFFIC. Your results indicate they may bypass the gateway in practice, but I can’t confirm from public docs that this is intended behavior or a known limitation. I’d raise it with Databricks Support as a possible discrepancy between observed behavior and the documented ALL_TRAFFIC promise.

The gateway docs also distinguish routing from egress permission: in ALL_TRAFFIC, intended destinations must be explicitly allowed by the serverless egress policy. Verify that policy as part of the investigation, though it would not explain the successful public-IP test reporting Databricks’ default egress IP.

2. Is IP/CIDR destination matching supported or planned?

For explicit gateway destinations, the documented API type is DNS_NAME; I found no published plan for IP/CIDR gateway destinations. That’s separate from ALL_TRAFFIC, which does not require a destination list—but your tests suggest it may not capture raw IPv4 connections.

3. Should clients use FQDNs?

For now, using an FQDN is the practical workaround: give each on-prem service a resolvable name and use that name in JDBC URLs and application connection settings. Check that drivers or services don’t redirect the client to a raw IP. In ALL_TRAFFIC, also ensure the intended destinations are allowed by the egress policy.

The linked community discussion concerns AWS NCC PrivateLink, where hostname matching is discussed; it is not confirmation of Azure private network gateway behavior in ALL_TRAFFIC.

4. Is 64:ff9b:1::/48 stable?

I found no Databricks documentation publishing that prefix as a contract. It is the RFC 8215 local-use NAT64 prefix; the RFC cautions against assuming where an IPv4 address is embedded or what translation mechanism is used. Treat the observed prefix and your hand-built addresses as implementation details—don’t hardcode them into clients or rely on their stability.

5. Does ALL_TRAFFIC capture every public-IP connection?

Your public-IP test shows that it did not capture that connection. That conflicts with the documented behavior, which says ALL_TRAFFIC routes outbound traffic through the gateway except for more-specific routes. Until Databricks confirms the behavior or resolves the discrepancy, don’t rely on ALL_TRAFFIC alone as proof that every egress path passes through your firewall.

Sumit Panda