Jump to content
Калькуляторы

iptables+voip+nat не работает

Народ помогите , уже и не знаю куда копать. суть

сеть 172.16.0.0/14

внутри сети стоит агат 3210 у которого в диалплане указано 7ххх отправлятьпакеты на voip провайдера во внешнюю сеть

стоит граничный маршрутизатор под линукс.

Проблема. При звонке из внутренней сети внешнему абоненту ( к примеру мобильный телефон) принимающий абонент не слышит голоса звонящего, а звонящий абонет слышит нормально

в иптаблес политики input output -ACCEPT , forward -drop

что делаю

iptables -A INPUT -d 89.113.148.x(внешний ip) -p udp -m udp --dport 5060 -j ACCEPT

iptables -A INPUT - d 89.113.148.x -p udp -m udp --dport 9000:9012 -j ACCEPT rinotel говорит что для rtp эти порты они используют

iptables -A FORWARD -d 172.18.0.1 (ip агата) -p udp --dport 5060 -j ACCEPT

iptables -t nat -A PREROUTING -d 89.113.148.x -p udp -m udp --dport 5060 -j DNAT --to-destination 172.18..0.1

и последнее

ipotables -t nat -A POSTROUTING -s 172.18.0.1 -o eth6 -j SNAT --to-source 89.113.148.x

 

ну не работает хоть убейся

 

вот дамп звонка

15:50:38.202792 00:30:4f:59:64:54 (oui Unknown) > 00:15:63:57:f1:1b (oui Unknown), ethertype IPv4 (0x0800), length 778: (tos0x0, ttl 127, id 15694, offset 0, flags [none], proto UDP (17), length 764) gw1-foton.yartel.net.sip > 194.242.33.21.sip: SIP, length: 736

INVITE sip:79036901604@194.242.33.21;user=phone SIP/2.0

Via: SIP/2.0/UDP 89.113.148.126:5060;branch=z9hG4bK581996-203905890

From: "3594145" <sip:3594145@194.242.33.21;user=phone>;tag=557561-303905

To: <sip:79036901604@194.242.33.21;user=phone>

Call-ID: 403905-oabc@89.113.148.126

CSeq: 340 INVITE

Contact: <sip:3594145@89.113.148.126:5060;user=phone>

Max-Forwards: 70

User-Agent: SIP Noname - 3.48

Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTION, REFER, REGISTER

Content-Type: application/sdp

Content-Length: 203

 

v=0

o=Wellwisher 100341 100341 IN IP4 89.113.148.126

s=SIP Call

c=IN IP4 89.113.148.126

t=0 0

m=audio 9004 RTP/AVP 18 101

a=rtpmap:18 G729/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-16

15:50:38.258703 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 391: (tos0x0, ttl 58, id 34143, offset 0, flags [none], proto UDP (17), length 377) 194.242.33.21.sip > gw1-foton.yartel.net.sip: SIP, length: 349

SIP/2.0 100 Trying

CSeq: 340 INVITE

Call-ID: 403905-oabc@89.113.148.126

From: "3594145"<sip:3594145@194.242.33.21;user=phone>;tag=557561-303905

To: <sip:79036901604@194.242.33.21;user=phone>;tag=c2f22115-3b87c9

Via: SIP/2.0/UDP 89.113.148.126:5060;branch=z9hG4bK581996-203905890

User-Agent: Quintum/1.0.0

Quintum: 0b0a33383537343235353433

 

 

15:50:46.018439 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 618: (tos0x0, ttl 58, id 34153, offset 0, flags [none], proto UDP (17), length 604) 194.242.33.21.sip > gw1-foton.yartel.net.sip: SIP, length: 576

SIP/2.0 180 Ringing

CSeq: 340 INVITE

Call-ID: 403905-oabc@89.113.148.126

Content-Type: application/sdp

From: "3594145"<sip:3594145@194.242.33.21;user=phone>;tag=557561-303905

To: <sip:79036901604@194.242.33.21;user=phone>;tag=c2f22115-3b87c9

Via: SIP/2.0/UDP 89.113.148.126:5060;branch=z9hG4bK581996-203905890

Content-Length: 209

User-Agent: Quintum/1.0.0

 

v=0

o=Quintum 41539 100341 IN IP4 194.242.33.21

s=VoipCall

c=IN IP4 194.242.33.21

a=rtpmap:18 g729/8000/1

a=rtpmap:101 telephone-event/8000/1

 

15:50:57.203788 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 671: (tos0x0, ttl 58, id 34155, offset 0, flags [none], proto UDP (17), length 657) 194.242.33.21.sip > gw1-foton.yartel.net.sip: SIP, length: 629

SIP/2.0 200 OK

CSeq: 340 INVITE

Call-ID: 403905-oabc@89.113.148.126

Contact: <sip:79036901604@194.242.33.21:5060;user=phone>

Content-Type: application/sdp

From: "3594145"<sip:3594145@194.242.33.21;user=phone>;tag=557561-303905

To: <sip:79036901604@194.242.33.21;user=phone>;tag=c2f22115-3b87c9

Via: SIP/2.0/UDP 89.113.148.126:5060;branch=z9hG4bK581996-203905890

Content-Length: 209

User-Agent: Quintum/1.0.0

 

v=0

o=Quintum 41540 100341 IN IP4 194.242.33.21

s=VoipCall

c=IN IP4 194.242.33.21

t=0 0

m=audio 12416 RTP/AVP 18 101

c=IN IP4 194.242.33.21

a=rtpmap:18 g729/8000/1

