How can I treat peritonitis?

You can't. This needs immediate er attention and always will result in a hospital admission, likely abdominal surgery and high dose antibiotic treatment. You can't do this on your own and you must act quickly before you pass out.

Related Questions

How can I treat peritonitis - dialysis associated?

Antibiotics. To be prescribed by your dialysis doctor. They could be put directly into the peritoneal fluid by your dialysis nurse.
Antibiotics.... ..And occasionally removal of the catheter.