FEDORA DHCP Server

Merhabalar,

FEDORA ile sunucu serisine devam, alttaki görselde DHCP sunucunun nasıl kurulacağı standart ve normal ayarlarının nasıl yapılacağına ilişkin bilgi bulabilirsiniz. Umarım yerelde kuracağınız gelişmiş DHCP sunucular için yol gösterici bir doküman olmuştur.

Video içeriğindeki Adımlar

1. Basic DHCP
1.a Tekbir arayüz üzerinden DHCP dağıtımı
1.b İki farklı arayüz üzerinden birden fazla IP bloğu dağıtmak
1.c VLAN üzerinden IP dağıtımı
2. Multi Range
3. Statik Host kaydı
4. Adres Aralığı Ayırma
5. DNS Sunucu entegrasyonu

DHCP Server

sudo su
yum install dhcp
yum install bind
systemctl enable dhcpd.service
systemctl start dhcpd.service
systemctl enable named
systemctl start named
sudo nano /etc/selinux/config
sudo setsebool -P named_write_master_zones 1

1. Basic DHCP

#———————————————————————–/etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
authoritative;
ddns-update-style interim;
update-static-leases on;

subnet 10.0.7.0 netmask 255.255.255.0 {
option routers            10.0.7.1;
option subnet-mask            255.255.255.0;
option domain-search        “example.local”;
option domain-name-servers    8.8.8.8,8.8.4.4;
option time-offset            -18000;
range 10.0.7.100 10.0.7.110;
}
#———————————————————————–/etc/dhcp/dhcpd.conf

2. Multi Range
#———————————————————————–/etc/dhcp/dhcpd.conf

subnet 10.0.7.0 netmask 255.255.255.0 {
option routers            10.0.7.1;
option subnet-mask            255.255.255.0;
option domain-search        “example.local”;
option domain-name-servers    8.8.8.8,8.8.4.4;
option time-offset            -18000;
range 10.0.7.100 10.0.7.110;
range 10.0.7.200 10.0.7.210;
}

#———————————————————————–/etc/dhcp/dhcpd.conf

3. Statik Host kaydı

#———————————————————————–/etc/dhcp/dhcpd.conf
host client1 {
hardware ethernet 08:00:27:6e:f9:d5;
fixed-address 10.0.7.46;
}
#———————————————————————–/etc/dhcp/dhcpd.conf
4. Adres Aralığı Ayırma
#———————————————————————–/etc/dhcp/dhcpd.conf

subnet 10.0.7.0 netmask 255.255.255.0 {
option routers            10.0.7.1;
option subnet-mask            255.255.255.0;
option domain-search        “example.local”;
option domain-name-servers    8.8.8.8,8.8.4.4;
option time-offset            -18000;
#range 10.0.7.100 10.0.7.110;

# Kayıtlı makinalar
pool {
range 10.0.7.100 10.0.7.105;
deny unknown clients;
}

# Kayıtsız makinalar
pool {
range 10.0.7.106 10.0.7.110;
allow unknown clients;
ddns-hostname = concat(binary-to-ascii(10, 8, “-“, leased-address),”.guest”);
ddns-domainname = “example.local”;
}

}

host client1 {
hardware ethernet 08:00:27:6e:f9:d5;
option domain-name “example.local”;
ddns-hostname “windows7-1”;
}

host client2 {
hardware ethernet 08:00:27:e3:ca:02;
option domain-name “example.local”;
ddns-hostname “windows7-2”;
}

#———————————————————————–/etc/dhcp/dhcpd.conf

5. DNS Sunucu

bind9 : dnssec-keygen -a HMAC-MD5 -b 128 -n USER DHCP_UPDATER
bind8 : dnskeygen -H 128 -u -c -n DHCP_UPDATER

sudo mkdir -pv /var/named/zone/ext
sudo mkdir -pv /var/named/zone/int
sudo mkdir -pv /var/named/zone/dhcp
sudo chown -R named:named /var/named/zone/

#———————————————————————–/etc/dhcp/dhcpd.conf – /etc/named.conf

#————————————————-/etc/dhcp/dhcpd.conf

key DHCP_UPDATER {
algorithm hmac-md5;
secret pRP5FapFoJ95JEL06sv4PQ==;
};

zone example.local. {
primary 127.0.0.1;
key DHCP_UPDATER;
}

zone 7.0.10.in-addr.arpa. {
primary 127.0.0.1;
key DHCP_UPDATER;
}

#————————————————-/etc/dhcp/dhcpd.conf

#————————————————-/etc/named.conf

key DHCP_UPDATER {
algorithm hmac-md5;
secret pRP5FapFoJ95JEL06sv4PQ==;
};

zone “example.local” {
type master;
file “zone/dhcp/example.local.db”;
allow-update { key DHCP_UPDATER; };
};

zone “zone/dhcp/7.0.10.in-addr.arpa” {
type master;
file “7.0.10.db”;
allow-update { key DHCP_UPDATER; };
};
#————————————————-/etc/named.conf

#——————————————–zone/dhcp/example.local.db

@ IN SOA ns0.example.local. root.example.local. (
2008063005 ;serial
7h ;refresh
3h ;retry
1w ;expiry
86400 ;minimum TTL
)

@ IN NS ns0.example.local.

ns0    IN    A    10.0.7.2
gw    IN    A    10.0.7.1
#——————————————–zone/dhcp/example.local.db
#——————————————–zone/dhcp/example.local.db
$TTL 1d

@ IN SOA ns0.example.local. root.example.local. (
2008063005 ;serial
7h ;refresh
3h ;retry
1w ;expiry
86400 ;minimum TTL
)

@ IN NS ns0.example.local.

2    IN    PTR    ns0.example.local.
1    IN    PTR    gw.example.local.
#——————————————–zone/dhcp/example.local.db

sudo chown -R named:named /var/named/zone/

#———————————————————————–/etc/dhcp/dhcpd.conf – /etc/named.conf

Loading Facebook Comments ...

Yorum Yap


Not - Bunları KullanabilirsinizHTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre>