In the past I have created this with constraints and not IK. Here is a video going over one in Maya. The concepts you want are similar to a piston and that is why I linked the video. Understanding Maya 3D Piston Tutorial - YouTube