📄 westrun.sh
字号:
#!/bin/sh# we can transmit in the clearping -q -c 8 -n 192.1.2.23# bring up the tunnelipsec auto --up west-east# use the tunnel#ping -q -c 8 -n 192.1.2.23# show the tunnel!echo "Tunnel should be up"ipsec eroute# Let R_U_THERE packets flowsleep 15echo "Setting up block"iptables -I INPUT -s 192.1.2.23/32 -d 0/0 -j DROPiptables -I OUTPUT -d 192.1.2.23/32 -s 0/0 -j DROPsleep 10ipsec eroutesleep 10ipsec eroutesleep 10# DPD should have triggered nowecho "Tunnel should be down"ipsec eroute# Remove the Blockageecho "Removing block"iptables -D INPUT -s 192.1.2.23/32 -d 0/0 -j DROPiptables -D OUTPUT -d 192.1.2.23/32 -s 0/0 -j DROPping -q -c 8 -n 192.1.2.23# Tunnel should be back up nowecho "Tunnel should be up"ipsec erouteecho end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -