#!/bin/bash
echo 1 > /proc/sys/net/ipv4/ip_forward
proxy_host=x.x.x.x
proxy_port=8080
iptables -F
iptables -F -t nat
iptables -t nat -A OUTPUT -p tcp -d 127.0.0.0/8 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp -d 10.0.0.0/8 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp -d 172.16.0.0/16 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp -d 172.19.0.0/16 -j ACCEPT
iptables -t nat -A OUTPUT -p tcp --dport 80 -j DNAT --to-destination
"$proxy_host":"$proxy_port"
proxy via iptables
poster:
MarlboroMoo on
11:56
tag:
linux tip
0 comments:
張貼留言