Devrim -
This is what I've got. I added the following lines to the beginning of /etc/nginx/site-available/bigbluebutton:
geo $autonet {
default 0;
}
Then, I use the following /etc/bigbluebutton/sip.nginx:
location /ws {
if ($autonet) {
}
if ($autonet != 1) {
}
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_read_timeout 6h;
proxy_send_timeout 6h;
client_body_timeout 6h;
send_timeout 6h;
auth_request /bigbluebutton/connection/checkAuthorization;
auth_request_set $auth_status $upstream_status;
}
The server's public IP address is 100.36.123.208, which is also configured on a loopback interface. I think it's important that Freeswitch receive the private connections on the private address and the public connections on the public address, but I'm not 100% sure of that.
Finally, I copied /opt/freeswitch/conf/sip_profiles/external.xml to /opt/freeswitch/conf/sip_profiles/internal.xml and made the following changes: (there was already an internal.xml that I don't think we use, so I overwrote it)
1c1
< <profile name="external">
---
> <profile name="internal">
3c3
< <!-- This profile is only for outbound registrations to providers -->
---
> <!-- This profile is for inbound Big Blue Button connections on the local private LAN -->
28c28
< <param name="sip-port" value="$${external_sip_port}"/>
---
> <param name="sip-port" value="5062"/>
44c44
< <!-- <param name="apply-candidate-acl" value="localnet.auto"/> -->
---
> <param name="apply-candidate-acl" value="localnet.auto"/>
92c92,93
< <param name="tls-sip-port" value="$${external_tls_port}"/>
---
> <!-- but it's disabled by external_ssl_enable -->
> <param name="tls-sip-port" value="5083"/>
108,109c109,110
< <param name="ws-binding" value=":5066"/>
---
> <param name="ws-binding" value=":5068"/>
In summary:
- change the profile name from "external" to "internal"
- change all four TCP port numbers (5060 -> 5062, 5081 -> 5083, 5066 -> 5068, 7443 -> 7445)
- comment out the apply-candidate-acl localnet.auto in external.xml (all the other changes are to internal.xml)
Now any internal connections go to port 7445 and match localnet.auto, while external connections go to port 7443 and never match localnet.auto.
This works for my network. For something that works in the general case, we should probably match any private IP address, using something like this:
geo $rfc1918 {
default 0;
}
Also, for internal connections, we should probably match any private address, not just the local subnet, so that would require using rfc1918.auto instead of localnet.auto. So, I'm thinking that the external SIP configuration should look like this:
<param name="apply-candidate-acl" value="wan_v4.auto"/>
<param name="apply-candidate-acl" value="any_v4.auto"/>
and the internal SIP configuration should look like this:
<param name="apply-candidate-acl" value="rfc1918.auto"/>
<param name="apply-candidate-acl" value="any_v4.auto"/>
Finally, there's a known problem with wan_v4.auto - it matches carrier-grade NAT addresses, which is an additional NAT block (
100.64.0.0/10; RFC 6598) used by cell phone carriers. We don't want to use a cell phone's carrier-grade NAT address (just like we don't want to use any NAT address), so probably we want something like this for our external SIP configuration:
<param name="apply-candidate-acl" value="wan_v4_without_cgnat.auto"/>
<param name="apply-candidate-acl" value="any_v4.auto"/>
and then add the following to /opt/freeswitch/conf/autoload_configs/acl.conf.xml:
<list name="wan_v4_without_cgnat" default="allow">
<node type="deny" cidr="::/0"/>
</list>
I know that's a lot of information, but I think it pretty much covers everything I've learned so far about how to configure Freeswitch to handle the current state of IPv4 addressing.
agape
brent