The permeability of the bacterial outer membrane, enclosing Gram-negative bacteria, depends on the interactions of the outer, lipopolysaccharide (LPS) layer, with surrounding ions and molecules. We present a coarse-grained model for describing how cationic amphiphilic molecules (e.g., antimicrobial peptides) interact with and perturb the LPS layer in a biologically relevant medium, containing monovalent and divalent salt ions (e.g., Mg^{2+}). In our approach, peptide binding is driven by electrostatic and hydrophobic interactions and is assumed to expand the LPS layer, eventually priming it for disruption. Our results suggest that in parameter ranges of biological relevance (e.g., at micromolar concentrations) the antimicrobial peptide magainin 2 effectively disrupts the LPS layer, even though it has to compete with Mg^{2+} for the layer. They also show how the integrity of LPS is restored with an increasing concentration of Mg^{2+}. Using the approach, we make a number of predictions relevant for optimizing peptide parameters against Gram-negative bacteria and for understanding bacterial strategies to develop resistance against cationic peptides.