Jump to content

Bind to specific IP address


Pavlos Parissis

Recommended Posts

Does anyone know why the setting in Bind to specific IPv4 address is ignored?

 

The name of the setting is a little bit misleading. This applies only for multicast RTP.

 

If you want to bind e.g. the SIP UDP port to a specific IP address 12.23.34.45 port 5060 and 6.5.4.3 port 8000, then you should use the setting "12.23.34.45:5060 6.5.4.3:8000" where you have the port right now ("5060").

Link to comment
Share on other sites

The name of the setting is a little bit misleading. This applies only for multicast RTP.

 

If you want to bind e.g. the SIP UDP port to a specific IP address 12.23.34.45 port 5060 and 6.5.4.3 port 8000, then you should use the setting "12.23.34.45:5060 6.5.4.3:8000" where you have the port right now ("5060").

 

I followed your suggestion and my conf is now like this

<ip_http_port>192.168.78.10:80</ip_http_port>

<ip_https_port>192.168.78.10:443</ip_https_port>

<ip_sip_udp_port>192.168.78.10:5060</ip_sip_udp_port>

<ip_sip_tcp_port>192.168.78.10:5060</ip_sip_tcp_port>

<ip_sip_tls_port>192.168.78.10:5061</ip_sip_tls_port>

<ip_snmp_port>192.168.78.10:161</ip_snmp_port>

<ip_snmp_community>public</ip_snmp_community>

<ip_tftp_port>192.168.78.10:69</ip_tftp_port>

 

 

and now listens on specific IP, expect the last 2 UDP sockets.

thanks

 

 

[root@node-01 ~]# netstat -nap|grep pbx_01

tcp 0 0 192.168.78.10:5060 0.0.0.0:* LISTEN 2138/pbx_01

tcp 0 0 192.168.78.10:5061 0.0.0.0:* LISTEN 2138/pbx_01

tcp 0 0 192.168.78.10:80 0.0.0.0:* LISTEN 2138/pbx_01

tcp 0 0 192.168.78.10:22 0.0.0.0:* LISTEN 2165/sshd-pbx_01

tcp 0 0 192.168.78.10:443 0.0.0.0:* LISTEN 2138/pbx_01

udp 0 0 192.168.78.10:161 0.0.0.0:* 2138/pbx_01

udp 0 0 192.168.78.10:5060 0.0.0.0:* 2138/pbx_01

udp 0 0 192.168.78.10:69 0.0.0.0:* 2138/pbx_01

udp 0 0 0.0.0.0:54342 0.0.0.0:* 2138/pbx_01

udp 0 0 0.0.0.0:39380 0.0.0.0:* 2138/pbx_01

udp 0 0 :::49096 :::* 2138/pbx_01

udp 0 0 :::55132 :::* 2138/pbx_01

Link to comment
Share on other sites

<ip_http_port>192.168.78.10:80</ip_http_port>

<ip_https_port>192.168.78.10:443</ip_https_port>

<ip_sip_udp_port>192.168.78.10:5060</ip_sip_udp_port>

<ip_sip_tcp_port>192.168.78.10:5060</ip_sip_tcp_port>

<ip_sip_tls_port>192.168.78.10:5061</ip_sip_tls_port>

<ip_snmp_port>192.168.78.10:161</ip_snmp_port>

<ip_snmp_community>public</ip_snmp_community>

<ip_tftp_port>192.168.78.10:69</ip_tftp_port>

 

That looks good.

Link to comment
Share on other sites

That looks good.

 

yes but pbx still listens on any IP for 4 ports

[root@node-01 ~]# netstat -nap|grep pbx_01

tcp 0 0 192.168.78.10:5060 0.0.0.0:* LISTEN 2138/pbx_01

tcp 0 0 192.168.78.10:5061 0.0.0.0:* LISTEN 2138/pbx_01

tcp 0 0 192.168.78.10:80 0.0.0.0:* LISTEN 2138/pbx_01

tcp 0 0 192.168.78.10:22 0.0.0.0:* LISTEN 2165/sshd-pbx_01

tcp 0 0 192.168.78.10:443 0.0.0.0:* LISTEN 2138/pbx_01

udp 0 0 192.168.78.10:161 0.0.0.0:* 2138/pbx_01

udp 0 0 192.168.78.10:5060 0.0.0.0:* 2138/pbx_01

udp 0 0 192.168.78.10:69 0.0.0.0:* 2138/pbx_01

udp 0 0 0.0.0.0:54342 0.0.0.0:* 2138/pbx_01

udp 0 0 0.0.0.0:39380 0.0.0.0:* 2138/pbx_01

udp 0 0 :::49096 :::* 2138/pbx_01

udp 0 0 :::55132 :::* 2138/pbx_01

Link to comment
Share on other sites

udp 0 0 0.0.0.0:54342 0.0.0.0:* 2138/pbx_01

udp 0 0 0.0.0.0:39380 0.0.0.0:* 2138/pbx_01

udp 0 0 :::49096 :::* 2138/pbx_01

udp 0 0 :::55132 :::* 2138/pbx_01

 

RTP ports are always bound to 0.0.0.0 and ::. Also the DNS client sockets connect to 0.0.0.0 and ::. Because those ports are client ports and discard messages that dont match the SSRC or the DNS open query sequence number IMHO that should be okay.

Link to comment
Share on other sites

RTP ports are always bound to 0.0.0.0 and ::. Also the DNS client sockets connect to 0.0.0.0 and ::. Because those ports are client ports and discard messages that dont match the SSRC or the DNS open query sequence number IMHO that should be okay.

 

so having 2 PBXs, which listen on different IPs, on the same node shouldn't cause any issues.

 

thanks

Link to comment
Share on other sites

so having 2 PBXs, which listen on different IPs, on the same node shouldn't cause any issues.

 

No, because those ports are allocated in a "random" fashion anyway. For DNS, the OS will pick a free port and for the RTP port, the PBX will try up to ten times to get a free port in the range specified.

Link to comment
Share on other sites

No, because those ports are allocated in a "random" fashion anyway. For DNS, the OS will pick a free port and for the RTP port, the PBX will try up to ten times to get a free port in the range specified.

 

the below output confirms what you have said

 

[root@node-03 ~]# netstat -nap|grep pbx_01

tcp 0 0 192.168.78.10:5060 0.0.0.0:* LISTEN 6340/pbx_01

tcp 0 0 192.168.78.10:5061 0.0.0.0:* LISTEN 6340/pbx_01

tcp 0 0 192.168.78.10:80 0.0.0.0:* LISTEN 6340/pbx_01

tcp 0 0 192.168.78.10:22 0.0.0.0:* LISTEN 6353/sshd-pbx_01

tcp 0 0 192.168.78.10:443 0.0.0.0:* LISTEN 6340/pbx_01

udp 0 0 0.0.0.0:39321 0.0.0.0:* 6340/pbx_01

udp 0 0 192.168.78.10:161 0.0.0.0:* 6340/pbx_01

udp 0 0 192.168.78.10:5060 0.0.0.0:* 6340/pbx_01

udp 0 0 192.168.78.10:69 0.0.0.0:* 6340/pbx_01

udp 0 0 0.0.0.0:33122 0.0.0.0:* 6340/pbx_01

udp 0 0 :::45184 :::* 6340/pbx_01

udp 0 0 :::36295 :::* 6340/pbx_01

unix 2 [ ] DGRAM 14622 6340/pbx_01

 

 

 

[root@node-03 ~]# netstat -nap|grep pbx_02

tcp 0 0 192.168.78.20:5060 0.0.0.0:* LISTEN 5540/pbx_02

tcp 0 0 192.168.78.20:5061 0.0.0.0:* LISTEN 5540/pbx_02

tcp 0 0 192.168.78.20:80 0.0.0.0:* LISTEN 5540/pbx_02

tcp 0 0 192.168.78.20:22 0.0.0.0:* LISTEN 5572/sshd-pbx_02

tcp 0 0 192.168.78.20:443 0.0.0.0:* LISTEN 5540/pbx_02

udp 0 0 0.0.0.0:53900 0.0.0.0:* 5540/pbx_02

udp 0 0 0.0.0.0:49937 0.0.0.0:* 5540/pbx_02

udp 0 0 192.168.78.20:161 0.0.0.0:* 5540/pbx_02

udp 0 0 192.168.78.20:5060 0.0.0.0:* 5540/pbx_02

udp 0 0 192.168.78.20:69 0.0.0.0:* 5540/pbx_02

udp 0 0 :::46844 :::* 5540/pbx_02

udp 0 0 :::32894 :::* 5540/pbx_02

unix 2 [ ] DGRAM 13715 5540/pbx_02

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...