Metin2 FreeBSD FireWall Kurulumu

Öncelikle Konu 1Forumdan Alıntıdır.

Merhaba Arkadaşlar Size İlk Önce FireWall'ı Anlatacağım...

Eğer belli bir süredir internet kullanıyorsanız ya da birçok bilgisayarlardan oluşan bir ağ ortamında çalışıyorsanız ve interneti de kullanmanız gerekiyorsa muhtemelen firewall (okunuşu fayırvol) kelimesini duymuşsunuzdur. 
Temel olarak firewall ağ sistemlerini internet ortamından gelecek kötü kodlar virüsler hackerlar ve zararlı web siteleri gibi birçok olumsuz içerikten korumak için tasarlanmış donanımlardır. 



Şekilden daha iyi anlaşılacağı gibi kırmızı veriler zararlı olup ateşi ifade ediyorlar. Ortadaki ateş duvarıda zararlı içeriği tanımlayıp ateşin içerideki sisteme sıçramasını engelliyor. İşte bu yüzden bu donanımlara ateşduvarı anlamına gelen firewall deniyor. Firewall lar yazılım ya da donanım şeklinde olabilirler. Yazılım firewallar genellikle ev kullanıcıları içindir. Donanım firewall lar ise genellikle ağ sistemlerini korumak için kullanılırlar.

Firewall lar hangi verinin ateş hangi verinin zararsız olduğunu anlamak için gelişmiş yazılımlar kullanırlar ve bu yazılımların sürekli güncel tutulması gerekir. 

Firewall lar nasıl çalışır? 

Firewall lar yukardaki resimde gösterildiği gibi veri paketlerinin geçişine izin verir ya da reddeder. Buna paket filtrelemesi denir. Firewall lar ağ trafiğini denetlemek için birkaç method kullanırlar. Paket filtrelemesi de bunlardan biridir.

Firewall konfigürasyonu

Firewall lar ön tanımlı bir konfigürasyonla gelirler. Belli başlı filtreleme kuralları mevcuttur. Ancak yönetici bu kuralları değiştirebilir ekleme ve çıkarma yapabilir. Kurallar pek çok yöntemle belirlenebilir. Bunlar:
Ip adresleri
Alan adları (domain names)
Protokoller
IP TCP HTTP FTP UDP ICMP SMTPSNMP TELNET
Portlar
Belli başlı kelimelere göre
Neden Firewall güvenliğine ihtiyacımız var?
Bilgisayarlar kullanıcıları sadece virüs tehdidi altında değildirler. Aynı zamanda bilgisayarınızdaki kişisel verilerinizde bir güvenlik riski oluşturur. İşte firewall larla korunabileceğimiz diğer tehditler:
remote login - uzaktan erişim
Aplication backdoors - arkakapı uygulamaları
Dos (denial of service) attacks - Servis reddi atakları
Smtp Session Hijacking - Eposta protokolü oturum çalınması
Operating system bugs - İşletim sistemi hataları
Email bombs - Eposta bombaları
Macros - Makrolar
Virusus - Bilgisayar virüsleri
Spam - Zararlı epostalar
Source rating - Kaynak saptırma
Redirect bombs
Bu Kadarı Yeterli Şimdi Kuruluma Geçelim.

KURULUM

-Putty İle Serverımıza Bağlanalım.
Daha Sonrada Aşşagıdaki Komutları Komut Satırımıza Yazalım.

Kod:
cd /usr/ports/editors/nano
Kod:
make install
Kod:
cd  /usr/ports/sysutils/screen
Kod:
make install
Kod:
cd /usr/ports/sysutils/freecolor/
Kod:
make install clean
Kod:
echo /usr/local/bin/freecolor -mto" > /usr/local/bin/free
Kod:
chmod a+x  /usr/local/bin/free
Kod:
rehash
Bakın Hepsini Sırasına Göre Yazdıgınızdan Emin Olunuz.
Şimdi Mysql'a Entegre Ediyoruz.

