Bacterial porins are water-filled xcexb2-barrel channels that allow translocation of solutes across the outer membrane. They feature a constriction zone, contributed by the plunging of extracellular loop 3 (L3) into the channel lumen. Porins are generally in the open state, but undergo gating in response to external voltages. To date the underlying mechanism is unclear. Here we report results from molecular dynamics simulations on the two porins of Providenica stuartii, Omp-Pst1 and Omp-Pst2, which display distinct voltage sensitivities. Voltage gating was observed in Omp-Pst2, where the binding of cations in-between L3 and the barrel wall results in exposing a conserved aromatic residue in the channel lumen, thereby halting ion permeation. Comparison of Omp-Pst1 and Omp-Pst2 structures and trajectories suggests that their sensitivity to voltage is encoded in the hydrogen-bonding network anchoring L3 onto the barrel wall, as we observed that it is the strength of this network that governs the probability of cations binding behind L3. That Omp-Pst2 gating is observed only when ions flow against the electrostatic potential gradient of the channel furthermore suggests a possible role for this porin in the regulation of charge distribution across the outer membrane and bacterial homeostasis. 