Firewall ayarlarını webmin kullanarak resetledim. Makina yeniden
başlarken "couldnt read interfaces" gibi bir hata aldım ve interfaces
dosyasına "post-up iptables-restore < /etc/iptables.up.rules" satırının
eklenmiş olduğunu gördüm, bu satırı silip networkü yeniden başlattığımda
sorun düzeldi yani artık her iki ağdan da apache2 ye ulaşabiliyorum
fakat firewall resetlendiği için iç ağdaki makinalar internete
çıkamıyor. Daha önce kullandığım firewall betiği aşağıda. Ayrıca
"post-up iptables-restore < /etc/iptables.up.rules" satırı nereden çıktı
anlamadım.
redirect.sh:
#!/bin/sh
# squid server IP
SQUID_SERVER='10.0.0.1'
# Interface connected to Internet
INTERNET='eth0'
# Interface connected to LAN
LAN_IN='eth1'
# Squid port
SQUID_PORT='3128'
# DO NOT MODIFY BELOW
# Clean old firewall
#iptables -F
#iptables -X
#iptables -t nat -F
#iptables -t nat -X
#iptables -t mangle -F
#iptables -t mangle -X
# Load IPTABLES modules for NAT and IP conntrack support
modprobe ip_conntrack
modprobe ip_conntrack_ftp
# For win xp ftp client
modprobe ip_nat_ftp
echo 1 > /proc/sys/net/ipv4/ip_forward
# Setting default filter policy
#iptables -P INPUT DROP
#iptables -P OUTPUT ACCEPT
# Unlimited access to loop back
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
# Allow UDP, DNS and Passive FTP
iptables -A INPUT -i $INTERNET -m state --state ESTABLISHED,RELATED -j
ACCEPT
# set this system as a router for Rest of LAN
iptables --table nat --append POSTROUTING --out-interface $INTERNET -j
MASQUERADE
iptables --append FORWARD --in-interface $LAN_IN -j ACCEPT
# unlimited access to LAN
iptables -A INPUT -i $LAN_IN -j ACCEPT
iptables -A OUTPUT -o $LAN_IN -j ACCEPT
# DNAT port 80 request comming from LAN systems to squid 8080
($SQUID_PORT) aka transparent proxy
iptables -t nat -A PREROUTING -i $LAN_IN -p tcp --dport 80 -j DNAT --to
$SQUID_SERVER:$SQUID_PORT
# if it is same system
iptables -t nat -A PREROUTING -i $INTERNET -p tcp --dport 80 -j REDIRECT
--to-port $SQUID_PORT
# DROP everything and Log it
#iptables -A INPUT -j LOG
#iptables -A INPUT -j DROP
turgut kalfaoglu yazmış:
Hmm 192.168.x farklı bir ethernet kartına gidiyor, herhalde bu doğru
değil mi?
Acaba apache conf daki "Listen" sadece 10.x lu IP yi mi dinliyor?
Yada VirtualHost tanımlarında 10.x li tanımlar mı var?
İsterseniz apache conf u bir gozden geçirin, ve/veya virtualhost
tanımları ayrı dosyadaysa onlara da bakın..
-turgut
Abdullah Tülek wrote:
netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window
irtt Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0
0 0 eth0
10.0.0.0 0.0.0.0 255.0.0.0 U 0
0 0 eth1
0.0.0.0 192.168.2.1 0.0.0.0 UG 0
0 0 eth0
iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT 0 -- 0.0.0.0/0 0.0.0.0/0
ACCEPT 0 -- 0.0.0.0/0 0.0.0.0/0 state
RELATED,ESTABLISHED
ACCEPT 0 -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT 0 -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT 0 -- 0.0.0.0/0 0.0.0.0/0
ACCEPT 0 -- 0.0.0.0/0 0.0.0.0/0
turgut kalfaoglu yazmış:
netstat -rn ve iptables -L -n komutlarının çıktılarını gönderir misiniz?
-turgut
Abdullah Tülek wrote:
İki LAN arasına deneme amacıyla kurduğum sunucunda eth0 : 192.168.2.0,
eth1 : 10.0.0.0 ağına bakıyor. 10.0.0.0 ağındaki makinalar apache web
sunucusuna erişebilirken 192.168.2.0 ağındaki makinalar erişemiyor.
Makinadaki diğer sunuculara (ftp, ssh) iki ağdan da ulaşabiliyorum.
Apache ile ilgili sorunun sebebi ne olabilir? (Ayrıca makinada Squid de
kurulu)
_______________________________________________
Linux-sunucu E-Posta Listesi
[email protected]
Bu Listede neden bulunduğunuzu bilmiyorsanız veya artık bu listeden gelen
e-postaları almak istemiyorsanız aşağıdaki bağlantı adresini kullanarak 1
dakika içinde üyeliğinizi sonlandırabilirsiniz.
http://liste.linux.org.tr/mailman/listinfo/linux-sunucu
------------------------------------------------------------------------
_______________________________________________
Linux-sunucu E-Posta Listesi
[email protected]
Bu Listede neden bulunduğunuzu bilmiyorsanız veya artık bu listeden gelen
e-postaları almak istemiyorsanız aşağıdaki bağlantı adresini kullanarak 1
dakika içinde üyeliğinizi sonlandırabilirsiniz.
http://liste.linux.org.tr/mailman/listinfo/linux-sunucu
------------------------------------------------------------------------
_______________________________________________
Linux-sunucu E-Posta Listesi
[email protected]
Bu Listede neden bulunduğunuzu bilmiyorsanız veya artık bu listeden gelen
e-postaları almak istemiyorsanız aşağıdaki bağlantı adresini kullanarak 1
dakika içinde üyeliğinizi sonlandırabilirsiniz.
http://liste.linux.org.tr/mailman/listinfo/linux-sunucu
_______________________________________________
Linux-sunucu E-Posta Listesi
[email protected]
Bu Listede neden bulunduğunuzu bilmiyorsanız veya artık bu listeden gelen
e-postaları almak istemiyorsanız aşağıdaki bağlantı adresini kullanarak 1
dakika içinde üyeliğinizi sonlandırabilirsiniz.
http://liste.linux.org.tr/mailman/listinfo/linux-sunucu