You can make using safe network illegal. You can make not using a state mandated filter illegal. You can make using encryption illegal. You can make it a legal requirement thqt every request to the network you make is logged to the nearest state data centre. The list goes on.
Enforcement is a different matter though. Hard drugs are illegal, guns are illegal in my places, murder is illegal, theft is illegal, etc. It still happens though.