From history it seems that you might be having forming anal abscess
or Fistula in ano giving rise this problem.
Go for one antibiotic and anti-inflammatory medicine course for 5 days.
If there is no improvement then you have to consult surgeon for exact diagnosis and treatment.
Ok and take care.