Saya telah menemukan script yang berguna pada halaman dnsmasq. Deskripsi di bawah ini.
Kode:
#!/bin/sh
# Contributed by Darren Hoo
# If you use dnsmasq as DHCP server on a router, you may have
# met with attackers trying ARP Poison Routing (APR) on your
# local area network. This script will setup a 'permanent' entry
# in the router's ARP table upon each DHCP transaction so as to
# make the attacker's efforts less successful.
# Usage:
# edit /etc/dnsmasq.conf and specify the path of this script
# to dhcp-script, for example:
# dhcp-script=/usr/sbin/static-arp
# if $1 is add or old, update the static arp table entry.
# if $1 is del, then delete the entry from the table
# if $1 is init which is called by dnsmasq at startup, it's ignored
ARP=/usr/sbin/arp
# Arguments.
# $1 is action (add, del, old)
# $2 is MAC
# $3 is address
# $4 is hostname (optional, may be unset)
if [ ${1} = del ] ; then
${ARP} -d $3
fi
if [ ${1} = old ] || [ ${1} = add ] ; then
${ARP} -s $3 $2
fi
Dalam jaringan saya script ini bekerja seperti pesona
PERTANYAANNYA?
Piotr hi,,
Di mana saya harus menempatkan script ini sehingga masih bisa dieksekusi saat saya reboot server saya?
Hi Andi!
Seperti yang dapat Anda lihat di atas, Anda harus menentukan path dari script ini untuk dhcp-script direktif pada / etc / dnsmasq.conf yaitu:
dhcp-script = / usr / sbin / arp statis-
Script ini selalu dijalankan ketika klien ingin alamat IP dari server DHCP.
Untuk perlindungan yang lebih baik menambahkan baris file ini ke / etc / rc.d / rc.local
Kode:
arp -s
yaitu
Kode:
arp -s 192.168.1.1 00:1c:2b:3a:4f:as -i eth1
Ini akan menambahkan entri statis ARP untuk tabel ARP lokal.
Jika klien Anda menggunakan script logon, Anda dapat menambahkan baris yang mirip dengan script, sehingga mereka akan dilindungi terhadap alamat gateway palsu. Pada jendela baris ini akan terlihat seperti ini:
Kode:
arp -s 192.168.1.1 00-1c-2b-3a-4f-as
Kode:
[root@system ~]# service dnsmasq restart
Starting dnsmasq:
dnsmasq: bad option at line 32 of /etc/dnsmasq.conf
[FAILED]
baris 32
ARP = / usr / sbin / arp
apa yang harus saya lakukan???
dwi chandra
SMP Boarder
Posts: 25
ARP=/usr/sbin/arp
adalah bagian dari / usr / sbin / arp statis-naskah, bukan / etc / dnsmasq.conf.
Salin seluruh kode dari posting pertama saya, dan simpan sebagai statis-arp di / usr / sbin /
Selanjutnya, tambahkan baris ini ke / etc / dnsmasq.conf
Kode:
dhcp-script=/usr/sbin/static-arp
Dan restart dnsmasq.
TIPS TAMBAHAN ARPWATCH
Instal Arpwatch. Hal ini lebih baik dari IpwatchD.
Untuk menginstal arpwatch, ketik saja sebagai root:
Kode:
yum install arpwatch
File konfigurasi utama adalah / etc / sysconfig / arpwatch (mudah untuk setup)
Untuk memulai layanan, jalankan perintah:
Kode:
service arpwatch start
Untuk memulai arpwatch saat boot, ketik:
Kode:
chkconfig --level 35 arpwatch on
Tidak ada komentar:
Posting Komentar