Thanks for your query,based on the facts that you have posted it appears that you haveeither sebaceous cyst
or boil over foreskin..However this needs to be confirmed by clinical examination by a qualified General surgeon
You need to take broad spectrum antibiotics like Cefotaxime
along with anti inflammatory medication like Diclofenac
Ensure to wash your genital twice daily .
If problem persists even after a wek you may need to drain or excise it under local anaesthesia.