Regular Expression for match ip address
Dear All, I want to autorize incoming call to public context by IP by <condition field="network_addr" expression="^192\.168\.1\.1$"/> but some time i want to allow 1 Class C or some range of IP. How can do that ? BG Dome C.
You could use the ACL support and check_acl. http://wiki.freeswitch.org/wiki/Acl#check_acl which would probably scale slightly better since u can create an ACL list of all hosts u want to treat the same way and just do 1 check_acl condition. -- W
Yah forgot about that one.. I like my ${acl()} usage much better /b On Mar 29, 2010, at 2:16 PM, William Suffill wrote:
You could use the ACL support and check_acl.
http://wiki.freeswitch.org/wiki/Acl#check_acl
which would probably scale slightly better since u can create an ACL list of all hosts u want to treat the same way and just do 1 check_acl condition.
-- W
you need to use ACL in autoload_configs/acl.conf.xml ----- Original Message ----- From: "Dome Charoenyost" <dome@tel.co.th> To: <freeswitch-users@lists.freeswitch.org> Sent: Monday, March 29, 2010 3:05 PM Subject: [Freeswitch-users] Regular Expression for match ip address
Dear All, I want to autorize incoming call to public context by IP by <condition field="network_addr" expression="^192\.168\.1\.1$"/> but some time i want to allow 1 Class C or some range of IP. How can do that ?
BG
Dome C.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thanks All. How to deny all and allow some ? I try <list name="test" default="allow"> <node type="deny" cidr="0.0.0.0/0"/> <node type="allow" cidr="10.0.0.1/32"/> <node type="allow" cidr="115.178.1.0/24"/> </list> but don't work. Dome C. 2010/3/30 Madovsky <infos@madovsky.org>:
you need to use ACL in autoload_configs/acl.conf.xml
----- Original Message ----- From: "Dome Charoenyost" <dome@tel.co.th> To: <freeswitch-users@lists.freeswitch.org> Sent: Monday, March 29, 2010 3:05 PM Subject: [Freeswitch-users] Regular Expression for match ip address
Dear All, I want to autorize incoming call to public context by IP by <condition field="network_addr" expression="^192\.168\.1\.1$"/> but some time i want to allow 1 Class C or some range of IP. How can do that ?
BG
Dome C.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Got it :) <list name="test" default="deny"> <node type="allow" cidr="10.0.0.1/32"/> <node type="allow" cidr="115.178.1.0/24"/> </list> 2010/3/30 Dome Charoenyost <dome@tel.co.th>:
Thanks All. How to deny all and allow some ? I try <list name="test" default="allow"> <node type="deny" cidr="0.0.0.0/0"/> <node type="allow" cidr="10.0.0.1/32"/> <node type="allow" cidr="115.178.1.0/24"/> </list>
but don't work.
Dome C.
2010/3/30 Madovsky <infos@madovsky.org>:
you need to use ACL in autoload_configs/acl.conf.xml
----- Original Message ----- From: "Dome Charoenyost" <dome@tel.co.th> To: <freeswitch-users@lists.freeswitch.org> Sent: Monday, March 29, 2010 3:05 PM Subject: [Freeswitch-users] Regular Expression for match ip address
Dear All, I want to autorize incoming call to public context by IP by <condition field="network_addr" expression="^192\.168\.1\.1$"/> but some time i want to allow 1 Class C or some range of IP. How can do that ?
BG
Dome C.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Figured you would ;-) On Tue, Mar 30, 2010 at 11:59 AM, Dome Charoenyost <dome@tel.co.th> wrote:
Got it :) <list name="test" default="deny"> <node type="allow" cidr="10.0.0.1/32"/> <node type="allow" cidr="115.178.1.0/24"/> </list>
2010/3/30 Dome Charoenyost <dome@tel.co.th>:
Thanks All. How to deny all and allow some ? I try <list name="test" default="allow"> <node type="deny" cidr="0.0.0.0/0"/> <node type="allow" cidr="10.0.0.1/32"/> <node type="allow" cidr="115.178.1.0/24"/> </list>
but don't work.
Dome C.
2010/3/30 Madovsky <infos@madovsky.org>:
you need to use ACL in autoload_configs/acl.conf.xml
----- Original Message ----- From: "Dome Charoenyost" <dome@tel.co.th> To: <freeswitch-users@lists.freeswitch.org> Sent: Monday, March 29, 2010 3:05 PM Subject: [Freeswitch-users] Regular Expression for match ip address
Dear All, I want to autorize incoming call to public context by IP by <condition field="network_addr" expression="^192\.168\.1\.1$"/> but some time i want to allow 1 Class C or some range of IP. How can do that ?
BG
Dome C.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Have you tried changing the default? <list name="test" *default="allow"*> On Tue, Mar 30, 2010 at 11:49 AM, Dome Charoenyost <dome@tel.co.th> wrote:
Thanks All. How to deny all and allow some ? I try <list name="test" default="allow"> <node type="deny" cidr="0.0.0.0/0"/> <node type="allow" cidr="10.0.0.1/32"/> <node type="allow" cidr="115.178.1.0/24"/> </list>
but don't work.
Dome C.
2010/3/30 Madovsky <infos@madovsky.org>:
you need to use ACL in autoload_configs/acl.conf.xml
----- Original Message ----- From: "Dome Charoenyost" <dome@tel.co.th> To: <freeswitch-users@lists.freeswitch.org> Sent: Monday, March 29, 2010 3:05 PM Subject: [Freeswitch-users] Regular Expression for match ip address
Dear All, I want to autorize incoming call to public context by IP by <condition field="network_addr" expression="^192\.168\.1\.1$"/> but some time i want to allow 1 Class C or some range of IP. How can do that ?
BG
Dome C.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
if you want this <node type="deny" cidr="0.0.0.0/0"/> so use <list name="test" default="deny"> and use allow inside ----- Original Message ----- From: "Dome Charoenyost" <dome@tel.co.th> To: <freeswitch-users@lists.freeswitch.org> Sent: Tuesday, March 30, 2010 12:49 PM Subject: Re: [Freeswitch-users] Regular Expression for match ip address
Thanks All. How to deny all and allow some ? I try <list name="test" default="allow"> <node type="deny" cidr="0.0.0.0/0"/> <node type="allow" cidr="10.0.0.1/32"/> <node type="allow" cidr="115.178.1.0/24"/> </list>
but don't work.
Dome C.
2010/3/30 Madovsky <infos@madovsky.org>:
you need to use ACL in autoload_configs/acl.conf.xml
----- Original Message ----- From: "Dome Charoenyost" <dome@tel.co.th> To: <freeswitch-users@lists.freeswitch.org> Sent: Monday, March 29, 2010 3:05 PM Subject: [Freeswitch-users] Regular Expression for match ip address
Dear All, I want to autorize incoming call to public context by IP by <condition field="network_addr" expression="^192\.168\.1\.1$"/> but some time i want to allow 1 Class C or some range of IP. How can do that ?
BG
Dome C.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
It's work perfect :) I love Freeswitch... Dome C. 2010/3/31 Madovsky <infos@madovsky.org>:
if you want this <node type="deny" cidr="0.0.0.0/0"/>
so use <list name="test" default="deny"> and use allow inside
----- Original Message ----- From: "Dome Charoenyost" <dome@tel.co.th> To: <freeswitch-users@lists.freeswitch.org> Sent: Tuesday, March 30, 2010 12:49 PM Subject: Re: [Freeswitch-users] Regular Expression for match ip address
Thanks All. How to deny all and allow some ? I try <list name="test" default="allow"> <node type="deny" cidr="0.0.0.0/0"/> <node type="allow" cidr="10.0.0.1/32"/> <node type="allow" cidr="115.178.1.0/24"/> </list>
but don't work.
Dome C.
2010/3/30 Madovsky <infos@madovsky.org>:
you need to use ACL in autoload_configs/acl.conf.xml
----- Original Message ----- From: "Dome Charoenyost" <dome@tel.co.th> To: <freeswitch-users@lists.freeswitch.org> Sent: Monday, March 29, 2010 3:05 PM Subject: [Freeswitch-users] Regular Expression for match ip address
Dear All, I want to autorize incoming call to public context by IP by <condition field="network_addr" expression="^192\.168\.1\.1$"/> but some time i want to allow 1 Class C or some range of IP. How can do that ?
BG
Dome C.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I am not sure to understand the question. You want to allow some /32, one /24 and some other subnets to access FS and reach the public dialplan, while forbidding everything else ? You can do that using ACL. In acl.conf.xml, add this between <network-lists> and </network-lists>: <list name="external" default="deny"> <node type="allow" cidr="192.168.1.1/32"/> <node type="allow" cidr="X.X.X.X/24"/> ... </list> Assuming your only reachable SIP profile is external, you have to add in external.xml: <param name="apply-inbound-acl" value="external"/> Modify this to match your configuration, but you get the idea. David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 29/03/2010 à 21:05, Dome Charoenyost a écrit :
Dear All, I want to autorize incoming call to public context by IP by <condition field="network_addr" expression="^192\.168\.1\.1$"/> but some time i want to allow 1 Class C or some range of IP. How can do that ?
BG
Dome C.
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Mon, Mar 29, 2010 at 12:05 PM, Dome Charoenyost <dome@tel.co.th> wrote:
Dear All, I want to autorize incoming call to public context by IP by <condition field="network_addr" expression="^192\.168\.1\.1$"/> but some time i want to allow 1 Class C or some range of IP. How can do that ?
Curious: can you not do this with acl.conf.xml? Must it be done in the dialplan, that is, maybe you need to route calls differently because they are from certain IP addresses? I'm just trying to understand the scope of the problem. -MC
participants (7)
-
Brian West
-
David Ponzone
-
Dome Charoenyost
-
Madovsky
-
Michael Collins
-
Rob Forman
-
William Suffill