  In this paper, we study achievable degrees of freedom (DoF) of a
multiple-input multiple-output (MIMO) multiway relay channel (mRC) where $K$
users, each equipped with $M$ antennas, exchange messages in a pairwise manner
via a common $N$-antenna relay node. % A novel and systematic way of joint
beamforming design at the users and at the relay is proposed to align signals
for efficient implementation of physical-layer network coding (PNC). It is
shown that, when the user number $K=3$, the proposed beamforming design can
achieve the DoF capacity of the considered mRC for any $(M,N)$ setups. % For
the scenarios with $K>3$, we show that the proposed signaling scheme can be
improved by disabling a portion of relay antennas so as to align signals more
efficiently. Our analysis reveals that the obtained achievable DoF is always
piecewise linear, and is bounded either by the number of user antennas $M$ or
by the number of relay antennas $N$. Further, we show that the DoF capacity can
be achieved for $\frac{M}{N} \in \left(0,\frac{K-1}{K(K-2)} \right]$ and
$\frac{M}{N} \in \left[\frac{1}{K(K-1)}+\frac{1}{2},\infty \right)$, which
provides a broader range of the DoF capacity than the existing results.
Asymptotic DoF as $K\rightarrow \infty$ is also derived based on the proposed
signaling scheme.
