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 Jump to heading
Use one of the following tabbed methods to set the default gateway:
To set a network interface’s default gateway by using the web UI:
-
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.
-
-
In the Services tab, click network instance setup next to a network interface.

-
Specify the default gateway through the
ip route defaultdirective.For example, to use the router whose IP address is
172.16.24.1as the default gateway:haproxyservice network eth0ip address 172.16.24.237/255.255.255.0ip route default 172.16.24.1haproxyservice network eth0ip address 172.16.24.237/255.255.255.0ip route default 172.16.24.1 -
Optional: If you configure multiple network interfaces, for example
eth0andeth1, each with a different default gateway viaip route default, then assign ametricvalue to each one to indicate their order of preference. The default gateway with the lowestmetricvalue has the highest priority and will be chosen when routing to destinations outside the network. Ifmetricis not set, it defaults to0.haproxyservice network eth0ip address 172.16.24.237/255.255.255.0ip route default 172.16.24.1 metric 10haproxyservice network eth0ip address 172.16.24.237/255.255.255.0ip route default 172.16.24.1 metric 10Beginning in HAProxy ALOHA 16.5, you can also use policy-based routing to set default routes on each interface.
-
Click OK and Close to return to the Services tab.
-
Reload the network interface or the whole network service.
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.
-
To check the default gateway, go to the Tools tab and click Launch a terminal. Then run
netstat -r.nixnetstat -rnixnetstat -routputtextKernel IP routing tableDestination Gateway Genmask Flags MSS Window irtt Ifacedefault 172.16.24.1 0.0.0.0 UG 0 0 0 eth0172.16.24.0 * 255.255.255.0 U 0 0 0 eth0outputtextKernel IP routing tableDestination Gateway Genmask Flags MSS Window irtt Ifacedefault 172.16.24.1 0.0.0.0 UG 0 0 0 eth0172.16.24.0 * 255.255.255.0 U 0 0 0 eth0 -
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 set a network interface’s default gateway by using the Network Management CLI:
-
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.
-
-
If you haven’t already done so, install the Network Management CLI.
-
Go to the Tools tab and click Launch terminal.
-
Use the
netctl connection showcommand to show existing connection profiles. From the output, get theIDto use in subsequent commands.nixsudo netctl connection shownixsudo netctl connection showoutputtextID UUID TYPE DEVICEethernet-eth0 b6a82f6f-3fdd-467f-b2a1-9e343ba66288 ethernet eth0ethernet-eth1 8805fda9-b1a7-4d5c-bd83-615ceb9e9fdd ethernet eth1outputtextID UUID TYPE DEVICEethernet-eth0 b6a82f6f-3fdd-467f-b2a1-9e343ba66288 ethernet eth0ethernet-eth1 8805fda9-b1a7-4d5c-bd83-615ceb9e9fdd ethernet eth1 -
Using the connection profile’s
ID, modify your existing network interface to set the default gateway IP address. Use thenetctl connection modifyandnetctl connection upcommands.nixsudo netctl connection modify ethernet-eth0 \ipv4.gateway 172.16.24.1sudo netctl connection up ethernet-eth0nixsudo netctl connection modify ethernet-eth0 \ipv4.gateway 172.16.24.1sudo netctl connection up ethernet-eth0outputtext# Stopping network[eth0] ...==> stop network[eth0] : Done.# Starting network[eth0] ...==> start network[eth0] : Done.==> load ip config network[eth0] : Done.Connection successfully activatedoutputtext# Stopping network[eth0] ...==> stop network[eth0] : Done.# Starting network[eth0] ...==> start network[eth0] : Done.==> load ip config network[eth0] : Done.Connection successfully activated -
Save the configuration to make your changes persistent after a reboot.
nixsudo config savenixsudo config save
To set a network interface’s default gateway by using the config command:
-
Connect to the appliance as user
adminwith the passwordadminthrough:- 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.
- SSH at
-
Become the
rootuser.nixrootnixroot -
Set up the default gateway with the
configcommand.nixconfig set network.eth0 ip-route-default <GATEWAY>nixconfig set network.eth0 ip-route-default <GATEWAY>Example:
nixconfig set network.eth0 ip-route-default 172.16.24.1nixconfig set network.eth0 ip-route-default 172.16.24.1 -
Restart the
networkservice.nixservice network restartnixservice network restart -
Save the configuration to make your changes persistent after a reboot.
nixconfig savenixconfig save