Water wetting behavior in nanoconfined environments plays an important role in mass transport and signal transmission of organisms. It is valuable and challenging to investigate how water behaves in such a nanometer-scale with external stimuli, in particular with electric field and light. Unfortunately, the mechanism of hydrophobic reaction inside the nanospaces is still obscure and lacks experimental support for the current electric-field- or photoresponsive nanochannels which suffer from fragility or monofunctionality. Here, we design functionalized hydrophobic nanopores to regulate ion transport by light and electric field using azobenzene-derivatives-modified polymer nanochannels. With these addressable features, we can control the pore surface wetting behavior to switch the nanochannels between nonconducting and conducting states. Furthermore, we found these hydrophobic nanochannels are rough with a contact angle of 67.3°, making them extremely different from the familiar ones with a smooth pore surface and larger contact angles (>90°). These findings point to new opportunities for studying and manipulating water behavior in nanoconfined environments.