|
@@ -117,7 +117,7 @@ function ipts_update() {
|
|
|
|
|
|
|
|
iptables -t nat -A OUTPUT -p tcp -j SS-TCP
|
|
iptables -t nat -A OUTPUT -p tcp -j SS-TCP
|
|
|
|
|
|
|
|
- for intranet in "$iptables_intranet"; do
|
|
|
|
|
|
|
+ for intranet in "${iptables_intranet[@]}"; do
|
|
|
iptables -t mangle -A PREROUTING -p udp -s $intranet ! -d $intranet --dport 53 -j ACCEPT
|
|
iptables -t mangle -A PREROUTING -p udp -s $intranet ! -d $intranet --dport 53 -j ACCEPT
|
|
|
iptables -t nat -A PREROUTING -p udp -s $intranet ! -d $intranet --dport 53 -j REDIRECT --to-ports 53
|
|
iptables -t nat -A PREROUTING -p udp -s $intranet ! -d $intranet --dport 53 -j REDIRECT --to-ports 53
|
|
|
|
|
|
|
@@ -137,7 +137,7 @@ function ipts_origin() {
|
|
|
iptables -t nat -F SS-TCP &> /dev/null
|
|
iptables -t nat -F SS-TCP &> /dev/null
|
|
|
iptables -t nat -X SS-TCP &> /dev/null
|
|
iptables -t nat -X SS-TCP &> /dev/null
|
|
|
|
|
|
|
|
- for intranet in "$iptables_intranet"; do
|
|
|
|
|
|
|
+ for intranet in "${iptables_intranet[@]}"; do
|
|
|
iptables -t nat -A PREROUTING -p udp -s $intranet -d $intranet --dport 53 -j DNAT --to-destination ${dns_original[0]}
|
|
iptables -t nat -A PREROUTING -p udp -s $intranet -d $intranet --dport 53 -j DNAT --to-destination ${dns_original[0]}
|
|
|
iptables -t nat -A POSTROUTING -s $intranet ! -d $intranet -j MASQUERADE
|
|
iptables -t nat -A POSTROUTING -s $intranet ! -d $intranet -j MASQUERADE
|
|
|
done
|
|
done
|
|
@@ -164,7 +164,7 @@ function dns_update() {
|
|
|
}
|
|
}
|
|
|
function dns_origin() {
|
|
function dns_origin() {
|
|
|
echo "# Generated by ss-tproxy at $(date '+%F %T')" > /etc/resolv.conf
|
|
echo "# Generated by ss-tproxy at $(date '+%F %T')" > /etc/resolv.conf
|
|
|
- for dns in "$dns_original"; do
|
|
|
|
|
|
|
+ for dns in "${dns_original[@]}"; do
|
|
|
echo "nameserver $dns" >> /etc/resolv.conf
|
|
echo "nameserver $dns" >> /etc/resolv.conf
|
|
|
done
|
|
done
|
|
|
}
|
|
}
|