The president warned Iran of further attacks if it fails to agree on a deal to end the war.