Both Afghanistan and Iran have been battling insurgents and smugglers along their joint border .