×

linux下建立ipip隧道的脚本

hqy hqy 发表于2019-04-20 23:52:46 浏览2245 评论0

抢沙发发表评论

#!/bin/bash
inet_ip="$1"
ipip_rmt_ip="$2"
ipip_num="$3"
modprobe ipip
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
ip tunnel add tun$ipip_num mode ipip remote $ipip_rmt_ip local $inet_ip ttl 64
ip link set tun$ipip_num mtu 1480 up
ip address add 172.16.$ipip_num.1 brd 255.255.255.255 peer 172.16.$ipip_num.2 dev tun$ipip_num
iptables -t mangle -o tun$ipip_num --insert FORWARD 1 -p tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:65495 -
j TCPMSS --clamp-mss-to-pmtu 
#add tun
ipip.sh 118.122.117.134 76.74.154.100 100 >> $log
ipip.sh 118.122.117.134 180.92.185.70 101 >> $log
ipip.sh 118.122.117.134 66.55.88.48 105 >> $log
ipip.sh 118.122.117.134 103.246.244.174 104 >> $log
ipip.sh 118.122.117.134 180.92.185.67 106 >> $log
ipip.sh 182.151.212.242 50.97.237.130 102 >> $log
ipip.sh 182.151.212.242 216.12.198.98 103 >> $log


 您阅读本篇文章共花了: 

打赏

本文链接:https://kinber.cn/post/611.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

群贤毕至

访客