Strona 1 z 1

Konfiguracja serwera

: 18 marca 2009, 21:15
autor: zebro
Witam.

Jakiś czas temu (z 4 lata) został uruchomiony u mnie serwer oparty o Debiana (maskarada, DHCP, squid, shaperd). Niestety zaczyna się wykrzaczac dość poważnie i nie mogę sobie z nim poradzić, więc postanowiłem przeinstalować system na nowo. Nie wiem natomiast czy poprawnie mam skonfigurowanego firewalla, podział łącza itp. (nie ja to konfigurowałem). Poniżej zamieszczam zawartości plików.

Mógłby ktoś sprawdzić ich poprawność? Nie znam się niestety na tym, a nie chcę popełnić błędów.

firewall:

Kod: Zaznacz cały

iptables -F INPUT
iptables -P INPUT DROP
iptables -A INPUT -i ! eth0 -j ACCEPT
iptables -A INPUT -p tcp --dport domain -j ACCEPT
iptables -A INPUT -p udp --dport domain -j ACCEPT
iptables -A INPUT -p tcp --dport ssh -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
tablica forward - urywek:

Kod: Zaznacz cały

iptables -F FORWARD 
iptables -P FORWARD DROP
iptables -I FORWARD 1 -d 192.168.34.0/24 -j ACCEPT
iptables -A FORWARD -m mac --mac-source 00:40:05:01:21 :D F -s 192.168.34.101 -j ACCEPT
iptables -A FORWARD -m mac --mac-source 00:04:AC:58:2E:6C -s 192.168.34.102 -j ACCEPT
iptables -A FORWARD -m mac --mac-source 00:1D:7D :D D:47:65 -s 192.168.34.103 -j ACCEPT
iptables -A FORWARD -m mac --mac-source 00:1A:4D:7C:69:12 -s 192.168.34.104 -j ACCEPT
stałe IP oraz maskarada:

Kod: Zaznacz cały

ifconfig eth0:1 80.yy.xxx.75
ifconfig eth0:2 80.yy.xxx.76
ifconfig eth0:3 80.yy.xxx.77
ifconfig eth0:4 80.yy.xxx.78

iptables -t nat -F
iptables -t nat -A PREROUTING -d 80.yy.xxx.75 -j DNAT --to 192.168.34.105 
iptables -t nat -A PREROUTING -d 80.yy.xxx.76 -j DNAT --to 192.168.34.103
iptables -t nat -A PREROUTING -d 80.yy.xxx.77 -j DNAT --to 192.168.34.131

iptables -t nat -I POSTROUTING 1 -s 192.168.34.105 -j SNAT --to 80.yy.xxx.75
iptables -t nat -I POSTROUTING 1 -s 192.168.34.103 -j SNAT --to 80.yy.xxx.76
iptables -t nat -I POSTROUTING 1 -s 192.168.34.131 -j SNAT --to 80.yy.xxx.77
iptables -t nat -A POSTROUTING -s 192.168.34.0/24 -j MASQUERADE -o eth0
dhcp:

Kod: Zaznacz cały

subnet 192.168.34.0 netmask 255.255.255.0
#ddns-update-style ad-hoc;
{
option domain-name-servers 192.168.34.100, 194.204.159.1;
option routers 192.168.34.100;
option netbios-name-servers 192.168.34.100;
ddns-update-style ad-hoc;
host ktos  { hardware ethernet 00:40:05:01:21 :D F; fixed-address 192.168.34.101; }
..
dalsza cześć listy
..
}
ddns-update-style ad-hoc;
squid:

Kod: Zaznacz cały

cache_effective_user squid
cache_effective_group squid
visible_hostname 80.yy.xxx.74

acl all src "/root/start/squid_access"

acl szymek src 192.168.34.105
tcp_outgoing_address 80.yy.xxx.75 szymek

acl krzysiek src 192.168.34.103
tcp_outgoing_address 80.yy.xxx.76 krzysiek


http_port 8080
cache_mem 150 MB
cache_dir ufs /home/squid/cache 3000 16 256 

cache_access_log /home/squid/access.log
cache_store_log none
cache_log /home/squid/squid-log
pid_filename /home/squid/squid.pid
maximum_object_size 4096 KB
cache_swap_low 90
cache_swap_high 95


http_access allow all  

ftp_passive on

#httpd_accel_host virtual
#httpd_accel_port 80
#httpd_accel_with_proxy on
#httpd_accel_uses_host_header on
ident_lookup_access allow all