Network

Add IP static routes

This page applies to:

  • HAProxy ALOHA - all versions

You can add manually configured routing entries to your appliance.

To add a static route by using the web UI:

  1. In the Services tab, click network instance setup next to a network interface.

    Interface Setup

  2. Add a static route through the following syntax:

    ip route <ip/mask> <gateway>
    ip route <ip/mask> <gateway>

    Example:

    service network eth0 ip address 192.168.1.11/24 ip route 10.0.0.0/24 192.168.1.1
    service network eth0 ip address 192.168.1.11/24 ip route 10.0.0.0/24 192.168.1.1
  3. Click OK and Close to return to the Services tab.

  4. Reload the network interface.

    In versions newer than 16.0, click the Apply new configuration button on the interface to apply the changes and automatically restart the network interface service.

  5. To make your changes persistent after a reboot, click the Setup tab. Then click Save under Configuration.

This method applies to HAProxy ALOHA 16.5 and newer

To add a static route by using the Network Management CLI:

  1. If you haven’t already done so, install the Network Management CLI.

  2. Go to the Tools tab and click Launch terminal.

  3. Use the netctl connection show command to show existing connection profiles. From the output, get the ID to use in subsequent commands.

    nix
    sudo netctl connection show
    nix
    sudo netctl connection show
    output
    text
    ID UUID TYPE DEVICE
    ethernet-eth0 b6a82f6f-3fdd-467f-b2a1-9e343ba66288 ethernet eth0
    ethernet-eth1 8805fda9-b1a7-4d5c-bd83-615ceb9e9fdd ethernet eth1
    output
    text
    ID UUID TYPE DEVICE
    ethernet-eth0 b6a82f6f-3fdd-467f-b2a1-9e343ba66288 ethernet eth0
    ethernet-eth1 8805fda9-b1a7-4d5c-bd83-615ceb9e9fdd ethernet eth1
  4. Using the connection profile’s ID, call netctl connection modify to modify your existing network interface to add the static route.

    • Set ipv4.method to manual, which lets you set IPv4 settings yourself instead of using DHCP.
    • Set ipv4.addresses to your static IP address.
    • Set ipv4.routes to "<ip/mask> <gateway>".
    nix
    netctl connection modify ethernet-eth0 \
    ipv4.method manual \
    ipv4.addresses 192.168.1.11/24 \
    ipv4.routes "10.0.0.0/24 192.168.1.1"
    nix
    netctl connection modify ethernet-eth0 \
    ipv4.method manual \
    ipv4.addresses 192.168.1.11/24 \
    ipv4.routes "10.0.0.0/24 192.168.1.1"

    To specify more than one route, separate them with a comma.

    nix
    netctl connection modify ethernet-eth0 \
    ipv4.method manual \
    ipv4.addresses 192.168.1.11/24 \
    ipv4.routes "10.0.0.0/24 192.168.1.1,10.1.0.0/24 192.168.1.2"
    nix
    netctl connection modify ethernet-eth0 \
    ipv4.method manual \
    ipv4.addresses 192.168.1.11/24 \
    ipv4.routes "10.0.0.0/24 192.168.1.1,10.1.0.0/24 192.168.1.2"
  5. Use netctl connection up to restart the network service.

    nix
    sudo netctl connection up ethernet-eth0
    nix
    sudo netctl connection up ethernet-eth0
    output
    text
    # Stopping network[eth0] ...
    ==> stop network[eth0] : Done.
    # Starting network[eth0] ...
    ==> Link configuration changed for interface eth0
    ==> start network[eth0] : Done.
    ==> load ip config network[eth0] : Done.
    output
    text
    # Stopping network[eth0] ...
    ==> stop network[eth0] : Done.
    # Starting network[eth0] ...
    ==> Link configuration changed for interface eth0
    ==> start network[eth0] : Done.
    ==> load ip config network[eth0] : Done.
  6. Save the configuration to make your changes persistent after a reboot.

    nix
    sudo config save
    nix
    sudo config save

To add a static route by using the config command:

  1. Connect to the appliance as user admin with the password admin through:

    • SSH at http://<IP Address>:4444/, or
    • the serial port.

    In version 13.5 and newer, you can also click Launch a terminal in the web UI’s Tools tab.

  2. Become the root user.

    nix
    root
    nix
    root
  3. Add a static route.

    nix
    config set network.<interface> <ip/mask> <gateway>
    nix
    config set network.<interface> <ip/mask> <gateway>

    Example:

    nix
    config set network.eth0 ip-route 10.0.0.0/24 192.168.1.1
    nix
    config set network.eth0 ip-route 10.0.0.0/24 192.168.1.1
  4. Restart the network service.

    nix
    service network restart
    nix
    service network restart
  5. Save the configuration to make your changes persistent after a reboot.

    nix
    config save
    nix
    config save

Do you have any suggestions on how we can improve the content of this page?