Cellulose nanofibrils (CNF) form hydrogels at low concentrations. These hydrogels are held together by transient interactions such as entanglement of fibrils, non-specific ionic interactions and hydrogen bonds; and are thus vulnerable for changes in the chemical environment or the influence of mechanical forces. By a covalent crosslinking of the fibrils, stable permanent gels can be formed. In this study we have produced CNF by using TEMPO mediated oxidation followed by fibrillation. During this procedure, carboxyl and aldehyde groups are introduced on the CNF surfaces. The aldehyde groups are suitable sites for crosslinking, as aldehydes readily form covalent bonds to primary amines through formation of Schiff bases. For this purpose the diamines ethylenediamine and hexamethylenediamine, differing with four carbon atoms in the chain, were used as crosslinker molecules. The results show that by varying the concentration and length of the crosslinker molecules, the elastic modulus of the gels could be controlled. The reversible gels were in this way transformed to irreversible gels by a simple water based reaction. Controlling gel strength is one important premise for the use of CNF in applications such as tissue engineering.