Does iPhone 5 have a terminal?
iPhone does have a shell, bash to be specific, but you can't access the shell without jailbreaking, and any 'shell' app from the App Store won't have the ability to interact with the device in any reasonable manner necessary for fixing network problems.