Need help on how to rig a model with 2 fixed points

Hello, i need help with rigging, i can t find a tutorial on how to rig this, it s for a school project so my collegues can understand diagrams better.
1 and 2 should stay in place and the rest should move like i showed on the image.
Hope someone can help me.

You could try this:

Bone 2 and 3 were extruded from bone 1 and are connected (uncheck inherit rotation in 2 and 3). Bone 4 is the IK target of bone 3 ( bone 4 is unconnected and has no parent).

To pose rotate bone 2 on its local z axis, (if you want it all to stay straight).