Forum Discussion
Stephan_Manthe1
Nimbostratus
May 27, 2010IP-address based classes support routing domains in v10.1?
Hi,
I´m trying to use IP-addresses with routing domain information in a datagroup on 10.1-HF1 as follows:
class dg_rd123_ip {
{ host 10.123.123.80%123
network 10.123.123.96%123/28
}
}
The following expression doesn´t match:
[class match [IP::local_addr] equals dg_rd123_ip]
A tested workaround is using a string-based datagroup:
class dg_names {
{ "10.123.123.80%123"
"10.123.123.82%123"
}
}
But I would like to use the IP-based datagroup type allowing to specify networks as well.
Any ideas?
Thanks,
Stephan
- hoolio
Cirrostratus
Hi Stephan,class 123 class dg_rd123_ip { { host 10.123.123.80 network 10.123.123.96/28 } } class 456 class dg_rd456_ip { { host 10.123.123.100 network 10.123.123.96/28 } }
when CLIENT_ACCEPTED { Check if there is a route domain in the IP::client_addr value if {[scan [IP::client_addr] {%[^%]%%%s} ip rdomain] == 2}{ There was a route domain for the client IP address Check if there is a corresponding class if {[class exists "dg_rd${rdomain}_ip"]}{ There is a corresponding class, so check if the client IP is in it if {[class match $ip equals "dg_rd${rdomain}_ip"]}{ Client IP is in the corresponding class } } } else { Client IP doesn't have a route domain, so look up against a default route domain datagroup? ... if {[class match [IP::client_addr] equals "dg_rd_default_ip"]}{ Client IP is in the corresponding class } } }
- hoolio
Cirrostratus
dupe - hoolio
Cirrostratus
dupe - hoolio
Cirrostratus
dupe - hoolio
Cirrostratus
Hi Stefan, - hoolio
Cirrostratus
The scan command is trying to parse the IP::client_addr output to see if it's in the form of IP address%route_domain. If it is, then the client IP is searched for in a datagroup which has the route domain in the name. If the IP is in that datagroup, then the connection is allowed. For all other cases, the request is dropped.when CLIENT_ACCEPTED { log local0. "[IP::client_addr]:[TCP::client_port]: Connection to [IP::local_addr]:[TCP::local_port]" Check if there is a route domain in the IP::client_addr value if {[scan [IP::client_addr] {%[^%]%%%s} ip rdomain] == 2}{ log local0. "[IP::client_addr]:[TCP::client_port]: Parsed $ip and $rdomain" There was a route domain for the client IP address Check if there is a corresponding class if {[class exists "SMTP_whitelist_${rdomain}"]}{ log local0. "[IP::client_addr]:[TCP::client_port]: Class, SMTP_whitelist_${rdomain}, exists for route domain $rdomain" There is a corresponding class, so check if the client IP is in it if {[class match $ip equals "SMTP_whitelist_${rdomain}"]}{ log local0. "[IP::client_addr]:[TCP::client_port]: Found $ip in SMTP_whitelist_${rdomain}, allowing connection." Client IP is in the corresponding class Exit this event in this rule All other cases will be rejected return } } } If we're still in the iRule, the client isn't allowed, so drop the connection log local0. "[IP::client_addr]:[TCP::client_port]: Dropping request." drop }
- hoolio
Cirrostratus
Hi Stefan, - Ed_Hammond_2611
Nimbostratus
Running 10.1.0 HF2 has this problem. Opened a case, and got the response: - hoolio
Cirrostratus
I don't believe this update has been completed yet. So if you find that route domain handling in the class commands would be useful for you, please open a case with F5 Support and ask to have your request attached to ID 337222.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects