Einen Abhörport für eine bestimmte IP beenden

Einen Abhörport für eine bestimmte IP beenden

Ich habe einen SIP-Server mit mehreren Netzwerkschnittstellen. (virtuell) Wenn ich den Befehl ausführe, netstat -nlputwerden alle abhörenden IPs und Ports wie unten angezeigt.

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

was ich möchte, ist, den Port 5060 zu sperren, der auf 172.20.112.117:5060 lauscht. Aber ein anderer Satz von IPs listet denselben Port mit derselben PID auf. Diese möchte ich nicht sperren. Nur die IP 172.20.112.117 muss vom Port 5060 freigegeben werden. Gibt es eine Methode, dies zu tun?

Antwort1

Konfigurieren Sie den Prozess so, dass er nur an die richtigen Adressen bindet, anstatt an 0.0.0.0. Wenn der ProzessFreischalterSie sollten einen Blick auf die Konfiguration werfen. Von derMailingliste(obwohl veraltet):

Alter, direkt aus der Standardkonfiguration:

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

Alternativ aus demWiki.

verwandte Informationen