FreeBSD Metin2 Firewall KURULUMU | Anlatım Görkem

24 Kasım 2012 Cumartesi yazildi.

Merhaba putty Baglantınızı Kurunuz 

Komut Satırına :

Kod:
sysinstall
Yazip  enterliyoruz.
Ardından çıkan ekranda

Kod:
Configure
Gelip  Enterliyoruz
Kod:
Distributions
E gelip enterliyoruz ve
src
gelip enterliyoruz daha sonra
Kod:
sys
Enterliyoruz

Ardından yukarı çıkıp exit diyoruz enterliyoruz.
Sonra tekrar exit diyoruz.
Gelen ekranda  2.sırada FTP Seçiyoruz sonra gelen ekranda 2.sırada URL Enterliyoruz
Hepsini "Backspace" Tusu ile siliyoruz aşağidaki kodu yapiştirip enterliyoruz

Kod:
ftp://ftp-archive.freebsd.org/pub/Fr...86/7.2-RELEASE

Yükleme bittikten sonra tab tusu ile cancel gelip enterleyip cıkıyoruz.
Kod:
cd /boot/defaults && ee loader.conf

Bu Kodu yazıyoruz Bayaği bi aşağida ipfw_ 'leri göreceksiniz.
Kod:
ipfw_load"NO"                 #Firewall

Yazacaktir bunu buldugunuzda  NO Yazısını YES Yapip ESC Tusuna daha sonra 2 defa entere basıyoruz.

Kod:
cd /usr/src/sys/i386/confcp 

PAE Memento

ee Memento
Sırası ile alt alta bu komutları yazıyoruz.

Karsımıza bir sayfa gelecek yine

options PAE satırını bulun arasında bir bosluk bırakıp
Kod:
options                    IPFIREWALL # required for IPFW
options                    IPFIREWALL_VERBOSE # optional; logging
options                    IPFIREWALL_VERBOSE_LIMIT=10 # optional; don't get too many log entries
options                    IPDIVERT # needed for natd

Yukarıdaki kodlarımızı yazıyoruz.

Ekledikten daha sonra su komutu giriyoruz
Kod:
config Memento
Daha sonra
Kod:
cd ../compile/Memento
Ve sonrası
Kod:
make
Bu komuttan sonra uzun bir işlem yapacaktir putty  i kapatmayınız çay kahve vs

# yani komut satırı geldikten sonra

Kod:
make install
Komutunu uyguluyorsunuz

Kod:
cd /usr/src/sys/i386/conf
Kod:
cp /boot/kernel.old/geom_* /boot/kernel
Kod:
ee /etc/rc.conf
mysql_enable"YES" Satırının hemen altına

Kod:
firewall_enable="YES"firewall_script="/etc/fw"
firewall_type="OPEN"

Yazip ESC  ve 2DEFA Enter yapiyoruz.

Şimdi Kural  dosyamızı tanımlayacağiz.

Kod:
ee /etc/ipfw
Ve bunları copy paste yapiyoruz

Kod:
IPF="ipfw -q add"ipfw -q -f flush


#loopback
#$IPF 1 deny tcp from any to me 11005 via em0 tcpflags syn,!fin
$IPF 10 allow all from any to any via lo0
$IPF 20 deny all from any to 127.0.0.0/8
$IPF 30 deny all from 127.0.0.0/8 to any
$IPF 40 deny tcp from any to any frag
$IPF 42 deny all from any to me 12001
$IPF 42 deny all from any to me 14001
$IPF 42 deny all from any to me 14002
$IPF 42 deny all from any to me 14003
$IPF 42 deny all from any to me 14004
$IPF 42 deny all from any to me 14061
$IPF 42 deny all from any to me 17001
$IPF 42 deny all from any to me 17002
$IPF 42 deny all from any to me 17003
$IPF 42 deny all from any to me 17004
$IPF 42 deny all from any to me 17061
$IPF 42 deny all from any to me 14000
$IPF 42 deny all from any to me 17000
$IPF 42 deny all from any to me 14099
# statefull
$IPF 50 check-state
$IPF 60 allow tcp from any to any established
$IPF 70 allow all from any to any out keep-state
$IPF 80 deny icmp from any to any
$IPF 81 allow tcp from any to any 1024-65000 keep-state
$IPF 120 allow tcp from any to any 22 out
$IPF 130 allow tcp from any to any 22 in
$IPF 150 allow tcp from any to any 3306 in
$IPF 170 deny udp from any to any 53 in
$IPF 175 deny tcp from any to any 53 in
$IPF 180 deny udp from any to any 53 out
$IPF 185 deny tcp from any to any 53 out
$IPF 198 deny tcp from any to any 25 in
#ch1 ports
$IPF 200 allow tcp from any to any 11002 in
$IPF 210 allow tcp from any to any 11002 out
$IPF 200 allow udp from any to any 11002 in
$IPF 210 allow udp from any to any 11002 out
$IPF 200 allow tcp from any to any 13000 in
$IPF 210 allow tcp from any to any 13000 out
$IPF 201 allow udp from any to any 13000 in
$IPF 211 allow udp from any to any 13000 out
$IPF 200 allow tcp from any to any 13001 in
$IPF 210 allow tcp from any to any 13001 out
$IPF 200 allow tcp from any to any 13002 in
$IPF 210 allow tcp from any to any 13002 out
$IPF 200 allow tcp from any to any 13003 in
$IPF 210 allow tcp from any to any 13003 out
$IPF 200 allow tcp from any to any 13004 in
$IPF 210 allow tcp from any to any 13004 out
$IPF 200 allow tcp from any to any 13061 in
$IPF 210 allow tcp from any to any 13061 out
$IPF 200 allow tcp from any to any 13099 in
$IPF 210 allow tcp from any to any 13099 out
#ch2 ports
$IPF 200 allow tcp from any to any 16000 in
$IPF 210 allow tcp from any to any 16000 out
$IPF 201 allow udp from any to any 16000 in
$IPF 211 allow udp from any to any 16000 out
$IPF 200 allow tcp from any to any 16001 in
$IPF 210 allow tcp from any to any 16001 out
$IPF 200 allow tcp from any to any 16002 in
$IPF 210 allow tcp from any to any 16002 out
$IPF 200 allow tcp from any to any 16003 in
$IPF 210 allow tcp from any to any 16003 out
$IPF 200 allow tcp from any to any 16004 in
$IPF 210 allow tcp from any to any 16004 out
$IPF 200 allow tcp from any to any 16061 in
$IPF 210 allow tcp from any to any 16061 out
ESC Tusuna basıyoruz  2 Defa enter ve reboot atıyoruz.

Firewall  korumanız aktif olmus oluyor.

Kod:
/etc/rc.d/ipfw restart
Komutu  ile firewall a restart atabilir.
Kod:
/etc/rc.d/ipfw stop
Komutu ile firewall servisinizi durdurabilirsiniz.

İp Ban atma komutunuz :

Kod:
/sbin/ipfw -q add banlanacakipadresi
Eski  üyeliğimde bir zamanlar paylasımda bulunmustum hangi forumdu hatırlamıyorum  biraz daha derledim düzenledim tekrar paylasmak istediğinde bulundum.

Biraz Karışık Ama Ne Yapalım Bizde Bildiğimizi Anlatıyoruz 

Bir Teşekkürü Çok Görmeyin

0 yorum: