Just to elaborate a bit on what Rahul and I mentioned in the comments.

Take the action functional to be $\int_0^1 (y'')^2 dt$, with prescribed boundary conditions $y(0) = a$, $y(1) = b$, $y'(0) = c$, $y'(1) = d$. For finding the free evolution, take the variation of the function relative to $y$ and set it to zero. Immediately this gives
$$\int_0^1 y'' (\delta y)'' dt = 0 $$
for any perturbation. The boundary conditions prescribed implies that $\delta y(0) = \delta y(1) = \delta y'(0) = \delta y'(1) = 0$. So we are allowed to integrate by parts twice (assuming the solution is $C^4$) and obtain $y'''' = 0$, which implies that $y(t)$ is a cubic polynomial in time and thus has 4 free parameters, which we can fix by the boundary values.

The intuition for the bounded case is that, until the evolution hits the wall, locally the equation of motion should be identical to the free evolution. So the solution should be composed piecewise of cubic polynomials. Every time it hits the wall it should receive a hard impact, which suggests that $y''''(\tau_i) = c\delta_{\tau_i}$, the Dirac delta. (The same way that for a hard billiard which away from the walls travel via $x'' = 0$ receive a delta function impact in the second derivative when it hits a wall.) This suggests that $y'''$ is a step function of $t$, and $y''$ is continuous.

For an example, let $l = -1, u = 1$, let the initial time be $t = 0$, and final time be $t = 2$. Let $a = b = 0$, and $c = d = 6$.

First solve the free problem: we want
$$ k_3 t^3 + k_2 t^2 + k_1 t + k_0 = y(t) $$
Plugging in the values for the four points we find by solving the linear system that the equation should be
$$ y(t) = 3t^3 - 9 t^2 + 6t $$
which achieves its local max and min in $[0,2]$ at $1\pm \sqrt{1/3}$, at which points $|y| = |\pm \sqrt{4/3}| > 1$. So the free evolution is no go.

There should be two break points, but for illustration we try first with one break point. Assume the break point is at $\tau$ where $y(\tau) = 1$. So we have a system of equations using the data at the points $2,0,\tau$ and the cubic ansatz
$$ y |_{[0,\tau]} = \sum \alpha_kt^k,\qquad y|_{[\tau,2]} = \sum \beta_k t^k$$
which leads to
$$\alpha_0 = 0, \alpha_1 = 6, \alpha_3 \tau^3 + \alpha_2\tau^2 + 6 \tau = 1, 3\alpha_3\tau^2 + 2\alpha_2\tau + 6 = 0$$
and
$$8\beta_3 + 4\beta_2 + 2\beta_1 + \beta_0 = 0, 12\beta_3 + 4\beta_2 + \beta_1 = 6, \beta_3\tau^3 + \beta_2\tau^2 + \beta_1\tau + \beta_0 = 1, 3\beta_3\tau^2 + 2\beta_2\tau + \beta_1 = 0$$
which gives
$$\alpha_0 = 0, \alpha_1 = 6, \alpha_2 = -12 / \tau, \alpha_3 = 6 / \tau^2$$
$$\beta_3 = (6\tau - 2)/(\tau - 2)^3, \beta_2 = -3(5\tau^2 - 3\tau + 6) / 2(\tau - 2)^3 $$
Continuity of $y''$ then implies
$$ 6\tau \alpha_3 + 2\alpha_2 = 6 \tau\beta_3 + 2\beta_2 $$
or
$$ 3\tau^2 + 23 \tau^2 - 42 \tau - 32 = 0$$
which has two negative roots and one positive one at $\tau = 2$ which we can throw out. And thus 1 break point it not enough.

A direct computation (if I did it right, which is not guaranteed) with 2 break points $\sigma\in [1,2]$ and $\tau \in[0,1]$ yields that $\tau = 1/2$ and $\sigma = 3/2$ an admissible pair. It is just linear algebra in the end.