In order to freeze a bond length, angle or dihedral, it is important to set the Opt=ModRedundant directive.

%nprocshared=20
%mem=40GB
%chk=/global/archive/phchm/ir-goettingen/s0opt2/ir_opt.chk
#P b3lyp/def2SVP opt=ModRedundant scf=(tight,MaxCycle=500) pop=full iop(6/7=3) gfinput gfoldprint gfprint EmpiricalDispersion=GD3 SCRF=(PCM,Solvent=Acetonitrile)

Ir complex with B3LYP

1 1
C -2.38008 0.32587 0.65976
S -4.86842 0.34670 -0.74159
S -5.07214 1.14093 0.59786
C -3.51219 -0.45064 -1.51185
...
Ir 0.59352 0.00001 -0.00005

D 1 2 3 4 0.00 B
D 1 2 3 4 F


The D 1 2 3 4 0.00 B indicates a dihedral (other possibilities: X for Cartesian coordinate, B for bond length, A for angle or L for linear bend), the four involved atoms (indicated by their number in the xyz part), the value of the dihedral (0.00 in this case) and B for "build", i.e., create this redundant definition. The following line, D 1 2 3 4 F,  takes the dihedral and freezes it at the previously specified value. Here, the dihedral is constrained at 0 degrees.