a=rtpmap:101 telephone-event/8000/1

 

15:50:57.288240 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 58, id 0, offset 0, flags [DF], proto UDP (17), length 60) 194.242.33.21.12416 > gw1-foton.yartel.net.9004: UDP, length 32

15:50:57.308149 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 58, id 0, offset 0, flags [DF], proto UDP (17), length 60) 194.242.33.21.12416 > gw1-foton.yartel.net.9004: UDP, length 32

15:50:57.328059 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 58, id 0, offset 0, flags [DF], proto UDP (17), length 60) 194.242.33.21.12416 > gw1-foton.yartel.net.9004: UDP, length 32

15:50:57.348196 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 58, id 0, offset 0, flags [DF], proto UDP (17), length 60) 194.242.33.21.12416 > gw1-foton.yartel.net.9004: UDP, length 32

15:50:57.368434 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 58, id 0, offset 0, flags [DF], proto UDP (17), length 60) 194.242.33.21.12416 > gw1-foton.yartel.net.9004: UDP, length 32

15:50:57.387844 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 58, id 0, offset 0, flags [DF], proto UDP (17), length 60) 194.242.33.21.12416 > gw1-foton.yartel.net.9004: UDP, length 32

15:50:57.408048 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 58, id 0, offset 0, flags [DF], proto UDP (17), length 60) 194.242.33.21.12416 > gw1-foton.yartel.net.9004: UDP, length 32

15:50:57.427997 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 58, id 0, offset 0, flags [DF], proto UDP (17), length 60) 194.242.33.21.12416 > gw1-foton.yartel.net.9004: UDP, length 32

15:50:57.468131 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 58, id 0, offset 0, flags [DF], proto UDP (17), length 60) 194.242.33.21.12416 > gw1-foton.yartel.net.9004: UDP, length 32

15:50:57.468158 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0:

15:50:57.703070 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 671: (tos0x0, ttl 58, id 34165, offset 0, flags [none], proto UDP (17), length 657) 194.242.33.21.sip > gw1-foton.yartel.net.sip: SIP, length: 629

SIP/2.0 200 OK

CSeq: 340 INVITE

Call-ID: 403905-oabc@89.113.148.126

Contact: <sip:79036901604@194.242.33.21:5060;user=phone>

Content-Type: application/sdp

From: "3594145"<sip:3594145@194.242.33.21;user=phone>;tag=557561-303905

To: <sip:79036901604@194.242.33.21;user=phone>;tag=c2f22115-3b87c9

Via: SIP/2.0/UDP 89.113.148.126:5060;branch=z9hG4bK581996-203905890

Content-Length: 209

User-Agent: Quintum/1.0.0

 

v=0

o=Quintum 41540 100341 IN IP4 194.242.33.21

s=VoipCall

c=IN IP4 194.242.33.21

t=0 0

m=audio 12416 RTP/AVP 18 101

c=IN IP4 194.242.33.21

a=rtpmap:18 g729/8000/1

a=rtpmap:101 telephone-event/8000/1

15:50:58.688862 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 74: (tos 0x0, ttl 58, id 0, offset 0, flags [DF], proto UDP (17), length 60) 194.242.33.21.12416 > gw1-foton.yartel.net.9004: UDP, length 32

15:50:58.702910 00:15:63:57:f1:1b (oui Unknown) > 00:30:4f:59:64:54 (oui Unknown), ethertype IPv4 (0x0800), length 671: (tos0x0, ttl 58, id 34166, offset 0, flags [none], proto UDP (17), length 657) 194.242.33.21.sip > gw1-foton.yartel.net.sip: SIP, length: 629

SIP/2.0 200 OK

CSeq: 340 INVITE

Call-ID: 403905-oabc@89.113.148.126

Contact: <sip:79036901604@194.242.33.21:5060;user=phone>

Content-Type: application/sdp

From: "3594145"<sip:3594145@194.242.33.21;user=phone>;tag=557561-303905

To: <sip:79036901604@194.242.33.21;user=phone>;tag=c2f22115-3b87c9

Via: SIP/2.0/UDP 89.113.148.126:5060;branch=z9hG4bK581996-203905890

Content-Length: 209

User-Agent: Quintum/1.0.0

 

v=0

o=Quintum 41540 100341 IN IP4 194.242.33.21

s=VoipCall

c=IN IP4 194.242.33.21

t=0 0

m=audio 12416 RTP/AVP 18 101

c=IN IP4 194.242.33.21

a=rtpmap:18 g729/8000/1

a=rtpmap:101 telephone-event/8000/1

и вот конец звонка

0x0, ttl 58, id 34180, offset 0, flags [none], proto UDP (17), length 393) 194.242.33.21.sip > gw1-foton.yartel.net.sip: SIP, length: 365

BYE sip:3594145@89.113.148.126:5060;user=phone SIP/2.0

CSeq: 341 BYE

Call-ID: 403905-oabc@89.113.148.126

From: <sip:79036901604@194.242.33.21;user=phone>;tag=c2f22115-3b87c9

To: "3594145"<sip:3594145@194.242.33.21;user=phone>;tag=557561-303905

Via: SIP/2.0/UDP 194.242.33.21;branch=z9hG4bK-tenor-c2f2-2115-3b911

User-Agent: Quintum/1.0.0

Max-Forwards: 70

 

 

/zimbra/h/search?si=2&so=0&sc=160&sfi=5&st=conversation close Назад в Отправленные

Удалить

Переместить

в ринотеле говорят не открыт порт 5060 udp но какие правила не писал порт так и не виден.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this