[ previous ] [ next ] [ threads ]
 To :  "'Gamaliel Bedolla'" <gbf@t...>
 From :  "Dimitris Sakellarios" <dimitris.sakellarios@t...>
 Subject :  RE: [yate] How to bind port port for second leg
 Date :  Sat, 24 Mar 2012 02:01:28 +0200
Hi Gamaliel,

 

Try first of all to enable ip_forwarding if not enabled and secondary use
the rule below.

 

1) sysctl net.ipv4.ip_forward=1

2) iptables -t nat -A POSTROUTING -o {your 10.100.0.2 interface name} -j
SNAT --to-source 10.100.0.2:5060

 

Hopefully this will rewrite always the source port of box(2) to 5060.

 

For your future help use the following mini how to:

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux
_Firewalls_Using_iptables 

 

BR

 

 

Sakellarios Dimitris

e-mail: dimitris.sakellarios 
@t...  url: http://www.telesuite.gr  

  _____  

From: Gamaliel Bedolla [mailto:gbf@t...] 
Sent: Friday, March 23, 2012 10:14 PM
To: yate@v...
Subject: [yate] How to bind port port for second leg

 

Dear Yate users/developers,

 

I have to NAT via iptables address and port of the traffic in and out of mi
YATE, ip address 10.100.0.2. When it receives an INVITE, it sends the answer
to the correct port (5060), but when initiates the second leg (to where the
call should be redirected) it initiates the call on variable port, 1030,
1070, etc. but I need to bind outgoing calls to port 5060 to accomplish the
NAT rule.

 

This is my ysipchan.conf:

[general]

port=5060

 

I'm using YATE/4.0.1.

 

And this is the flow of messages:

(1)Sofswitch == 10.100.0.1

(2)Yate      == 10.100.0.2

(3)Asterisk  == 10.100.0.3

 

 

(1)[5060]-----INVITE---->[5060](2)

(1)[5060]<--100 TRYING---[5060](2)

                                          (2)[1030]-----INVITE---->[5060](3)
[5060](3)

Hi Gamaliel,

 

Try first of all to enable ip_forwarding if not enabled and secondary use the rule below.

 

1) sysctl net.ipv4.ip_forward=1

2) iptables -t nat -A POSTROUTING -o {your 10.100.0.2 interface name} -j SNAT --to-source 10.100.0.2:5060

 

Hopefully this will rewrite always the source port of box(2) to 5060.

 

For your future help use the following mini how to:

http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables

 

BR

 

 

Sakellarios Dimitris

e-mail: dimitris.sakellarios@telesuite.gr  url: http://www.telesuite.gr


From: Gamaliel Bedolla [mailto:gbf@t...]
Sent: Friday, March 23, 2012 10:14 PM
To: yate@v...
Subject: [yate] How to bind port port for second leg

 

Dear Yate users/developers,

 

I have to NAT via iptables address and port of the traffic in and out of mi YATE, ip address 10.100.0.2. When it receives an INVITE, it sends the answer to the correct port (5060), but when initiates the second leg (to where the call should be redirected) it initiates the call on variable port, 1030, 1070, etc. but I need to bind outgoing calls to port 5060 to accomplish the NAT rule.

 

This is my ysipchan.conf:

[general]

port=5060

 

I'm using YATE/4.0.1.

 

And this is the flow of messages:

(1)Sofswitch == 10.100.0.1

(2)Yate      == 10.100.0.2

(3)Asterisk  == 10.100.0.3

 

 

(1)[5060]-----INVITE---->[5060](2)

(1)[5060]<--100 TRYING---[5060](2)

                                          (2)[1030]-----INVITE---->[5060](3)    <This is what I want to be exiting on port 5060

                                          (2)[5060]<--100 TRYING---[5060](3)

                                          (2)[5060]<---200 OK------[5060](3)

                                          (2)[1030]-------ACK----->[5060](3)    <This is what I want to be exiting on port 5060

(1)[5060]<-----200 OK----[5060](2)

 

Can you help me on this?

Please let me know if more info is needed.

Best regards