I used openvpn to create a tun interface on linux

openvpn --mktun --dev tun2
ip link set tun2 up
ip addr add dev tun2

now I want to modify the ip address to, how to do it? besides, how to remove tun2



If you want to remove an ip address simply use del instead of `add.

So ip addr del dev tun2 to remove an IP. But since you want to remove the interface that doesn't really matter.

To remove an tun* interface simply use ip link del name or in your case ip link delete tun2.

  • Additionally, if you want it to stay deleted after reboot, use openvpn --rmtun --dev tun2. – aquaherd Aug 29 '16 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.