确认内核是否有tun模块
# modinfo tun
yum install tunctl -y
如果找不到
vim /etc/yum.repos.d/nux-misc.repo
[nux-misc]
name=Nux Misc
baseurl=http://li.nux.ro/download/nux/misc/el7/x86_64/
enabled=0
gpgcheck=1
gpgkey=http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
# yum --enablerepo=nux-misc install tunctl
---------------------------------------
tunctl -t tap0 -u root
tap0 是虚拟网卡名字
ifconfig tap0 172.168.1.1 netmask 255.255.255.0 promisc
172.168.1.1 是ip地址
查看
ifconfig tap0