Network

Default gateway

This page applies to:

  • HAProxy ALOHA - all versions

You can specify the default gateway that will allow your HAProxy ALOHA appliance to communicate with devices outside its subnet.

Set the default gateway through the web UI Jump to heading

To set a network interface’s default gateway by using the web UI:

  1. Before beginning, be sure to:

    • [VM appliance] Create a snapshot of your VM.

    • [Hardware appliance] Make sure you can connect to your appliance through the serial port.

      If you specify an invalid IP address for the default gateway, you may not be able to log in to your appliance through SSH or display the web UI.

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

    Interface Setup

  3. Specify the default gateway through the ip route default directive.

    For example, to use the router whose IP address is 172.16.24.1 as the default gateway:

    haproxy
    service network eth0
    ip address 172.16.24.237/255.255.255.0
    ip route default 172.16.24.1
    haproxy
    service network eth0
    ip address 172.16.24.237/255.255.255.0
    ip route default 172.16.24.1
  4. Optional: If you configure multiple network interfaces, for example eth0 and eth1, each with a different default gateway via ip route default, then assign a metric value to each one to indicate their order of preference. The default gateway with the lowest metric value has the highest priority and will be chosen when routing to destinations outside the network. If metric is not set, it defaults to 0.

    haproxy
    service network eth0
    ip address 172.16.24.237/255.255.255.0
    ip route default 172.16.24.1 metric 10
    haproxy
    service network eth0
    ip address 172.16.24.237/255.255.255.0
    ip route default 172.16.24.1 metric 10

    Policy-based routing

    Beginning in HAProxy ALOHA 16.5, you can also use policy-based routing to set default routes on each interface.

  5. Click OK and Close to return to the Services tab.

  6. Reload the network interface or the whole network service.

    Version > 16.0

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

  7. To check the default gateway, go to the Tools tab and click Launch a terminal. Then run netstat -r.

    nix
    netstat -r
    nix
    netstat -r
    output
    text
    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface
    default 172.16.24.1 0.0.0.0 UG 0 0 0 eth0
    172.16.24.0 * 255.255.255.0 U 0 0 0 eth0
    output
    text
    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface
    default 172.16.24.1 0.0.0.0 UG 0 0 0 eth0
    172.16.24.0 * 255.255.255.0 U 0 0 0 eth0
  8. To make your changes persistent after a reboot, click the Setup tab. Then click Save under Configuration.

Set the default gateway through the Network Management CLI Jump to heading

This section applies to:

  • HAProxy ALOHA 16.5 and newer

To set a network interface’s default gateway by using the Network Management CLI:

  1. Before beginning, be sure to:

    • [VM appliance] Create a snapshot of your VM.

    • [Hardware appliance] Make sure you can connect to your appliance through the serial port.

      If you specify an invalid IP address for the default gateway, you may not be able to log in to your appliance through SSH or display the web UI.

  2. If you have not already done so, install the Network Management CLI.

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

  4. 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
  5. Using the connection profile’s ID, modify your existing network interface to set the default gateway IP address. Use the netctl connection modify and netctl connection up commands.

    nix
    sudo netctl connection modify ethernet-eth0 \
    ipv4.gateway 172.16.24.1
    sudo netctl connection up ethernet-eth0
    nix
    sudo netctl connection modify ethernet-eth0 \
    ipv4.gateway 172.16.24.1
    sudo netctl connection up ethernet-eth0
    output
    text
    # Stopping network[eth0] ...
    ==> stop network[eth0] : Done.
    # Starting network[eth0] ...
    ==> start network[eth0] : Done.
    ==> load ip config network[eth0] : Done.
    Connection successfully activated
    output
    text
    # Stopping network[eth0] ...
    ==> stop network[eth0] : Done.
    # Starting network[eth0] ...
    ==> start network[eth0] : Done.
    ==> load ip config network[eth0] : Done.
    Connection successfully activated
  6. Save the configuration to make your changes persistent after a reboot:

    nix
    sudo config save
    nix
    sudo config save

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