12 Replies Latest reply: Dec 16, 2012 8:01 AM by Nir A Branched to a new discussion. RSS

    listening on all interfaces

    Adrian Cole Newbie

      Sorry I didn't find this in the docs.  I'm sure it is there somewhere.

       

      What's the as7 equiv of the -b 0.0.0.0 commandline arg?

      -A

        • 1. Re: listening on all interfaces
          jaikiran pai Master

          Add a new interface under the interfaces section of standalone.xml with <any-address> element:

           

          <interfaces>
                  <interface name="management">
                      <inet-address value="127.0.0.1"/>
                  </interface>
                  <interface name="public">
                     <inet-address value="127.0.0.1"/>
                  </interface>
          
                 <!-- Equivalent of -b 0.0.0.0 -->
          
                    <interface name="any">
                         <any-address/>
                    </interface>
              </interfaces>
          

           

          and use this new interface in the socket-binding-group:

           

          <!-- Use the "any" interface -->
          <socket-binding-group name="standard-sockets" default-interface="any">
                  <socket-binding name="http" port="8080"/>
                  <socket-binding name="https" port="8443"/>
                  <socket-binding name="jmx-connector-registry" port="1090"/>
                  <socket-binding name="jmx-connector-server" port="1091"/>
                  <socket-binding name="jndi" port="1099"/>
                  <socket-binding name="osgi-http" port="8090"/>
                  <socket-binding name="remoting" port="4447"/>
                  <socket-binding name="txn-recovery-environment" port="4712"/>
                  <socket-binding name="txn-status-manager" port="4713"/>
              </socket-binding-group>
          

           

          The xsd can be found here

          • 2. Re: listening on all interfaces
            Prasad Deshpande Expert

            I've done the same

             

            <interfaces>
                    <interface name="management">
                        <inet-address value="127.0.0.1"/>
                    </interface>
                    <interface name="public">
                       <inet-address value="127.0.0.1"/>
                    </interface>
            
                   <!-- Equivalent of -b 0.0.0.0 -->
            
                      <interface name="any">
                           <any-address/>
                      </interface>
                </interfaces>
            

             

            and use this new interface in the socket-binding-group:

             

            <!-- Use the "any" interface -->
            <socket-binding-group name="standard-sockets" default-interface="any">
            

            <socket-binding name="http" port="8080"/>

            <socket-binding name="https" port="8443" />

            <socket-binding name="jacorb" port="3528"/>

            <socket-binding name="jacorb-ssl" port="3529"/>

            <socket-binding name="jndi" port="1099"/>

            <socket-binding name="messaging" port="5445"/>

            <socket-binding name="messaging-throughput" port="5455"/>

            <socket-binding name="remoting" port="4447"/>

            <socket-binding name="txn-recovery-environment" port="4712"/>

            <socket-binding name="txn-status-manager" port="4713"/>     </socket-binding-group>

             

            but I'm getting exception as :

             

            14:03:10,843 ERROR [org.apache.catalina.core.StandardService] (MSC service thread 1-1) Connector.start: LifecycleException:  service.getName(): "jboss.web";  Protocol handler start failed: java.net.SocketException: Protocol family not supported

             

            I tried keeping default-interface to public & tried adding interface to socket-binding tag, nothing different...

             

            Any guess?

            • 3. Re: listening on all interfaces
              jaikiran pai Master

              Is that the entire exception stacktrace? Can you post the console logs?

              • 4. Re: listening on all interfaces
                Prasad Deshpande Expert

                I've attached server.log. Could you please have a look?

                • 5. Re: listening on all interfaces
                  jaikiran pai Master

                  15:43:56,359 SEVERE [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-6) Failure in initialisation: org.jboss.netty.channel.ChannelException: Failed to bind to: /0:0:0:0:0:0:0:0:5455

                  The any-address I mentioned in my post refers to:

                  Empty element indicating that sockets using this interface

                                  should be bound to a wildcard address. The IPv6 wildcard

                                  address (::) will be used unless the java.net.preferIpV4Stack

                                  system property is set to true, in which case the IPv4

                                  wildcard address (0.0.0.0) will be used. If a socket is

                                  bound to an IPv6 anylocal address on a dual-stack machine,

                                  it can accept both IPv6 and IPv4 traffic; if it is bound to

                                  an IPv4 (IPv4-mapped) anylocal address, it can only accept

                                  IPv4 traffic.

                   

                  In your case, it's using IPv6. Try using any-ipv4-address element instead, as follows:

                   

                  <interfaces>
                          <interface name="management">
                              <inet-address value="127.0.0.1"/>
                          </interface>
                          <interface name="public">
                              <inet-address value="127.0.0.1"/>
                          </interface>
                  
                          <!-- IPv4 -->
                          <interface name="any">
                              <any-ipv4-address/>
                          </interface>
                      </interfaces>
                  
                     <!-- Use the any interface -->
                      <socket-binding-group name="standard-sockets" default-interface="any">
                          <socket-binding name="http" port="8080"/>
                          <socket-binding name="https" port="8443"/>
                          <socket-binding name="jmx-connector-registry" port="1090"/>
                          <socket-binding name="jmx-connector-server" port="1091"/>
                          <socket-binding name="jndi" port="1099"/>
                          <socket-binding name="osgi-http" port="8090"/>
                          <socket-binding name="remoting" port="4447"/>
                          <socket-binding name="txn-recovery-environment" port="4712"/>
                          <socket-binding name="txn-status-manager" port="4713"/>
                      </socket-binding-group>
                  
                  • 6. Re: listening on all interfaces
                    Prasad Deshpande Expert

                    Thanks Jaikiran, That worked!

                    • 7. Re: listening on all interfaces
                      daveryan Newbie

                      In addition to the new any-address element per Jaikiran's great examples, I've been informed that -b has been restored for AS 7.0.2.

                      • 8. Re: listening on all interfaces
                        jaikiran pai Master

                        That's right. Starting AS 7.0.2, the -b command line option has been reintroduced and also a new -bmanagement option has been introduced. See this http://jaitechwriteups.blogspot.com/2011/09/jboss-as-702-arc-released.html for more details.

                        • 9. Re: listening on all interfaces
                          Libor Krzyžanek Apprentice

                          Thanks,

                          works perfeclty.

                           

                          Libor

                          • 10. Re: listening on all interfaces
                            Nir A Newbie

                            Hi All,

                             

                            I have the following configurations in the standalone.xml file:

                            <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:0.0.0.0}"/>

                                    </interface>

                                    <interface name="unsecured">      

                                                                 <inet-address value="0.0.0.0" />   

                                                    </interface>

                                </interfaces>

                             

                             

                                <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

                                    <socket-binding name="http" port="8080"/>

                                    <socket-binding name="https" port="8443"/>

                                    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

                                    <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:9443}"/>

                                    <socket-binding name="osgi-http" interface="management" port="8090"/>

                                    <socket-binding name="remoting" port="4447"/>

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

                             

                            And I'm still not able to access the URL from outside.

                             

                            What am I doing wrong?

                             

                            Thanks in advance!

                            Nir

                            • 11. Re: listening on all interfaces
                              Nicklas Karlsson Master

                              Any firewalls etc that might interfere? Same result with the <any-address/> mentioned above?

                               

                              (you might want to start separate threads for your own issues)

                              • 12. Re: listening on all interfaces
                                Nir A Newbie

                                Hi,

                                 

                                 

                                Adding:

                                 

                                <interface name="any">

                                            <any-ipv4-address/>

                                        </interface>

                                 

                                And changing <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

                                to <socket-binding-group name="standard-sockets" default-interface="any">

                                 

                                Solved the issue.

                                 

                                Thanks everyone