ip tuntap add test_tun mode tap user root
ioctl(TUNSETIFF): Device or resource busy

 

#!/bin/sh
set -x

switch=virbr0 

if [ -n "$1" ];then
    ip tuntap add $1 mode tap user `whoami`
    ip link set $1 up
    sleep 0.5s
    ip link set $1 master $switch
    exit 0
else
    echo "Error: no interface specified"
    exit 1
fi

 

原来是test_tun已经存在了

ioctl(TUNSETIFF): Device or resource busy

 

 

 ip link del test_tun

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
  • 2021-12-10
  • 2021-11-18
  • 2022-12-23
猜你喜欢
  • 2021-12-16
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案