1 Reply Latest reply on Apr 16, 2015 10:27 AM by Tomaz Cerar

    [Jboss:7.2.0] Using hostname in standalone.xml when host is having multiple NICs

    Umesh Kudale Newbie

      I am using jboss 7.2.0 with Windows Server 2012 R2. I have specified hostname in standalone.xml as follows:

      <interfaces>
        
      <interface name="management">
             
      <inet-address value="abc.xyz.com"/>
        
      </interface>
        
      <interface name="public">
             
      <inet-address value="abc.xyz.com"/>
        
      </interface>
        
      <interface name="unsecure">
             
      <inet-address value="abc.xyz.com"/>
        
      </interface>
      </interfaces>


      The host 'abc.xyz.com' is having 2 ethernet NICs having different IP addresses say IP1 and IP2. When I start jboss it always binds to IP2 but I want it to bind to IP1. I know we can directly provide IP address in standalone.xml but I don't want to do that since we use DHCP so IP cannot be static. Also if the NIC with IP1 is disabled, jboss will automatically connect to IP2. But when both the NICs are enabled, I want jboss to pick IP1 on priority.

      I tried this to make NIC with IP1 as primary NIC. I saw ipv4 route table and ipconfig which listed NIC with IP1 as primary NIC. I rebooted several times. nslookup also lists NIC with IP1 at the top.Ping abc.xyz.com is giving reply from IP1 only. However I am not getting why jboss is always resolving hostname to IP2. Can anyone please advice on what should be done so that jboss picks up IP1 when hostname is provided in standalone.xml?