Postawiałem u siebie w domku serwer odpalany tym skryptem /etc/init.d/firewall, oto jego zawartość:
Kod: Zaznacz cały
# wlaczenie w kernelu forwardowania
echo 1 > /proc/sys/net/ipv4/ip_forward
# czyszczenie starych regul
iptables -F
iptables -X
iptables -t nat -X
iptables -t nat -F
# ustawienie polityki dzialania
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# zezwolenie nna laczenie sie z naszym zewnetrznym ip po ssh
iptables -A INPUT -i lo -j ACCEPT
iptables -A FORWARD -o lo -j ACCEPT
iptables -A INPUT -s 0/0 -d 10.207.60.25 -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -s 0/0 -d 10.207.60.25 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -s 0/0 -d 10.207.60.25 -p udp --dport 22 -j ACCEPT
iptables -A OUTPUT -s 0/0 -d 10.207.60.25 -p udp --dport 22 -j ACCEPT
# polaczenia nawiazane
iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED
iptables -A FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED
iptables -A OUTPUT -j ACCEPT -m state --state ESTABLISHED,RELATED
# udostepniaie internetu w sieci lokalnej
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE
iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT
Później skonfigurowałem go tak(squid.conf):
Kod: Zaznacz cały
http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
no_cache deny QUERY
cache_dir diskd /var/spool/squid 100 16 256
cache_store_log none
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
half_closed_clients off
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
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
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny to_localhost
acl mynetwork src 192.168.1.0/255.255.255.0
http_access allow mynetwork
http_access allow localhost
http_reply_access allow all
icp_access allow all
visible_hostname [email]myfirewall@mydomain.com[/email]
append_domain .airnet.opole.pl
err_html_text [email]admin@mydomain.com[/email]
deny_info ERR_CUSTOM_ACCESS_DENIED all
memory_pools off
coredump_dir /var/spool/squid
ie_refresh on
Coś pewnie nie tak jest skonfigurowane, ale nie mogę tego znaleźć.
Proszę o pomoc w poprawieniu konfiguracji i z góry dzięki.