I have the statement:
If(src_ip == 192.168.1.80/27) { # Do something cool } Else { # Don't do something cool };
When the src_ip (which I verified by xlog) is 192.168.1.85 it doesn't match and goes to the else code. Am I doing something wrong? This is on 0.8.14.
----------------------------------------
Michael Shuler, C.E.O. BitWise Communications, Inc. (CLEC) And BitWise Systems, Inc. (ISP) 682 High Point Lane East Peoria, IL 61611 Office: (217) 585-0357 Cell: (309) 657-6365 Fax: (309) 213-3500 E-Mail: mike@bwsys.net Customer Service: (877) 976-0711
On Sep 25, 2004 at 16:45, Michael Shuler mike@bwsys.net wrote:
I have the statement:
If(src_ip == 192.168.1.80/27) { # Do something cool } Else { # Don't do something cool };
When the src_ip (which I verified by xlog) is 192.168.1.85 it doesn't match and goes to the else code. Am I doing something wrong? This is on 0.8.14.
It should work (I've just checked it). Try to make a small config containing only this "if", and send me the output of ./ser -ddddddddddd -c -D -E -f config_name.cfg
Andrei
I figured it out. SER apparently uses strict sub netting. A /27 is 32 IP's and 80 is not evenly divisible by 32. I changed it to /28 which is 16 IP's and since 80/16 = 5 with no remainder it now works. It would be nice if SER didn't have that limitation but its not that big of a deal because I can just put an || in the if statement.
Thanks!
----------------------------------------
Michael Shuler, C.E.O. BitWise Communications, Inc. (CLEC) And BitWise Systems, Inc. (ISP) 682 High Point Lane East Peoria, IL 61611 Office: (217) 585-0357 Cell: (309) 657-6365 Fax: (309) 213-3500 E-Mail: mike@bwsys.net Customer Service: (877) 976-0711
-----Original Message----- From: Andrei Pelinescu-Onciul [mailto:pelinescu-onciul@fokus.fraunhofer.de] Sent: Sunday, September 26, 2004 3:14 AM To: Michael Shuler Cc: serusers@lists.iptel.org Subject: Re: [Serusers] Src_ip matching
On Sep 25, 2004 at 16:45, Michael Shuler mike@bwsys.net wrote:
I have the statement:
If(src_ip == 192.168.1.80/27) { # Do something cool } Else { # Don't do something cool };
When the src_ip (which I verified by xlog) is 192.168.1.85
it doesn't match
and goes to the else code. Am I doing something wrong?
This is on 0.8.14.
It should work (I've just checked it). Try to make a small config containing only this "if", and send me the output of ./ser -ddddddddddd -c -D -E -f config_name.cfg
Andrei
Are you saying you'll use 192.168.1.64/28 || 192.168.1.80/28 ?
Can you write 192.168.1.64/27? I didn't look at the code, but some other options might be
src_ip/27 == 198.168.1.80/27
I didn't know you could put the subnet in the ip. cool.
-g
On Sep 26, 2004, at 2:13 PM, Michael Shuler wrote:
I figured it out. SER apparently uses strict sub netting. A /27 is 32 IP's and 80 is not evenly divisible by 32. I changed it to /28 which is 16 IP's and since 80/16 = 5 with no remainder it now works. It would be nice if SER didn't have that limitation but its not that big of a deal because I can just put an || in the if statement.
Thanks!
Michael Shuler, C.E.O. BitWise Communications, Inc. (CLEC) And BitWise Systems, Inc. (ISP) 682 High Point Lane East Peoria, IL 61611 Office: (217) 585-0357 Cell: (309) 657-6365 Fax: (309) 213-3500 E-Mail: mike@bwsys.net Customer Service: (877) 976-0711
-----Original Message----- From: Andrei Pelinescu-Onciul [mailto:pelinescu-onciul@fokus.fraunhofer.de] Sent: Sunday, September 26, 2004 3:14 AM To: Michael Shuler Cc: serusers@lists.iptel.org Subject: Re: [Serusers] Src_ip matching
On Sep 25, 2004 at 16:45, Michael Shuler mike@bwsys.net wrote:
I have the statement:
If(src_ip == 192.168.1.80/27) { # Do something cool } Else { # Don't do something cool };
When the src_ip (which I verified by xlog) is 192.168.1.85
it doesn't match
and goes to the else code. Am I doing something wrong?
This is on 0.8.14.
It should work (I've just checked it). Try to make a small config containing only this "if", and send me the output of ./ser -ddddddddddd -c -D -E -f config_name.cfg
Andrei
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Greg Fausak www.AddaBrand.com (US) 469-546-1265
Pretty close I actually needed:
If(src_ip == 192.168.1.80/28 || src_ip == 192.168.1.96/28)
I don't think you can do the src_ip/27 thing though
----------------------------------------
Michael Shuler, C.E.O. BitWise Communications, Inc. (CLEC) And BitWise Systems, Inc. (ISP) 682 High Point Lane East Peoria, IL 61611 Office: (217) 585-0357 Cell: (309) 657-6365 Fax: (309) 213-3500 E-Mail: mike@bwsys.net Customer Service: (877) 976-0711
-----Original Message----- From: Greg Fausak [mailto:greg@addabrand.com] Sent: Sunday, September 26, 2004 3:50 PM To: Michael Shuler Cc: serusers@lists.iptel.org; 'Andrei Pelinescu-Onciul' Subject: Re: [Serusers] Src_ip matching
Are you saying you'll use 192.168.1.64/28 || 192.168.1.80/28 ?
Can you write 192.168.1.64/27? I didn't look at the code, but some other options might be
src_ip/27 == 198.168.1.80/27
I didn't know you could put the subnet in the ip. cool.
-g
On Sep 26, 2004, at 2:13 PM, Michael Shuler wrote:
I figured it out. SER apparently uses strict sub netting.
A /27 is
32 IP's and 80 is not evenly divisible by 32. I changed it to /28
which is 16
IP's and since 80/16 = 5 with no remainder it now works. It
would be nice
if SER didn't have that limitation but its not that big of a deal
because I
can just put an || in the if statement.
Thanks!
Michael Shuler, C.E.O. BitWise Communications, Inc. (CLEC) And BitWise Systems, Inc. (ISP) 682 High Point Lane East Peoria, IL 61611 Office: (217) 585-0357 Cell: (309) 657-6365 Fax: (309) 213-3500 E-Mail: mike@bwsys.net Customer Service: (877) 976-0711
-----Original Message----- From: Andrei Pelinescu-Onciul [mailto:pelinescu-onciul@fokus.fraunhofer.de] Sent: Sunday, September 26, 2004 3:14 AM To: Michael Shuler Cc: serusers@lists.iptel.org Subject: Re: [Serusers] Src_ip matching
On Sep 25, 2004 at 16:45, Michael Shuler mike@bwsys.net wrote:
I have the statement:
If(src_ip == 192.168.1.80/27) { # Do something cool } Else { # Don't do something cool };
When the src_ip (which I verified by xlog) is 192.168.1.85
it doesn't match
and goes to the else code. Am I doing something wrong?
This is on 0.8.14.
It should work (I've just checked it). Try to make a small config containing only this "if", and
send me the
output of ./ser -ddddddddddd -c -D -E -f config_name.cfg
Andrei
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Greg Fausak www.AddaBrand.com (US) 469-546-1265
On Sep 26, 2004 at 14:13, Michael Shuler mike@bwsys.net wrote:
I figured it out. SER apparently uses strict sub netting. A /27 is 32 IP's and 80 is not evenly divisible by 32. I changed it to /28 which is 16 IP's and since 80/16 = 5 with no remainder it now works. It would be nice if SER didn't have that limitation but its not that big of a deal because I can just put an || in the if statement.
For src_ip == ip/mask, ser does (src_ip & mask) == ip. You would like it to do: (src_ip & mask) == (ip & mask) ? The change would be trivial, the only question is if it brings any unexpected matches. In your case x.x.x.80/27 would be equivalent to x.x.x.64/27.
Andrei
On Sep 28, 2004, at 5:30 AM, Andrei Pelinescu-Onciul wrote:
On Sep 26, 2004 at 14:13, Michael Shuler mike@bwsys.net wrote:
I figured it out. SER apparently uses strict sub netting. A /27 is 32 IP's and 80 is not evenly divisible by 32. I changed it to /28 which is 16 IP's and since 80/16 = 5 with no remainder it now works. It would be nice if SER didn't have that limitation but its not that big of a deal because I can just put an || in the if statement.
For src_ip == ip/mask, ser does (src_ip & mask) == ip. You would like it to do: (src_ip & mask) == (ip & mask) ?
This makes more sense to me. Either that or produce an error message when parsing the ip/mask complaining about a bogus network number, or a warning stating that the statement will never match anything.
---greg
The change would be trivial, the only question is if it brings any unexpected matches. In your case x.x.x.80/27 would be equivalent to x.x.x.64/27.
Andrei
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Greg Fausak www.AddaBrand.com (US) 469-546-1265
On Sep 28, 2004 at 09:43, Greg Fausak greg@addabrand.com wrote:
On Sep 28, 2004, at 5:30 AM, Andrei Pelinescu-Onciul wrote:
On Sep 26, 2004 at 14:13, Michael Shuler mike@bwsys.net wrote:
I figured it out. SER apparently uses strict sub netting. A /27 is 32 IP's and 80 is not evenly divisible by 32. I changed it to /28 which is 16 IP's and since 80/16 = 5 with no remainder it now works. It would be nice if SER didn't have that limitation but its not that big of a deal because I can just put an || in the if statement.
For src_ip == ip/mask, ser does (src_ip & mask) == ip. You would like it to do: (src_ip & mask) == (ip & mask) ?
This makes more sense to me. Either that or produce an error message when parsing the ip/mask complaining about a bogus network number, or a warning stating that the statement will never match anything.
I've just made ser (unstable cvs) to fix this and issue a warning. (net.ip= net.ip & net.mask)
Andrei