Fetch the repository succeeded.
This action will force synchronization from Quard/quard_star_tutorial, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
#!/bin/bash
set -e
MODE=\
"config_tap | \
release_tap"
USER_NAME=$(whoami)
USAGE="usage $0 [$MODE] [<ETH_NAME>] "
if [ $# == 2 ] ; then
ETH_NAME=$1
else
ETH_NAME=enp2s0f0 #eth0
fi
config_tap()
{
brctl addbr br0
ip addr flush dev $ETH_NAME
brctl addif br0 $ETH_NAME
tunctl -t tap0 -u $USER_NAME
brctl addif br0 tap0
ifconfig $ETH_NAME up
ifconfig tap0 up
ifconfig br0 up
ip addr flush dev br0
ip addr flush dev tap0
ip addr flush dev $ETH_NAME
# static
ip addr add 169.254.105.176/16 brd + dev br0
# dynamic
#dhclient -v br0
}
release_tap()
{
brctl delif br0 tap0
tunctl -d tap0
brctl delif br0 $ETH_NAME
ifconfig br0 down
brctl delbr br0
ifconfig $ETH_NAME up
# static
ip addr add 169.254.105.176/16 brd + dev $ETH_NAME
# dynamic
#dhclient -v $ETH_NAME
}
case "$1" in
config_tap)
config_tap
;;
release_tap)
release_tap
;;
--help)
echo $USAGE
exit 0
;;
*)
echo $USAGE
exit 1
;;
esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。