I need to capture in LTM v10 all TCP request, TCP Reset and TCP Establishment that are generated by Clients… the same information that I see with a tcpdump but I need to capture the log all the time.
It’s not currently possible to access the TCP flags from an iRule. You could log when a TCP connection from a client to a virtual server from the CLIENT_ACCEPTED event:
when CLIENT_ACCEPTED {
Log locally or remotely that a connection was established
http://devcentral.f5.com/wiki/default.aspx/iRules/log
log local0. "[IP::client_addr]:[TCP::client_port]: Connection to [IP::local_addr]:[TCP::local_port] on [virtual name]"
}
You can read the options from the TCP headers, but this doesn’t include the TCP flags that you’re looking for.
Thanks for your answer, with this iRule it´s possible to capture all ip address that request a connection or only a specific… and it´s possible to capture the disconnection too?
And are there other form to capture the same that i see trought tcpdump?
Thanks for your answer, with this iRule it´s possible to capture all ip address that request a connection or only a specific… and it´s possible to capture the disconnection too?
And are there other form to capture the same that i see trought tcpdump?
That iRule would log the client IP:port and virtual server IP:port on any connection that was successfully established. If you wanted to log this info for connection closes as well, you could use the CLIENT_CLOSED event. These are the only options that iRules support for your scenario.
Can you clarify what you’re trying to do with this information? Is this for testing or production use?
The objective is to see if the client closed the connection or if the server closed the connection, basically is to know who generated the disconnection.
Is an production enviroment but maybe its possible to do in testing environment.
That won’t be exactly possible with an iRule. You could try to track whether the clientside or serverside connection was closed first but that still won’t tell you who sent a FIN or RST first.
What’s your overall goal for this scenario? I think tcpdump might be a more appropriate tool.
Yes, actually I need the same information that I see with tcpdump command, but I need capture all connections and send it to a remote log server?.. it’s possible?
I don’t know of a simple way to get a tcpdump sent in syslog format. But you could run the tcpdump from a remote host and get the output on the remote host:
sol1700: Saving large tcpdump packet traces when disk space is limited
Perform the tcpdump remotely through SSH
To use SSH to save the tcpdump remotely to the client’s memory file, perform the following steps:
This command is executed on the BIG-IP or 3-DNS system, but writes the mytcpdump.bin output file to the client system.
Important: The tcpdump output is buffered. If you issue CTRL-C on the system from which you are running the commands, it will terminate SSH, not the remote tcpdump. This will result in an incomplete or useless tcpdump collection; therefore, it is important to wait for the tcpdump process to complete collecting the specified number of packets.
I reviewed your last suggestion but i can see that these command its limited to specific number of packets to capture… I need the all logs of the connection and disconnection that crossing the BIG-IP.
It´s possible to do trought tcpdump command?.. or any alterntive sugestion.
I am triying to obtain an example of log that I like to obtain… as soon as possible, I will sharing with you.
The last suggestion allows you to run tcpdump with any switches you want. The specific example captures 10,000 packets, but you could remove that flag to continuously capture. You can also customize the filters to only capture specific TCP flags like SYN or FIN or RST.