Isolating the network and configuring the egress gateway

Make a routing bastion the only layer 3 exit from the air-gapped network, and configure it to drop all forwarded traffic except traffic to the allowed destinations.

In this procedure, you make a routing bastion the only layer 3 exit from the air-gapped network, and you configure it to drop all forwarded traffic except traffic to the allowed destinations. The bastion forwards traffic without network address translation, so the source address of every connection is preserved. Hosts in the air gap keep their addresses, and your logs show which host sent which traffic.

Cloudera validates a single bastion. High availability for the bastion and IPv6 are not covered.

  • You have a Linux host to act as the bastion, with one VLAN sub-interface in each cluster VLAN and one transit interface that connects to your corporate network.
  • You have a network engineer who can change the fabric configuration during a maintenance window.
  • You know the addresses of the allowed destinations: DNS, NTP, SMTP, the registry, the package mirror, and the operator VPN range.
  • The cluster VLANs are layer 2 only, or you are ready to make them layer 2 only in this procedure.
  1. On the bastion, assign an address to each cluster VLAN sub-interface.

    Use an address that differs from the existing fabric gateway. For example, if the fabric gateway is .1, use .2. Assign the transit interface an address on the transit VLAN. Set the MTU of each sub-interface to the MTU of its VLAN.

  2. Enable IPv4 forwarding and increase the connection tracking table.

    Make the settings persistent in /etc/sysctl.d/.

    sudo sysctl -w net.ipv4.ip_forward=1
    sudo sysctl -w net.netfilter.nf_conntrack_max=1048576
  3. Create the firewall in permissive mode first.

    Set the default forward policy to accept, and do not drop invalid connection states. The fabric gateways are still active, so return traffic is not yet symmetric.

    sudo nft add table inet airgap
    sudo nft add set inet airgap allowed_dest_cidrs '{ type ipv4_addr; flags interval; }'
    sudo nft add chain inet airgap forward '{ type filter hook forward priority 0; policy accept; }'
  4. Add the allowed destinations to the set.

    Add every destination class from the section Allowed egress, one entry for each address or range.

    sudo nft add element inet airgap allowed_dest_cidrs '{ 192.0.2.53/32, 192.0.2.123/32, 198.51.100.0/28 }'
  5. Change the default gateway of every Cloudera Cloud Core host to the bastion address on its VLAN.

    Migrate one host at a time and confirm connectivity after each change. Keep the bastion in permissive mode while you migrate the hosts.

  6. Ask your network engineer to complete the fabric change in one maintenance window.
    1. Remove the layer 3 gateway addresses (switch virtual interfaces) of every cluster VLAN.
    2. Add static routes for the cluster subnets, or one summary route, that point to the bastion transit address.
    3. Redistribute those routes into your routing protocol.
  7. On the bastion, verify that the old fabric gateway addresses no longer respond, and that return traffic arrives through the bastion transit interface.

    Repeat the ping for the old gateway address of every cluster VLAN. While the capture runs, send a DNS query from a Cloudera Cloud Core host to an allowed DNS server.

    sudo ip neigh flush to <old-gateway-address>
    ping -c 1 -W 1 <old-gateway-address>
    sudo tcpdump -i <transit-interface> -nn host <ccc-host-address> and port 53

    The ping must fail for every VLAN. The capture must show both directions of the DNS query with the original host address, which confirms that routing is symmetric and that the bastion does not translate addresses.

  8. Enable enforcement.

    Set the default forward policy to drop, accept the established and allowed traffic, and drop invalid states. Log dropped and forwarded packets with distinct prefixes.

    sudo nft flush chain inet airgap forward
    sudo nft add rule inet airgap forward ct state established,related accept
    sudo nft add rule inet airgap forward ct state invalid drop
    sudo nft add rule inet airgap forward ip daddr @allowed_dest_cidrs log prefix \"AIRGAP_FWD: \" accept
    sudo nft add rule inet airgap forward log prefix \"AIRGAP_DROP: \"
    sudo nft chain inet airgap forward '{ policy drop; }'
  9. Save the ruleset so that it loads at boot, for example in /etc/nftables.conf.
  10. Set the gateway that you give to the Cloudera Cloud Core external network (the Gateway IP field in the installer) to the bastion address on the external VLAN, never to the old fabric gateway address.

    The network service stores the gateway address when it creates the external subnet.