I disable NetworkManager & SELINUX. Because it will make difficult for
configuration.
HOSTS (hosts = /etc)
127.0.0.1 localhost.localdomain localhost amk
192.168.10.10 amk.localdomain.com amk
RESOLV.CONF (resolv.conf = /etc)
nameserver 203.81.71.69
nameserver 203.81.71.73
DHCP.CONF (dhcpd.conf = /etc)
ddns-update-style none;
allow bootp;
authoritative;
option wpad code 252=text; #For WPAD
subnet 192.168.10.0 netmask 255.255.255.0
{
range 192.168.10.20 192.168.10.30;
option subnet-mask 255.255.255.0;
option domain-name "localdomain.com";
option routers 192.168.10.10;
option domain-name-servers 192.168.10.10;
default-lease-time 3600;
max-lease-time 7200;
option wpad "http://192.168.10.10/wpad.dat"; #For WPAD
}
NAMED.CONF (named.conf = /etc)
options {
directory "/etc";
pid-file "/var/run/named/named.pid";
forwarders {
203.81.71.69;
203.81.71.73;
};
};
zone "localdomain.com" {
type master;
file "/var/named/localdomain.com.hosts";
};
zone "10.168.192.in-addr.arpa" {
type master;
file "/var/named/192.168.10.rev";
};
LOCALDOMAIN.COM.HOSTS (localdomain.com.hosts = /var/named)
$ttl 38400
localdomain.com. IN SOA amk.localdomain.com. amk.localdomain.com. (
1246337929
10800
3600
604800
38400 )
localdomain.com. IN NS amk.localdomain.com.
amk.localdomain.com. IN A 192.168.10.10
wpad IN A 192.168.10.10
IN TXT "service: wpad:!http://wpad.localdomain.com:80/wpad.dat"
wpad.tcp IN SRV 0 0 80 wpad.localdomain.com.
192.168.10.REV (192.168.10.rev = /var/named)
$ttl 38400
10.168.192.in-addr.arpa. IN SOA amk.localdomain.com. amk.localdomain.com. (
1246338296
10800
3600
604800
38400 )
10.168.192.in-addr.arpa. IN NS amk.localdomain.com.
10.10.168.192.in-addr.arpa. IN PTR amk.localdomain.com.
WPAD.DAT (wpad.dat = /var/www/html)
function FindProxyForURL(url, host)
{
if (
(isPlainHostName(host)) ||
(dnsDomainIs(host, ".localdomain")) ||
(isInNet(host, "10.0.0.0", "255.0.0.0")) ||
(isInNet(host, "172.16.0.0", "255.240.0.0")) ||
(isInNet(host, "169.254.0.0", "255.255.0.0"))
)
return "DIRECT";
else
if (
(isInNet(myIpAddress(), "192.168.10.0", "255.255.255.0"))
)
return "PROXY 192.168.10.10:8080";
}
HTTPD.CONF (httpd.conf = /etc/httpd/conf)
ServerName wpad.localdomain.com
ServerAlias 192.168.10.10
AddType application/x-ns-proxy-autoconfig .dat
SQUID.CONF (squid.conf = /etc/squid)
# WELCOME TO SQUID 3.0.STABLE2
# ----------------------------
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8
acl localnet src 192.168.10.0/24 # RFC1918 possible internal network
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
http_access allow localnet
# And finally deny all other access to this proxy
http_access allow localnet
http_access deny all
icp_access allow localnet
icp_access deny all
htcp_access allow localnet
htcp_access deny all
http_port 8080
hierarchy_stoplist cgi-bin ?
#cache_mem 512 MB
cache_dir ufs /var/spool/squid 100 16 256
minimum_object_size 0 KB
maximum_object_size 4096 KB
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern (cgi-bin|\?) 0 0% 0
refresh_pattern . 0 20% 4320
visible_hostname amk.localdomain.com
icp_port 3130
#Default:
# nonhierarchical_direct on
#always_direct deny all
#never_direct allow all
cachemgr_passwd 123456
coredump_dir /var/spool/squid
cache_mgr aungmyoko@gmail.com
IPTABLES
#Clear iptables default rules
iptables –F
#Declare for INPUT,OUTPUT,FORWARD Chains
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
#Allow Local Network to Accept Firewall (eth1= Local / eth0 = External)
iptables -A INPUT -j ACCEPT -p all -s 192.168.10.0/24 -i eth1
iptables -A OUTPUT -j ACCEPT -p all -s 192.168.10.0/24 -o eth0
#Enable NAT Command
iptables -A POSTROUTING -t nat -o eth0 -s 192.168.10.0/24 -d 0/0 -j MASQUERADE
( Note: Check ipv4.forward=1 in /etc/sysctl.conf before typing iptables NAT enable command.
Because, Ipv4.forward = 1 and iptables MASQUERADE are working together for Enable NAT.)
#iptables save
Service iptables save
#Check iptables rules
Service iptables status (or) iptables -L
Checking Squid Logs File
# tail –f /var/log/squid/access.log (# squid logs file show that clients are using squid or not.)
No comments:
Post a Comment