Brekeke Forum Index » Brekeke SIP Server Forum

Post new topic   Reply to topic
how to set interface restrict ip PATTERN
Author Message
purgatory
Brekeke Junior Member


Joined: 02 Nov 2011
Posts: 6

PostPosted: Wed Nov 02, 2011 9:49 pm    Post subject: how to set interface restrict ip PATTERN Reply with quote

1. Brekeke Product Name and version:
sip server standard 2.4.8.6

2. Java version:
jre x86 1.6.0.16

3. OS type and the version:
win2008R2 x64

4. UA (phone), gateway or other hardware/software involved:
moimstone phone, unknown SSW

5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/networkpatterns.html :
pattern 9 + pattern 10

6. Your problem:
bad english.. sorry

there is 5 nic in control panel

hardware nic1: 203.1.2.3 -> public static ip
hardware nic2: 192.168.20.241 -> private static ip
hardware nic3: not use
hardware nic4: not use
software nic1: 172.16.x.y -> private dynamic ip

How to set "net.net1.interface-restrict=172.16.x.y" ?
example) 172.16.10.24, 172.16.24.57, ...
x.y is changes every day because vpn client software login session limit (10 hours)

I try

net.net1.interface-restrict=172.16.x.x it does not work !
net.net1.interface-restrict=172.16.0.0 it does not work !
net.net1.interface-restrict=172.16.255.255 it does not work !

net.net2.interface-restrict=192.168.20.241 it work !


let me know how to set restrict ip pattern
Back to top
View user's profile
redroof
Brekeke Talented


Joined: 16 Nov 2007
Posts: 97

PostPosted: Thu Nov 03, 2011 9:11 am    Post subject: Reply with quote

The "net.netX.interface-restrict" doesn't allow you to set a pattern such as a regular expression...

However...
$ifsrc or $ifdst at DialPlan will help you to define a certain interface address.

If you want to use "203.1.2.3" for connecting to a public network, set "$ifsrc=203.1.2.3".

Refer the document for more details.
Back to top
View user's profile
purgatory
Brekeke Junior Member


Joined: 02 Nov 2011
Posts: 6

PostPosted: Thu Nov 03, 2011 8:17 pm    Post subject: Reply with quote

redroof wrote:
The "net.netX.interface-restrict" doesn't allow you to set a pattern such as a regular expression...

Thank you, redroof !

But it disappointments me Sad
Back to top
View user's profile
redroof
Brekeke Talented


Joined: 16 Nov 2007
Posts: 97

PostPosted: Fri Nov 04, 2011 11:10 am    Post subject: Reply with quote

In your situation, you may not have to care about 172.16.x.y interface because it is for VPN and the SIP Server will not pick this address automatically.

For example, if a call made for a user who is on the Internet, the SIP Server will use 203.1.2.3 automatically.
And if a call made for a local user, the SIP Server will use 192.168.20.241 automatically.
Back to top
View user's profile
purgatory
Brekeke Junior Member


Joined: 02 Nov 2011
Posts: 6

PostPosted: Sat Nov 05, 2011 12:14 am    Post subject: Reply with quote

redroof wrote:
it is for VPN and the SIP Server will not pick this address automatically.

Unfortunately SIP Server use it as primary IP address.
Thus I configured
net.bind.interface=203.1.2.3

BUT !! In the server status web page it shows
172.16.x.y, 203.1.2.3 Sad
And SIP Invite field is filled 203.1.2.3 but SIP contact field is filled 172.16.x.y Sad

Anyway, SIP Server has no REGEX feature as configuration above...
We change server configuration.

Our final configuration is this.

- Before
Server1: BKK SIP Server (203.1.2.3, 192.168.20.241, 172.16.x.y)
Server2: DB Server (192.168.20.242)
and any other servers...

- After
Server1: BKK SIP Server (203.1.2.3, 192.168.20.241)
Server2: DB Server (192.168.20.242, 172.16.x.y)
and any other servers...


Anyway, Thank you very much !
Back to top
View user's profile
redroof
Brekeke Talented


Joined: 16 Nov 2007
Posts: 97

PostPosted: Mon Nov 07, 2011 10:41 am    Post subject: Reply with quote

I wonder why the SIP server picks the VPN's IP address 172.16.x.y...

Are there any other phones which use 172.16...??
If so, the SIP server will use 172.x.y for communicating with another 172.16's phone.


Here are sample DialPlan rules which use $ifdst and $ifsrc.
You may need to modify them for meeting your requirements.


Rule-1: Public to Private
Matching Patterns
$request = ^INVITE
$globaladdr( $addr ) = true
Deploy Patterns
$ifsrc = 203.1.2.3
$ifdst = 192.168.20.241
$continue = true



Rule-2: Private to Public
Matching Patterns
$request = ^INVITE
$globaladdr( $addr ) = false
Deploy Patterns
$ifsrc = 192.168.20.241
$ifdst = 203.1.2.3
$continue = true
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    Brekeke Forum Index » Brekeke SIP Server Forum All times are GMT - 7 Hours
Page 1 of 1