Skip to content

internet

Part of the clan networking abstraction to define how to reach machines from outside the clan network over the internet, if defined has the highest priority

System
Network

Experimental

This service is experimental and will change in the future.


This module is part of Clan's networking interface.

Clan's networking module automatically manages connections across available network transports and falls back intelligently. When you run clan ssh or clan machines update, Clan attempts each configured network in priority order until a connection succeeds.

The example below shows how to configure a domain so server1 is reachable over the clearnet. By default, the internet module has the highest priority among networks.

  inventory.instances = {
        # Direct SSH with fallback support
        internet = {
            roles.default.machines.server1 = {
                settings.host = "server1.example.com";
                # settings.port defaults to 22, settings.user defaults to null (uses "root")
            };
            roles.default.machines.server2 = {
                settings.host = "192.168.1.100";
                settings.port = 45621;  # custom SSH port
                settings.user = "admin";  # custom SSH user
            };
        };
};

Roles

The internet service has the following roles:

  • default

Options for the default role

host

ip address or hostname (domain) of the machine

Type: string

Default:

""

Declared in: clanServices/internet/default.nix

jumphosts

optional list of jumphosts to use to connect to the machine

Type: list of string

Default:

[ ]

Declared in: clanServices/internet/default.nix

port

SSH port to connect to the machine.

Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Default:

22

Declared in: clanServices/internet/default.nix

user

SSH user to connect as. Defaults to root if not specified.

Type: null or string

Default:

null

Declared in: clanServices/internet/default.nix