![Matar un puerto de escucha para una IP específica](https://rvso.com/image/1520711/Matar%20un%20puerto%20de%20escucha%20para%20una%20IP%20espec%C3%ADfica.png)
Tengo un servidor SIP con múltiples interfaces de red. (virtual) Cuando ejecuto el comando, netstat -nlput
muestra todas las IP y puertos de escucha como se muestra a continuación.
root@DUO-CALLSERVER004:/etc/init.d# netstat -nlput
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 723/rpcbind
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 172.20.112.238:8021 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1835/sshd
tcp 0 0 0.0.0.0:5666 0.0.0.0:* LISTEN 1868/nrpe
tcp 0 0 172.20.112.118:5060 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 172.20.112.117:5060 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 172.20.112.114:5060 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 172.20.112.112:5060 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 172.20.112.110:5060 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 172.20.112.238:5060 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 172.20.112.111:5060 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 172.20.112.116:5060 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 172.20.112.115:5060 0.0.0.0:* LISTEN 21036/freeswitch
tcp 0 0 192.168.52.108:5060 0.0.0.0:* LISTEN 21036/freeswitch
tcp6 0 0 :::111 :::* LISTEN 723/rpcbind
tcp6 0 0 :::22 :::* LISTEN 1835/sshd
tcp6 0 0 :::5666 :::* LISTEN 1868/nrpe
udp 0 0 172.20.112.118:5060 0.0.0.0:* 21036/freeswitch
udp 0 0 172.20.112.117:5060 0.0.0.0:* 21036/freeswitch
udp 0 0 172.20.112.114:5060 0.0.0.0:* 21036/freeswitch
udp 0 0 172.20.112.112:5060 0.0.0.0:* 21036/freeswitch
udp 0 0 172.20.112.110:5060 0.0.0.0:* 21036/freeswitch
udp 0 0 172.20.112.238:5060 0.0.0.0:* 21036/freeswitch
udp 0 0 172.20.112.111:5060 0.0.0.0:* 21036/freeswitch
udp 0 0 172.20.112.116:5060 0.0.0.0:* 21036/freeswitch
udp 0 0 172.20.112.115:5060 0.0.0.0:* 21036/freeswitch
udp 0 0 192.168.52.108:5060 0.0.0.0:* 21036/freeswitch
udp 0 0 0.0.0.0:111 0.0.0.0:* 723/rpcbind
udp 0 0 0.0.0.0:731 0.0.0.0:* 723/rpcbind
udp6 0 0 :::111 :::* 723/rpcbind
udp6 0 0 :::731 :::* 723/rpcbind
lo que quiero es cerrar el puerto 5060 que escucha en 172.20.112.117:5060. Pero otro conjunto de IP también incluye el mismo puerto usando el mismo PID. No quiero matarlos. Solo es necesario liberar la IP 172.20.112.117 del puerto 5060. ¿Existe algún método para hacer esto?
Respuesta1
Configure el proceso de manera que se vincule solo a las direcciones correctas en lugar de 0.0.0.0
. Si el proceso escambio libreDeberías echarle un vistazo a la configuración. Desde elLista de correo(aunque anticuado):
Amigo, sacado directamente de la configuración predeterminada:
<!-- bind_server_ip
Can be an ip address, a dns name, or "auto".
This determines an ip address available on this host to bind.
If you are separating RTP and SIP traffic, you will want to have
use different addresses where this variable appears.
Used by: sofia.conf.xml dingaling.conf.xml
-->
<X-PRE-PROCESS cmd="set" data="bind_server_ip=auto"/>
Alternativamente desde elwiki.