Kod:
/usr/local/bin/mysql_install_db
Kod:
chown -R mysql /var/db/mysql/
Kod:
chgrp -R mysql /var/db/mysql/
Kod:
echo 'mysql_enable="YES"' >> /etc/rc.conf
Kod:
echo "[mysqld]" >> /var/db/mysql/my.cnf
Kod:
echo "set-variable=local-infile=0" >> /var/db/mysql/my.cnf
Kod:
echo "set-variable = max_connections=4096" >> /var/db/mysql/my.cnf
Kod:
echo "safe-show-database" >> /var/db/mysql/my.cnf
Kod:
echo "max_allowed_packet=16M" >> /var/db/mysql/my.cnf
Kod:
echo "net.inet.tcp.blackhole=2" >> /etc/sysctl.conf
Kod:
echo "net.inet.udp.blackhole=1" >> /etc/sysctl.conf
Kod:
echo "net.inet.icmp.icmplim=50" >> /etc/sysctl.conf

Şimdi FireWall'I Aktif Ediyoruz

Kod:
cd /usr/src/sys/i386/conf
Kod:
cp PAE DOST
Kod:
echo "options IPFIREWALL" >> /usr/src/sys/i386/conf/DOST
Kod:
echo "options IPFIREWALL_VERBOSE" >> /usr/src/sys/i386/conf/DOST
Kod:
echo "options IPFIREWALL_VERBOSE_LIMIT=15" >> /usr/src/sys/i386/conf/DOST
Kod:
cd /usr/src
Kod:
make kernel KERNCONF=DOST
Kod:
echo 'firewall_enable="YES"' >> /etc/rc.conf
Kod:
echo 'firewall_script="/etc/ipfw.rules"' >> /etc/rc.conf
Kod:
rm -rf /etc/ipfw.rules
Kod:
echo 'IPF="ipfw -q add"' >> /etc/ipfw.rules
Kod:
echo "ipfw -q -f flush
Kod:
#DOST IPFW AYARLAR
Kod:
\$IPF 4 allow all from $serverip to any 12001
\$IPF 5 allow all from 127.0.0.0/8 to any 12001
\$IPF 6 deny all from any to me 12001
\$IPF 7 allow all from $serverip to any 14000
\$IPF 8 allow all from 127.0.0.0/8 to any 14000
\$IPF 9 deny all from any to me 14000
\$IPF 10 allow all from $serverip to any 14001
\$IPF 11 allow all from 127.0.0.0/8 to any 14001
\$IPF 12 deny all from any to me 14001
\$IPF 13 allow all from $serverip to any 14002
\$IPF 14 allow all from 127.0.0.0/8 to any 14002
\$IPF 15 deny all from any to me 14002
\$IPF 16 allow all from $serverip to any 14003
\$IPF 17 allow all from 127.0.0.0/8 to any 14003
\$IPF 18 deny all from any to me 14003
\$IPF 19 allow all from $serverip to any 14004
\$IPF 20 allow all from 127.0.0.0/8 to any 14004
\$IPF 21 deny all from any to me 14004
\$IPF 22 allow all from $serverip to any 14061
\$IPF 23 allow all from 127.0.0.0/8 to any 14061
\$IPF 24 deny all from any to me 14061
\$IPF 25 allow all from $serverip to any 14099
\$IPF 26 allow all from 127.0.0.0/8 to any 14099
\$IPF 27 deny all from any to me 14099
\$IPF 28 allow all from $serverip to any 17000
\$IPF 29 allow all from 127.0.0.0/8 to any 17000
\$IPF 30 deny all from any to me 17000
\$IPF 31 allow all from $serverip to any 17001
\$IPF 32 allow all from 127.0.0.0/8 to any 17001
\$IPF 33 deny all from any to me 17001
\$IPF 34 allow all from $serverip to any 17002
\$IPF 35 allow all from 127.0.0.0/8 to any 17002
\$IPF 36 deny all from any to me 17002
\$IPF 37 allow all from $serverip to any 17003
\$IPF 38 allow all from 127.0.0.0/8 to any 17003
\$IPF 39 deny all from any to me 17003
\$IPF 40 allow all from $serverip to any 17004
\$IPF 41 allow all from 127.0.0.0/8 to any 17004
\$IPF 42 deny all from any to me 17004
\$IPF 43 allow all from $serverip to any 17061
\$IPF 44 allow all from 127.0.0.0/8 to any 17061
\$IPF 45 deny all from any to me 17061
\$IPF 46 allow all from $serverip to any 17099
\$IPF 47 allow all from 127.0.0.0/8 to any 17099
\$IPF 48 deny all from any to me 17099
\$IPF 49 allow all from $serverip to any 19000
\$IPF 50 allow all from 127.0.0.0/8 to any 19000
\$IPF 51 deny all from any to me 19000
\$IPF 52 allow all from $serverip to any 19001
\$IPF 53 allow all from 127.0.0.0/8 to any 19001
\$IPF 54 deny all from any to me 19001
\$IPF 55 allow all from $serverip to any 19002
\$IPF 56 allow all from 127.0.0.0/8 to any 19002
\$IPF 57 deny all from any to me 19002
\$IPF 58 allow all from $serverip to any 19003
\$IPF 59 allow all from 127.0.0.0/8 to any 19003
\$IPF 60 deny all from any to me 19003
\$IPF 61 allow all from $serverip to any 19004
\$IPF 62 allow all from 127.0.0.0/8 to any 19004
\$IPF 63 deny all from any to me 19004
\$IPF 64 allow all from $serverip to any 19061
\$IPF 65 allow all from 127.0.0.0/8 to any 19061
\$IPF 66 deny all from any to me 19061
\$IPF 67 allow all from $serverip to any 19099
\$IPF 68 allow all from 127.0.0.0/8 to any 19099
\$IPF 69 deny all from any to me 19099
\$IPF 70 allow all from $serverip to any 21000
\$IPF 71 allow all from 127.0.0.0/8 to any 21000
\$IPF 72 deny all from any to me 21000
\$IPF 73 allow all from $serverip to any 21001
\$IPF 74 allow all from 127.0.0.0/8 to any 21001
\$IPF 75 deny all from any to me 21001
\$IPF 76 allow all from $serverip to any 21002
\$IPF 77 allow all from 127.0.0.0/8 to any 21002
\$IPF 78 deny all from any to me 21002
\$IPF 79 allow all from $serverip to any 21003
\$IPF 80 allow all from 127.0.0.0/8 to any 21003
\$IPF 81 deny all from any to me 21003
\$IPF 82 allow all from $serverip to any 21004
\$IPF 83 allow all from 127.0.0.0/8 to any 21004
\$IPF 84 deny all from any to me 21004
\$IPF 85 allow all from $serverip to any 21061
\$IPF 86 allow all from 127.0.0.0/8 to any 21061
\$IPF 87 deny all from any to me 21061
\$IPF 88 allow all from $serverip to any 21099
\$IPF 89 allow all from 127.0.0.0/8 to any 21099
\$IPF 90 deny all from any to me 21099

#Standart Regeln

\$IPF 10000 allow all from any to any via lo0
\$IPF 20000 deny all from any to 127.0.0.0/8
\$IPF 30000 deny all from 127.0.0.0/8 to any
\$IPF 40000 allow all from any to any" >> /etc/ipfw.rules



Kurulumumuz Tamamlanmıştır 
Bu Paylaşım Sadece 1Forum İçin Yapılmıştır
Şimdiden Herkeze Kolay Gelsin Diyorum
İyi Forumlar Diliyorum. 
Risus

Yorumlar