Bookmark this page

Configuring Interfaces and Socket Binding Groups

Objectives

  • Configure JBoss EAP network interfaces and socket binding groups

Interfaces

An interface is a logical name for a network interface, IP address, or host name to which a socket can be bound. The <interfaces> element in the XML configuration file is used to define an interface by using the <interface> child element. For example, the <interfaces> section defined in the default standalone.xml configuration file looks like the following:

<interfaces>
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
        </interface>
        <interface name="public">
            <inet-address value="${jboss.bind.address:127.0.0.1}"/>
        </interface>
</interfaces>

Note

Properties defined with the $ character and curly braces are system runtime properties. If the runtime property is not defined, then the value after the colon is the default value.

There are two pre-defined interfaces, although you can add as many interfaces as necessary, based on the particular network and hardware. The default value of each interface is 127.0.0.1, which represents the loopback network interface, localhost. By binding to localhost, as a security feature, a default installation of JBoss EAP is not exposed to the outside world. The management interface is separated from the public interface.

You can configure the IP address for accessing the management console, when starting JBoss EAP, by using the -bmanagement command line variable. For example:

$ ./standalone.sh -bmanagement 127.0.0.1

The purpose of the <interfaces> element is to provide a single location to define physical addresses used in an environment, and then refer to those physical addresses as many times as needed throughout the configuration file. Do not specify ports or protocols here. Those details get defined later in the socket binding groups.

The name of the interface can be any value and there are various options for defining interfaces. If a host has multiple Network Interface Cards (NICs) with multiple IP addresses and only a certain NIC should be exposed, then use the first of the following interface configurations. If all the network interfaces need to be exposed, then use the second interface configuration.

<interfaces>
    <interface name="my_ip_address">
        <inet-address value="128.164.0.15"/>
    </interface>
</interfaces>

The following interface uses the wildcard any-address to bind to any and all IP addresses available on the server:

<interfaces>
    <interface name="global">
        <any-address/>
    </interface>
</interfaces>

The preceding interface demonstrates the use of an interface criteria, which is used at runtime to determine what IP address to use for an interface. The following interface also uses a criteria that binds only to an IPv4 address:

<interfaces>
    <interface name="ipv4-global">
        <any-ipv4-address/>
    </interface>
</interfaces>

Criteria can be combined to be very specific about an interface definition. For example, the following interface defines a specific subnet that supports multicast. The address must be up, and cannot be point-to-point:

<interfaces>
    <interface name="my_specific_interface">
        <subnet-match value="192.168.0.0/16"/>
        <up/>
        <multicast/>
        <not>
            <point-to-point/>
        </not>
    </interface>
</interfaces>

On a Linux™ environment, users can define an interface for a specific network card:

<interface name="internal">
    <nic name="eth1"/>
</interface>

Socket Binding Groups

A socket binding group is a named collection of socket bindings, which allows you to define all of the ports needed for a JBoss EAP instance. A socket binding group is defined by using the <socket-binding-group> element, which consists of a collection of <socket-binding> child elements. For example, the following is the default socket binding group defined in the standalone.xml file:

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
        <socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
        <socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
        <socket-binding name="http" port="${jboss.http.port:8080}"/>
        <socket-binding name="https" port="${jboss.https.port:8443}"/>
        <socket-binding name="txn-recovery-environment" port="4712"/>
        <socket-binding name="txn-status-manager" port="4713"/>
        <outbound-socket-binding name="mail-smtp">
            <remote-destination host="localhost" port="25"/>
        </outbound-socket-binding>
</socket-binding-group>

The name of this socket binding group is standard-sockets, but you can use any name when defining a socket binding group. The default-interface attribute must be set to a named interface defined in the <interfaces> section. Each <socket-binding> entry has a protocol name and a port number. Notice that the <socket-binding> can also define an interface attribute that points to an <interface> definition.

The port-offset element enables you to modify all the port numbers by specifying a positive offset value. This is especially convenient in situations where multiple instances of JBoss EAP are running on the same host. Notice that you can define the port-offset by using the jboss.socket.binding.port-offset runtime property. This enables you to provide the port-offset as a property when starting the server.

References

For more information about network interfaces, and socket bindings in JBoss EAP, refer to the Network and Port Configuration chapter in the Configuration Guide in the Red Hat JBoss EAP 7 documentation at https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index#network_and_port_configuration

Revision: ad248-7.4-18a9db2