Network configuration of the nodes

Network configuration of the nodes

The network configuration is handled by Network-Manager. The command line utility that a user should use to tweak the network configuration is nmcli.

Always use nmcli to change the network configuration on a node, not /etc/network/interfaces or the ip ... command. If you choose to not use nmcli do it at the risk of breaking some functionnalities. {.is-danger}

Default network behavior

The node should be connected to the local network through the LAN1 interface. LAN2 is reserved for connections to lidars.

When connecting the node to a network with a DHCP server running (which is the default behavior on almost all routers), the node will automatically take the IP address it was given by the router. If for an extended period of time it was not given an IP address by a router, if will fall back to a link local address.

Default configuration

By default on each node shipped, there are 3 connections set up:

  • enp1s0-auto : default option on LAN1, a dhcp connection (automatically get an IP from the local router)

  • enp1s0-ll : a fallback to link local address range, if the node can not get an IP from DHCP after some time

  • enp2s0-auto : default option on LAN2, a dhcp connection (automatically get an IP from the local router)

Note : when defaulting to link local, the node takes an address in the 169.254.0.0/16 range. A user should be able to find it through AugmentaFusion (or a Zeroconf browser).

Permissions

The augmenta user can call the nmcli command. This was done through Polkit.

Manual IP configuration

If for some reason you want to set a static IP for a node, follow the instructions below. Note that they include a safeguard in case the node is not joinable on the IP address you have set. The scenario below is for a node that is connected on the 192.168.50.0/24 network through DHCP and we want to set its IP to 192.168.50.88 and with a router at 192.168.50.254.

  1. connect to the node through SSH (user : augmenta, password: augmenta78)

ssh [email protected]

  1. add a connection

nmcli connection add con-name enp1s0-static type ethernet ifname enp1s0 autoconnect yes ip4 192.168.50.88/24 gw4 192.168.50.254

  1. change the new connection's priority value lower than the default "-auto" one (so if you screwed up, reboot the node and it will come back through the *-auto connection. Be careful to set the priority lower than the link-local connection (default to 50). So for example use a priority value of 40.

nmcli connection modify enp1s0-static connection.autoconnect-priority 40

  1. double check that the *-auto and link-local connections for your interface have higher priorities (interface = enp1s0, connection.autoconnect yes, connection.autoconnect-priority = 100 for example)

nmcli con show enp1s0-auto enp1s0-ll | grep connection.autoconnect-priority

Command line result:

connection.autoconnect-priority: 100 connection.autoconnect-priority: 50

They are above the 40 value we set for our new connection, we are fine.

  1. Set the new static connection up

nmcli connection up enp1s0-static

  1. Check that the node is accessible through the new static IP address you just set

If it is accessible, change the (new) static connection priority above the default *-auto DHCP connection. For example set it to 120:

nmcli connection modify enp1s0-static connection.autoconnect-priority 120

If it is not joinable, reboot the node (through the power button, or by cutting and putting back the power to it). It should come back through the default *-auto / DHCP connection, and check what you have done wrong.

Do not skip the step above, otherwise the node will use the DHCP connection after the next reboot.

If needed, you can delete a connection by running the following command line (this example deletes enp1s0-static):

nmcli connection delete enp1s0-static

Last updated