Tehran has warned it will retaliate against US military bases and Israel if Iran is attacked.