For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

You are reading Connectivity Gateway 1.8, an older release. The newest release is 1.12. Read this page in 1.12

Imperative IP configuration

This tutorial explains how to configure IP-related entities, such as addresses, interfaces, or tunnels using a shell script. This is the preferred way for setting up IP addresses, GRE tunnels, and VTI devices.

The initialisation script runs as the last init container, after VXLAN interfaces are attached to the pod.

Add IP address to the interface

To start with a simple example, add IP addresses to an interface that already exists in the pod on startup. This is an example of one simple configuration:

yaml

In the second line, the module to run an initialisation script on startup is enabled. Under the initScript.env parameter, you can set the environment variables. They can be used in the script itself.

It is highly recommended to make use of environment variables for configuration data, as it makes it is easier to copy the script itself for multiple deployments. If one variable is used multiple times, the actual value must be changed only in one place.

Shell script

In the initScript.script parameter, provide a shell script as a long block string. The script must be a POSIX shell script, as bash is not supported. You can use every program that is installed in the network tools container.

In this example, the first line sets the shell to output the commands that are executed (set -x). It also sets it to check if all environment variables are set, or to fail otherwise (set -e). Lastly, the parameter fails the whole script if one of the commands fails and does not continue with further settings (set -u).

After that, the actual shell script follows. In this case, a message is written to the output for debugging using the echo command.

In the second last line, the ip command is used to add the IPv4 address to the device. This is the standard command used on modern Linux distributions. In the last line, add -6 to most ip commands operating with IPv6 addresses.

Add IP route to the interface

In the second example, add static routes to an existing interface:

yaml

In this example, the only difference is the last line in which ip route is used to add a route to the kernels routing table. Like in the previous example, you must use ip -6 to add routes to the IPv6 routing table.

Change MTU of interfaces

If you have to change the MTU of interfaces manually, add the following parts to the init script:

yaml

Disable offloading for NICs

To disable offloading of the network cards, add the following parts to the init script:

yaml