Some carriers are legally obliged to unlock your device for free (e.g., in Canada, the EU, and certain US states).
Power off the router, insert the "foreign" SIM card, and power it back on. Unlock Huawei B311-221