Skip to content

Instantly share code, notes, and snippets.

@j67678
Last active May 26, 2016 10:52
Show Gist options
  • Select an option

  • Save j67678/01cd926739d4ac751efaae51d94d7fea to your computer and use it in GitHub Desktop.

Select an option

Save j67678/01cd926739d4ac751efaae51d94d7fea to your computer and use it in GitHub Desktop.
CentOS 7 squid
setenforce 0
ulimit -n 1048576
echo "* soft nofile 1048576" >> /etc/security/limits.conf
echo "* hard nofile 1048576" >> /etc/security/limits.conf
echo "alias net-pf-10 off" >> /etc/modprobe.d/dist.conf
echo "alias ipv6 off" >> /etc/modprobe.d/dist.conf
killall sendmail
systemctl stop postfix
systemctl disable postfix
yum -y install squid wget
wget -O /etc/squid/squid.conf https://gist.github.com/renzhn/176792ca339de9d4a024876286431cfd/raw/4b317d9b3713c7b60730a9622093faa6e848fed9/squid.conf
squid -z
systemctl restart squid
systemctl enable squid
iptables -t nat -F
iptables -t nat -X
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t mangle -F
iptables -t mangle -X
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P INPUT ACCEPT
iptables -t mangle -P FORWARD ACCEPT
iptables -t mangle -P OUTPUT ACCEPT
iptables -t mangle -P POSTROUTING ACCEPT
iptables -F
iptables -X
iptables -P FORWARD ACCEPT
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t raw -F
iptables -t raw -X
iptables -t raw -P PREROUTING ACCEPT
iptables -t raw -P OUTPUT ACCEPT
service iptables save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment