#delete all rules
sudo iptables -F
sudo iptables -t nat -F
sudo iptables -t mangle -F
sudo iptables -X
# Enable routing.
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
# Masquerade.
sudo iptables -t nat -A POSTROUTING -j MASQUERADE
# Transparent proxying
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128
I2RlbGV0ZSBhbGwgcnVsZXMKc3VkbyBpcHRhYmxlcyAtRgpzdWRvIGlwdGFibGVzIC10IG5hdCAtRgpzdWRvIGlwdGFibGVzIC10IG1hbmdsZSAtRgpzdWRvIGlwdGFibGVzIC1YCgojIEVuYWJsZSByb3V0aW5nLgplY2hvIDEgfCBzdWRvIHRlZSAvcHJvYy9zeXMvbmV0L2lwdjQvaXBfZm9yd2FyZAoKIyBNYXNxdWVyYWRlLgpzdWRvIGlwdGFibGVzIC10IG5hdCAtQSBQT1NUUk9VVElORyAtaiBNQVNRVUVSQURFCgojIFRyYW5zcGFyZW50IHByb3h5aW5nCnN1ZG8gaXB0YWJsZXMgLXQgbmF0IC1BIFBSRVJPVVRJTkcgLXAgdGNwIC0tZHBvcnQgODAgLWogUkVESVJFQ1QgLS10by1wb3J0IDMxMjg=