Network

Assign IP addresses

This page applies to:

  • HAProxy ALOHA - all versions

On this page, you’ll learn how to manage IP addresses assigned to HAProxy ALOHA.

Assign a static IP address Jump to heading

You must assign a static internal IP address to your appliance. Use this IP address for managing the appliance. It can be different from the IP address used to receive incoming traffic. If you manage a pair of appliances, assign each one a different IP address so you can connect to each of them.

To assign a static IP address through the web UI:

  1. Connect to the web UI as user admin with the password admin at http://<IP Address>:4444/.

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

    Interface Setup

  3. Do one of the following:

    • Enter an IP address and a network mask, either class mask or CIDR format.

      Example:

      Network Interface Setup
      service network eth0 # Class mask format: ip address 172.16.24.237/255.255.255.0 # CIDR format: # ip address 172.16.24.237/24
      Network Interface Setup
      service network eth0 # Class mask format: ip address 172.16.24.237/255.255.255.0 # CIDR format: # ip address 172.16.24.237/24
    • Enter an IP address alias and a network mask, either class mask or CIDR format.

      Example:

      Network Interface Setup
      service network eth0 # Class mask format: ip address 172.16.24.237/255.255.255.0 ip address 172.16.24.238/255.255.255.255 # CIDR format: # ip address 172.16.24.237/24 # ip address 172.16.24.238/32
      Network Interface Setup
      service network eth0 # Class mask format: ip address 172.16.24.237/255.255.255.0 ip address 172.16.24.238/255.255.255.255 # CIDR format: # ip address 172.16.24.237/24 # ip address 172.16.24.238/32
  4. Click OK and Close to return to the Services tab.

  5. 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.

  6. 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 IP address via 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 of the connection profile 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 a new, static IP address.

    • 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.gateway to your default gateway’s IP address.
    nix
    sudo netctl connection modify ethernet-eth0 \
    ipv4.method manual \
    ipv4.addresses 172.16.24.237/24 \
    ipv4.gateway 172.16.24.1
    nix
    sudo netctl connection modify ethernet-eth0 \
    ipv4.method manual \
    ipv4.addresses 172.16.24.237/24 \
    ipv4.gateway 172.16.24.1

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

    nix
    sudo netctl connection modify ethernet-eth0 \
    ipv4.method manual \
    ipv4.addresses 172.16.24.237/24,172.16.24.238/24 \
    ipv4.gateway 172.16.24.1
    nix
    sudo netctl connection modify ethernet-eth0 \
    ipv4.method manual \
    ipv4.addresses 172.16.24.237/24,172.16.24.238/24 \
    ipv4.gateway 172.16.24.1
  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] ...
    ==> 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

To assign a static IP address 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. Set up the IP address for the network interface.

    nix
    config set network.<INTERFACE_NAME> ip-address <IP/NETMASK>
    nix
    config set network.<INTERFACE_NAME> ip-address <IP/NETMASK>

    Example:

    nix
    config set network.eth0 ip-address 172.16.24.237/24
    nix
    config set network.eth0 ip-address 172.16.24.237/24
  4. Restart the network service:

    nix
    service network restart
    nix
    service network restart
  5. Connect HAProxy ALOHA to your network via the network interface you configured.

  6. Ping HAProxy ALOHA.

  7. If the ping succeeds, save the configuration to make your changes persistent after a reboot.

    nix
    config save
    nix
    config save

Disable IPv6 on all network interfaces Jump to heading

To disable the IPv6 protocol on all network interfaces:

  1. In the Services tab, click network setup next to the network service to display the current configuration of your network interfaces.

    Interface Setup Bonding

  2. Add these lines to the first service network section:

    text
    sysctl ipv6.conf.all.disable_ipv6=1
    sysctl ipv6.conf.default.disable_ipv6=1
    text
    sysctl ipv6.conf.all.disable_ipv6=1
    sysctl ipv6.conf.default.disable_ipv6=1
  3. Click OK, then Close.

  4. Click Apply new configuration on service network.

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

  6. To verify, go to the Tools tab and click Launch terminal. The ip address command should return inet entries, but no inet6 entries.

    nix
    ip address
    nix
    ip address
    output
    text
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/9 scope host lo
    valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:a5:ad:4f brd ff:ff:ff:ff:ff:ff
    inet 192.168.56.45/24 scope global eth0
    valid_lft forever preferred_lft forever
    output
    text
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/9 scope host lo
    valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:a5:ad:4f brd ff:ff:ff:ff:ff:ff
    inet 192.168.56.45/24 scope global eth0
    valid_lft forever preferred_lft forever

Troubleshooting Jump to heading

This section describes common troubleshooting steps.

Duplicate IPs

To troubleshoot duplicate IPs, you can use the ARP who-has diagnostic tool.

This tool checks if the MAC address associated with the IP address is the one expected or not:

  • If yes, the problem may be on an upper layer

  • If not, the MAC address of the server has the duplicated IP

Ping

You can use the ping diagnostic tool to try to reach an IP address on the network.

See also Jump to heading

  • You can also configure a load balancer’s IP address using the HAProxy Data Plane API. For details, see Manage IP addresses.

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