Configure static routes

Configure static routes on the sensor using the text console. Static routes are stored in the system configuration and applied automatically at boot. The command applies only to the sensor where you run it and does not affect other sensors.

Show all configured static routes

Product Guardian
Syntax n2os-netconf routes --show
Description Shows all configured static routes, including the default gateway and any named static routes, with their type, destination, and gateway.
Parameters None
Where The text-console (access directly or through )
To apply Enter the command and press enter.

Add a network static route

Product Guardian
Syntax n2os-netconf routes --set --name NAME --net NETWORK/CIDR --gateway IP
Description

Adds or updates a static route for the specified destination network. The route is written to the system configuration and applied immediately to the running routing table.

If a route with the same name already exists, the command shows the current and new values and prompts for confirmation before overwriting.

Parameters
  • --name NAME: The route identifier. Must start with a letter and contain only letters, digits, and underscores. For example: myRoute or corp_network
  • --net NETWORK/CIDR: The destination network in CIDR notation. Host bits must be zero. For example: 203.0.113.0/24 or 2001:db8::/64
  • --gateway IP: The next-hop gateway address. Must be in the same version as the destination (IPv4 or IPv6). For example: 192.0.2.1 or 2001:db8::1; for link-local IPv6 gateways, include the interface scope, for example: fe80::1%em0
Where The text-console (access directly or through ). User must have root privileges.
To apply Enter the command and press enter. If the route already exists, confirm the overwrite when prompted.

Add a host static route

Product Guardian
Syntax n2os-netconf routes --set --name NAME --host IP --gateway IP
Description

Adds or updates a static route to a single host address. The route is written to the system configuration and applied immediately to the running routing table.

If a route with the same name already exists, the command shows the current and new values and prompts for confirmation before overwriting.

Parameters
  • --name NAME: The route identifier. Must start with a letter and contain only letters, digits, and underscores. For example: hostRoute
  • --host IP: The destination host address. For example: 203.0.113.5 or 2001:db8::5
  • --gateway IP: The next-hop gateway address. Must be in the same version as the destination. For example: 192.0.2.1 or 2001:db8::1
Where The text-console (access directly or through ). User must have root privileges.
To apply Enter the command and press enter. If the route already exists, confirm the overwrite when prompted.

Delete a static route

Product Guardian
Syntax n2os-netconf routes --delete NAME
Description Deletes a static route by its name. The route is removed from the system configuration and from the running routing table. The command shows the route details and prompts for confirmation before deleting.
Parameters NAME: The name of the route to delete. For example: myRoute
Where The text-console (access directly or through ). User must have root privileges.
To apply Enter the command and press enter. Confirm the deletion when prompted.