특정 IP에 대한 청취 포트 종료

특정 IP에 대한 청취 포트 종료

여러 네트워크 인터페이스를 갖춘 SIP 서버가 있습니다. (가상) 명령을 실행하면 netstat -nlput아래와 같이 모든 수신 IP와 포트가 표시됩니다.

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

내가 원하는 것은 172.20.112.117:5060에서 수신 대기 중인 포트 5060을 종료하는 것입니다. 그러나 다른 IP 세트도 동일한 PID를 사용하여 동일한 포트를 나열합니다. 나는 그들을 죽이고 싶지 않습니다. 172.20.112.117 IP만 5060 포트에서 해제해야 합니다. 이를 수행하는 방법이 있습니까?

답변1

대신 올바른 주소에만 바인딩하도록 프로세스를 구성하십시오 0.0.0.0. 프로세스가 다음과 같은 경우프리스위치구성을 살펴봐야 합니다. 로부터메일링 리스트(날짜는 있지만):

야, 기본 구성에서 바로 벗어났어:

<!-- 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"/>

또는위키.

관련 정보