title: How to configure JMX to bind to localhost only?
body: <p>I run Tomcat8 using JDK8 on Centos6.
  I enable JMX using the following options:</p>
  
  <pre><code>CATALINA_OPTS="${CATALINA_OPTS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9123 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=true"
  </code></pre>
  
  <p>Unfortunately, when I check what ports are opened I discover that these ports listen to all IP:</p>
  
  <pre><code>netstat -plunt | grep java
  Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
  tcp        0      0 :::60555                            :::*                LISTEN      22752/java
  tcp        0      0 ::ffff:127.0.0.1:8080               :::*                LISTEN      22752/java
  tcp        0      0 :::9123                             :::*                LISTEN      22752/java
  tcp        0      0 :::40867                            :::*                LISTEN      22752/java
  </code></pre>
  
  <p>I suppose that if I configure <code>-Dcom.sun.management.jmxremote.local.only=true</code> all ports should be bind to localhost only (<code>::ffff:127.0.0.1</code> will appear before all ports).</p>
  
  <p>How to configure JMX to bind to localhost only?</p>
  
  <p><strong>Added</strong></p>
  
  <p>I do not create JMX I use Tomcat JMX: <code>https://tomcat.apache.org/tomcat-8.0-doc/monitoring.html</code>. </p>