# Add a site

_For tartan 0.9.36._

A site is a LAN your organization reaches through its own gateways: an office, a warehouse, a plant floor.

A site is a LAN your organization reaches through its own gateways: an office, a warehouse, a plant floor.

Computers that run the Tartan agent need no site: they join the network directly. A site is for the LAN around
them, and for the printers, servers and appliances on it that can't run an agent.

You need the Owner or Admin role.

## 1. Name the site and its LAN ranges

In the console, open **Sites** and choose **Add a site**. Enter its **Name** and its **LAN ranges**, then choose
**Add site**. A name alone needs no passkey; with LAN ranges, your passkey approves it when it steps up.

With the CLI:

```sh
tartan site add --org acme --name warehouse --lan_cidrs 192.168.20.0/24
```

A site with several ranges lists them comma-separated: `--lan_cidrs 192.168.20.0/24,192.168.21.0/24`. Add
`--dry-run` to see the change without making it. When the command steps up, the CLI shows the change in words and
your passkey approves that exact change.

## 2. Set the LAN network card

The site's gateways reach the LAN through one network card. On a gateway built from Tartan's site node (the Linux virtual
machine Tartan builds gateways and relays from), that card is `eth0`. Set it before you build the first gateway:

```sh
tartan site set --org acme --site warehouse --lan_iface eth0
```

You can also set it in step 1:
`tartan site add --org acme --name warehouse --lan_cidrs 192.168.20.0/24 --lan_iface eth0`.

## Two sites on the same LAN range

Two sites both on 192.168.1.0/24? Join them as they are. Each resource gets its own address and a name. The second
site is accepted as it is: the hosts on the two LANs are reached by name through each site's gateways, never routed
to directly.

## Change a site's LAN ranges

In the console, open **Sites**, pick the site, choose **Edit LAN ranges**, then **Save**.

With the CLI, `--lan_cidrs` replaces the whole list:

```sh
tartan site set --org acme --site warehouse --lan_cidrs 192.168.20.0/24,192.168.21.0/24
```

A range can't be dropped while a NAT resource's LAN address is inside it. Each site also holds a block of IPv6 NAT
addresses for its resources. That block is fixed for the site's life.

## Check it worked

```sh
tartan site list --org acme
```

The site is listed with its name and LAN ranges. In the console, **Sites** shows each site with its LAN ranges, its
gateways and its NAT resources. A site with no gateway yet reads **no gateway**.

## Next

- [Gateways in pairs](gateway-pairs.md): nothing on the site's LAN is reachable until a gateway is up.
- [Printers and legacy systems](legacy-systems.md)
- [Site relays](site-relays.md)
