I have setup a dedicated Opensips Server on a public ip xx.xx.xx.xx & Dedicated Freeswitch Server 192.168.1.2, a dedicated MySql Database Server 192.168.1.3. My router is on 192.168.1.1. I have also got a sip trunk from a provider on 192.168.1.5. All servers are on Debian 8.
I have put my gateway as 192.168.1.5 for all except the opensips server which has its own gateway xxx.xx.xx.xy.
The Opensips server has 2 ethernet ports eth0 & eth1. And I have put eth1 as 192.168.1.4 how can I enable Opensips server public ip to access the local Mysql server and also send the calls to the Freeswitch Server.
I enables packet forwarding: /etc/sysctl.conf net.ipv4.ip_forward=1
My iptables on the opensips are like this:
iptables rules:
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth1 -s 192.168.1.0/255.255.255.0 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Thanks.