Proxy Server Install and Configure
4.1 Create Router
Step 1:
# vim /etc/sysctl.conf
net.ipv4.ip_forward = 1
Step 2:
run this command
# sysctl -p
4.2 Squid Configuration
#apt-get install squid
Minimum Configuration:
# vim /etc/squid/squid.conf
edit #http_port 8080 [default port 3128 ]
# http_port 8080 transparent [transparent help to force using proxy without putting proxy IP on browser]
#cache_mem 8 MB
#cache_dir ufs /var/spool/squid 100 16 256 [or squid3]
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
add acl our_network src 192.168.200.0/24
Squid |
Squid3 |
Log : /var/log/squid/access.log Cache location : /var/spool/squid/
|
Log : /var/log/squid3/access.log Cache location : /var/spool/squid3/
|
In the part “# Recommended minimum configuration:”
http_access allow localhost
add http_access allow our_network
http_access deny all
save & exit (Esc :wq!)
# /etc/init.d/squid restart
4.3 Firewall
#vim /etc/init.d/iptables
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
#### NAT Table
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A PREROUTING -p TCP -s 192.168.49.0/24 --dport 80 -j REDIRECT --to-port 8080
#### FORWARD chain
iptables -A FORWARD -s 192.168.49.0/24 -p udp --dport 53 -j ACCEPT
save & exit (Esc :wq!)
# /etc/init.d/iptables
Comments
Post a Comment