Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #/etc/rc.local
- iptables -t mangle -F
- iptables -t mangle -X
- echo 0 > /proc/sys/net/ipv4/conf/lo/rp_filter
- echo 1 > /proc/sys/net/ipv4/ip_forward
- ip rule add fwmark 1 lookup 100
- ip route add local 0.0.0.0/0 dev lo table 100
- iptables -t mangle -N DIVERT
- iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
- iptables -t mangle -A DIVERT -j MARK --set-mark 1
- iptables -t mangle -A DIVERT -j ACCEPT
- iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3128
- iptables -t mangle -A PREROUTING -p tcp --dport 8080 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
- iptables -t mangle -A PREROUTING -p tcp --dport 443 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
- ##############################################
- /ip firewall mangle
- add action=mark-connection chain=prerouting comment="HTTP + HTTPS TO PROXY" dst-port=80,443 new-connection-mark=to_proxy protocol=tcp src-address=192.168.10.0/24
- add chain=prerouting src-mac-address=xx:xx:xx:xx:xx:xx
- add action=mark-routing chain=prerouting connection-mark=to_proxy new-routing-mark=tproxy_route passthrough=no
- /ip route
- add distance=1 gateway=192.168.5.2 routing-mark=tproxy_route
- lan= 192.168.10.0/24
- ip ubuntu 192.168.5.2
- mac ubuntu xx:xx:xx:xx:xx:xx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement