Software Event Broker Host Interface Configuration
The default behavior for a Solace PubSub+ software event broker machine image in a hypervisor is to dynamically receive its IP address configuration from the host. Alternatively, you can also manually associate an IP interface with a host OS physical interface through Solace CLI or configuration keys. However, before any host OS physical interface can be used by the event broker, it first must be configured on the host.
The following sections provide examples that show how host interfaces can be configured for eventual use by a PubSub+ software event broker.
In the examples that follow, it is assumed that you are logged into the host as root
.
Configuring Interfaces with Static IP Addresses
Solace PubSub+ software event brokers support only a single network interface. Configuring multiple interfaces using the following procedure is not supported.
To configure an interface with a static IP address on the software event broker host, for eventual use in software event broker configuration, specify the following environment variables in the /etc/sysconfig/network-scripts/ifcfg-<intf>
file:
DEVICE=<intf>
BOOTPROTO=none
ONBOOT=yes
IPADDR=<ip-addr>
NETMASK=<mask>
For example, to assign the interface eth0
an IP address of 192.168.40.220
and a mask of 255.255.255.0
, edit the /etc/sysconfig/network-scripts/ifcfg-eth0
file as follows.
DEVICE=eth0 BOOTPROTO=none ONBOOT=yes IPADDR=192.168.40.220 NETMASK=255.255.255.0
Optionally, you may wish to add an IPv6 address for use by clients connecting in using the IPv6 address space. Note that IPv6 is only supported for client messaging protocols and is not supported in for other broker administrative or control type connections.
To add an IPv6 address of XXXX::XXXX
and a mask of XXXX::XXXX
, edit the /etc/sysconfig/network-scripts/ifcfg-eth0
file as follows.
IPV6INIT=yes IPV6ADDR_SECONDARIES=XXXX:XXXX/X
After saving the changes to the ifcfg-eth0
file, the interfaces, or the network service, needs to be restarted for the changes to take effect.
Using systemctl
commands to restart the network service is not sufficient. For the changes to take effect, either use ifdown
and ifup
commands or reboot the event broker. In addition, because the ifdown
command causes the network connection to go down until you issue the ifup
command, we recommend that you issue these commands in a console terminal.
For example:
ifdown eth0 ifup eth0
After the network configuration has changed you must use the newly configured IP address to reconnect to the broker.
Also, you must disable the cloud-init network module. To do so, confirm that the /etc/cloud/cloud.cfg.d/99_network.cfg
file contains the following content:
network: config: disabled
- If the
/etc/cloud/cloud.cfg.d/99_network.cfg
file does not exist, you must create it. - Spacing is important. Do not remove or add any additional spaces in the
/etc/cloud/cloud.cfg.d/99_network.cfg
file.
Default Gateway Configuration
To configure a gateway as the default for use by all interfaces, add the gateway to /etc/sysconfig/network
by editing the file with sudo vi
.
NOZEROCONF=yes GATEWAY=192.168.40.1
After making the above change, the network service, needs to be restarted for the changes to take effect.
Using systemctl
commands to restart the network service is not sufficient. For the changes to take effect, either use ifdown
and ifup
commands or reboot the event broker. In addition, because the ifdown
command causes the network connection to go down until you issue the ifup
command, we recommend that you issue these commands in a console terminal.
For example:
ifdown eth0 ifup eth0
After the network configuration has changed you must use the newly configured IP address to reconnect to the broker.
Default Gateway & Static Routes Configuration
Static routes associated with an interface <intf>
are stored in the file /etc/sysconfig/network-scripts/route-<intf>
.
Optionally, a default gateway can be defined on the first line of the route-<intf>
file. For example, consider the construction of the file for <intf> = eth0
. If the IP address of the default gateway is 192.168.40.1
, and the interface that can reach the default gateway is also eth0
, then the first line of /etc/sysconfig/network-scripts/route-eth0
is.
default via 192.168.40.1 dev eth0
Static routes are defined by adding lines to /etc/sysconfig/network-scripts/route-<intf>
that are of the form,
X.X.X.X/X via Y.Y.Y.Y dev interface
Where X.X.X.X/X
is the destination address, and Y.Y.Y.Y
and interface
are the address and interface respectively through which X.X.X.X/X
can be reached.
Continuing with the example, if 10.10.10.0/24
can be reached through the eth0
interface, assigned 10.10.10.1
, in the 10.10.10.0/24
subnet, then add this line for the static route to /etc/sysconfig/network-scripts/route-eth0
.
10.10.10.0/24 via 10.10.10.1 dev eth0
So, in this example, the complete static route file /etc/sysconfig/network-scripts/route-eth0
file is,
default via 192.168.40.1 dev eth0 10.10.10.0/24 via 10.10.10.1 dev eth0
After making the above change, the interfaces, or the network service, needs to be restarted for the changes to take effect.
Using systemctl
commands to restart the network service is not sufficient. For the changes to take effect, either use ifdown
and ifup
commands or reboot the event broker. In addition, because the ifdown
command causes the network connection to go down until you issue the ifup
command, we recommend that you issue these commands in a console terminal.
For example:
ifdown eth0 ifup eth0
After the network configuration has changed you must use the newly configured IP address to reconnect to the broker.
Alternative DNS Server Configuration
To specify the use of alternative DNS servers, edit the host's /etc/resolv.conf
file. For example, to add the DNS server 185.121.177.53
, add the following line to the host's /etc/resolv.conf
file:
nameserver 185.121.177.53
If your situation involves having static DNS when using DHCP, you'll need to append the following to /etc/dhcp/dhclient-enter-hooks
to disable DHCP from overwriting DNS.
make_resolv_conf(){
:
}
Then enter.
chmod +x /etc/dhcp/dhclient-enter-hooks
The event broker must be restarted to pick up changes to the host's /etc/resolv.conf
file. After editing the file, the event broker can be restarted as follows:
solacectl service restart