All-atom simulations with walls constraints

GROMACS version: 2021
GROMACS modification: Yes/No
Hi, I am a beginner of gromacs. Now I want to add two walls along XY-plane to restraint the ligand to leave the pocket along Z-axis. But the mdp parameters of walls can only be set to z=0 and z=z-box which cover the pocket and prevent the ligand from leaving. Does anyone know how to solve the problem? Thanks a lot!
; Walls
nwall = 2 ; wall at z=0 and z=z-box
wall-atomtype = CA CA
wall-type = 10-4 ; direct 12-6 LJ as fn of distance from wall
wall-r-linpot = 3
wall-density = 50 50
wall-ewald-zfac = 3