how to set interface restrict ip PATTERN

Discuss any topic about Brekeke SIP Server.

Moderator: Brekeke Support Team

Post Reply
purgatory
Posts: 6
Joined: Wed Nov 02, 2011 9:08 pm

how to set interface restrict ip PATTERN

Post by purgatory »

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/ ... terns.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
redroof
Posts: 97
Joined: Fri Nov 16, 2007 1:46 pm

Post by redroof »

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.
purgatory
Posts: 6
Joined: Wed Nov 02, 2011 9:08 pm

Post by purgatory »

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 :(
redroof
Posts: 97
Joined: Fri Nov 16, 2007 1:46 pm

Post by redroof »

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.
purgatory
Posts: 6
Joined: Wed Nov 02, 2011 9:08 pm

Post by purgatory »

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 :(
And SIP Invite field is filled 203.1.2.3 but SIP contact field is filled 172.16.x.y :(

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 !
redroof
Posts: 97
Joined: Fri Nov 16, 2007 1:46 pm

Post by redroof »

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 Pattern]
$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 Pattern]
$ifsrc = 192.168.20.241
$ifdst = 203.1.2.3
$continue = true
-------------------------------
Post Reply