|
|
@ -18,15 +18,16 @@ ipv4_tproxy() { # IPv4 tproxy settings |
|
|
|
ip -4 route add local 0.0.0.0/0 dev lo table 100 |
|
|
|
iptables -t mangle -N XRAY |
|
|
|
|
|
|
|
echo "[TProxy] IPv4 bypass" |
|
|
|
for cidr in $(ip -4 addr | grep -w "inet" | awk '{print $2}') # bypass local ipv4 range |
|
|
|
do |
|
|
|
echo "[TProxy] IPv4 bypass $cidr" |
|
|
|
echo "[TProxy] $cidr" |
|
|
|
eval "iptables -t mangle -A XRAY -d $cidr -j RETURN" |
|
|
|
done |
|
|
|
|
|
|
|
while read -r cidr # bypass custom ipv4 range |
|
|
|
do |
|
|
|
echo "[TProxy] IPv4 bypass $cidr" |
|
|
|
echo "[TProxy] $cidr" |
|
|
|
eval "iptables -t mangle -A XRAY -d $cidr -j RETURN" |
|
|
|
done < /etc/xray/expose/network/bypass/ipv4 |
|
|
|
|
|
|
@ -40,15 +41,16 @@ ipv6_tproxy() { # IPv6 tproxy settings |
|
|
|
ip -6 route add local ::/0 dev lo table 106 |
|
|
|
ip6tables -t mangle -N XRAY6 |
|
|
|
|
|
|
|
echo "[TProxy] IPv6 bypass" |
|
|
|
for cidr in $(ip -6 addr | grep -w "inet6" | awk '{print $2}') # bypass local ipv6 range |
|
|
|
do |
|
|
|
echo "[TProxy] IPv6 bypass $cidr" |
|
|
|
echo "[TProxy] $cidr" |
|
|
|
eval "ip6tables -t mangle -A XRAY6 -d $cidr -j RETURN" |
|
|
|
done |
|
|
|
|
|
|
|
while read -r cidr # bypass custom ipv6 range |
|
|
|
do |
|
|
|
echo "[TProxy] IPv6 bypass $cidr" |
|
|
|
echo "[TProxy] $cidr" |
|
|
|
eval "ip6tables -t mangle -A XRAY6 -d $cidr -j RETURN" |
|
|
|
done < /etc/xray/expose/network/bypass/ipv6 |
|
|
|
|
|
|
@ -71,4 +73,4 @@ custom_script="/etc/xray/expose/custom.sh" |
|
|
|
[ -f "$custom_script" ] && sh $custom_script |
|
|
|
|
|
|
|
echo "[TProxy] Start xray service." |
|
|
|
xray -confdir /etc/xray/config/ |
|
|
|
xray -confdir /etc/xray/config |
|
|
|