Forum Discussion
hoolio
Cirrostratus
Jun 14, 2007TCP port logging/decision-making with a FastL4 profile
Hello,
Can someone provide more info on why MCP validation of iRules prevents using TCP:: commands with a forwarding IP virtual server/fastL4 profile?
The reason I ask, is that I'd like to give a customer a rule which allows them to selectively drop traffic through a 0.0.0.0:0 IP forwarding virtual server based on the source IP/network and/or the destination IP/network and ports. The current restriction on TCP::commands means we can only make IP level decisions. This reduces the value of the rule significantly.
There have been a few posts on this but I haven't seen a definitive answer:
http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&forumid=5&postid=7986
01070394:3: TCP::client_port in rule (tcp_test) requires an associated TCP profile on the virtual server (ipforward_test).
http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&forumid=5&postid=8701
port filtering for a forwarding IP virtual server that uses a fastL4 profile with Loose Initiation and Loose Close enabled
If you either disable MCP validation of rules in the db, or use a trick to bypass the validation, it seems like you can access the port information. This test on 9.2.5 logged the correct ports and the connection worked through the BIG-IP:
when CLIENT_ACCEPTED {
log the client IP address:port -> destination IP address:port
set src_port_cmd TCP::client_port
set dest_port_cmd TCP::local_port
set src_port [eval $src_port_cmd]
set dest_port [eval $dest_port_cmd]
log local0. "client: [IP::client_addr]:$src_port -> [IP::local_addr]:$dest_port"
}
: client: 192.168.101.10:34040 -> 192.168.101.149:80So if the information is actually available, why does MCP prevent adding a TCP:: command? Is there any downside to accessing the info with a fastL4 virtual server?
Thanks,
Aaron
- spark_86682Historic F5 AccountFor a forwarding profile, your two choices are "Layer 2" or "IP", either of which can have non-TCP traffic on them, so the TCP::* commands might not be valid on any given packet.
- Mark_Porter_979
Nimbostratus
I'm in the same predicament, but upgrading to 9.4 isn't likely to happen for several months. Luckily I only had 100 ports to lock down, so I used two really ugly packet filter rules. - hoolio
Cirrostratus
Hi,when CLIENT_ACCEPTED { log the client IP address:port -> destination IP address:port set src_port_cmd TCP::client_port set src_port [eval $src_port_cmd] set dest_port_cmd TCP::local_port set dest_port [eval $dest_port_cmd] log local0. "client: [IP::client_addr]:$src_port -> [IP::local_addr]:$dest_port" if {$dest_port > 1024}{ requested port was over 1024, so drop it drop } elseif {$dest_port > 100 and $dest_port <= 1024}{ port was over 100 and less than 1024 so forward the request forward } else { requested port was less than 100, send a RST reject } }
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