We must have $4p \equiv_N 0$ meaning $N=2p$ or $N=4p$ (since $p=0$ is forbidden): Let $i_0$ have $\sigma(i_0)=0.$ Then you require that for all $j,$ $$0 \equiv_N qi_0(1+2j)+2p$$
If $i_0=0$ then $0 \equiv_N 2p.$ There are still the other values of $i$ to consider but @MaxAlekseyev has given a solution.
Otherwise, putting $j=0$ and $1$, we have that $qi_0+2p\equiv 3qi_0+2p \equiv 0$ Hence $2qi_0 \equiv 0$ and also $4p \equiv 0.$
So another solution (after checking) is $N=4p=2q$ and $\sigma$ the identity permutation. In fact, $\sigma$ can be any permutation which preserves parity.