---
title: Charmhub | Deploy Advanced Routing using Charmhub - The Open Operator Collection
description: Deploy the latest version of Advanced Routing on any cloud.
url: https://charmhub.io/advanced-routing/docs/t-getting-started
---

# Advanced Routing

[Llama (LMA) Charmers](https://charmhub.io/publisher/llama-charmers "View all packages from Llama (LMA) Charmers")

* [Llama (LMA) Charmers](https://charmhub.io/publisher/llama-charmers "View all packages from Llama (LMA) Charmers")

Platform:

26.04

24.04

22.04

20.04

18.04

stable b5c9100-dirty

```
juju deploy advanced-routing
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# Basic usage

Add to an existing application using juju-info relation.

Example:

```
juju deploy advanced-routing
juju add-relation ubuntu advanced-routing
```

The user can configure the following parameters:

* `enable-advanced-routing`: Enable routing. This requires for the charm to have routing information configured in JSON format: `juju config advanced-routing --file path/to/your/config`
* `advanced-routing-config` parameter contains 3 types of entities: ‘table’, ‘route’, ‘rule’. The ‘type’ parameter is always required.

table: routing table to put the rules in (used in rules)

route: defines a static route with the following params:

* default\_route: should this be a default route or not (boolean: true|false) (optional, requires gateway and table)
* net: IPv4 CIDR for a destination network (string) (mutually exclusive with default\_route, and requires gateway or device)
* gateway: IPv4 gateway address (string) (either device or gateway is required)
* table: routing table name (string) (optional, except if default\_route is used)
* metric: metric for the route (int) (optional)
* device: device (interface) (string) (either device or gateway is required)

rule:

* from-net: IPv4 CIDR source network or “all” (string) (required)
* to-net: IPv4 CIDR destination network or “all” (string) (optional)
* table: routing table name (string) (optional, default is main)
* priority: priority (int) (optional)

An example yaml config file below:

```
settings:
  advanced-routing-config:
    value: |-
      [ {
          "type": "table",
          "table": "SF1"
      }, {
          "type": "route",
          "default_route": true,
          "gateway": "10.191.86.2",
          "table": "SF1",
          "metric": 101,
          "device": "eth0"
      }, {
          "type": "route",
          "net": "6.6.6.0/24",
          "gateway": "10.191.86.2"
      }, {
          "type": "rule",
          "from-net": "192.170.2.0/24",
          "to-net": "192.170.2.0/24",
          "table": "SF1",
          "priority": 101
      } ]
  enable-advanced-routing:
    value: true
```

The `example_config.yaml` file is also provided with the codebase.

**Note:** the `from-net` parameter refers not to the tcp conversation, but to
the individual packet path. I.e., if a reply from our host to a remote host is
from the interface with address 192.170.2.4, regardless of destination, that
would trigger the rule when we state `"from-net": "192.170.2.0/24"`.

---
