1

I have the following problem:

PC1    - eth0: 192.168.188.55
         eth1: part of br0: 10.147.20.69
         tap1: part of b0: 10.147.20.2 -> connected to PC2
on eth1: i have a trunc sip device GOIP and some times PC3.

The server is Centos7 installed based on Freepbx

from PC2 ping pc1: ok ping eth1: ok from PC3 ping pc1: ok register a sip client: ok

When I use the GOIP instead of PC3, registration failed either in the sip client or as a trunc. By doing tcpdump -i eth0 src 10.147.20.2 I see that the Freepbx is sending SIP Option packets, but the from field IP has been replaced instead

from 2002@10.147.20.2 to from 2002@192.168.188.51

which is the router on eth0

I have the following Iptabels rules

-t nat -A POSTROUTING -o eth1 -j MASQUERADE
-A FORWARD -o eth1 -j ACCEPT

-t nat -A PREROUTING -i ztyqbvbk6k -p tcp --dport 8060  -j DNAT --to 10.147.20.17:80
-A FORWARD -i ztyqbvbk6k -p tcp --dport 80 -d 10.147.20.17 -j ACCEPT


-t nat -A POSTROUTING -o eth0 -j MASQUERADE
-A FORWARD -i eth0 -o zt+ -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i zt+ -o eth0 -j ACCEPT

However, when I connect GOIP directly to the router to get IP 192.168.188.88, Freepbx can register on it.

is conntrack needed in this scenario? How to enable it or check it? is there a problem with Iptables? any suggestions?

Here is my routing table

[root@pbx ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.188.1   0.0.0.0         UG    100    0        0 eth0
10.0.0.0        0.0.0.0         255.0.0.0       U     0      0        0 eth1
10.147.20.0     0.0.0.0         255.255.255.0   U     0      0        0 br0
10.147.20.0     0.0.0.0         255.255.254.0   U     0      0        0 tap1
192.168.188.0   0.0.0.0         255.255.255.0   U     100    0        0 eth0

Update 1:

ip route get 10.147.20.2 from 10.147.20.69
network is unreachable

Although when I connected PC3 to eth1 and pinged 10.147.20.2 it was OK. Any suggestion is appreciated. Thank you!

0 Answers0