Peripherally selective compounds that modulate both the mu opioid receptor (MOR) and the kappa opioid receptor (KOR) are provided. The compounds are substituted derivatives of 6p-N-heterocyclic naltrexamine (NAP) and are used in the treatment of diseases involving visceral pain such as irritable bowel syndrome (IBS), opioid induced constipation (OIC), and others.