پروتکل DHCP در سرورهای سیسکو چیست و چگونه پیکربندی می شود؟ (قسمت هشتم)

29 خرداد 1400      0 دیدگاه

پروتکل DHCP چیست و چگونه پیکربندی می شود ؟ (مقاله هشتم)

DHCP Cover

  • پیکربندی یک مسیر ثابت با Next-Hop که به صورت پویا از طریق DHCP بدست آمده است.

 

 

Purpose Command or Action  

Enables privileged EXEC mode.

  • Enter your password if prompted.
enable


Example:
Device> enable
Step 1
Enters global configuration mode. configure terminal


Example:
Device# configure terminal
Step 2

Assigns a static route for the default next-hop device when the DHCP server is accessed for an IP address.

  • If more than one interface is configured to obtain an IP address from a DHCP server, use the ip route prefix mask interface-type interface-number dhcp command for each interface. If the interface is not specified, the route is added to the routing table as soon as any of the interfaces obtain an IP address and a default device.
ip route prefix mask {ip-address | interface-type interface-number [ip-address]} dhcp [distance]


Example:
Device(config)# ip route 192.168.1.1 255.255.255.255 192.168.2.2 dhcp
Step 3
Returns to privileged EXEC mode. end


Example:
Device(config)# end
Step 4
(Optional) Displays the current state of the routing table. show ip route


Example:
Device# show ip route
Step 5

 

  • پاک کردن متغیر های DHCP server

برای پاک کردن متغیر ها به ترتیب زیر عمل می نماییم:

  1. enable
  2. clear ip dhcp binding {address | *}
  3. clear ip dhcp conflict {address | *}
  4. clear ip dhcp server statistics

 

 

Purpose Command or Action  

Enables privileged EXEC mode.

  • Enter your password if prompted.
enable


Example:
Device> enable
Step 1

Deletes an automatic address binding from the DHCP database.

  • Specifying the address argument clears the automatic binding for a specific (client) IP address, whereas specifying an asterisk (*) clears all automatic bindings.
clear ip dhcp binding {address | *}


Example:
Device# clear ip dhcp binding *
Step 2

Clears an address conflict from the DHCP database.

  • Specifying the address argument clears the conflict for a specific IP address, whereas specifying an asterisk (*) clears conflicts for all addresses.
clear ip dhcp conflict {address | *}


Example:
Device# clear ip dhcp conflict 172.16.1.103
Step 3
Resets all DHCP server counters to 0. clear ip dhcp server statistics


Example:
Device# clear ip dhcp server statistics

Step 4

 

در زیر چند مثال از نحوه پیکربندی Cisco IOS DHCP Server   را مشاهده میکنید :

مثال زیر نحوه  ذخیره binding  بر روی host 172.16.4.253 را نشان می دهد. پروتکل انتقال  داده FTP  است. سرور قبل از انجام تغییرات پایگاه داده ، و زمان انتظار 2 دقیقه (120 ثانیه)

ip dhcp database ftp://user:password@172.16.4.253/router-dhcp write-delay 120

 

  • Excluding IP Addresses

در مثال زیر ، سرور A و سرور B به زیر شبکه 10.0.20.0/24 سرویس می دهند. اگر زیرشبکه به طور مساوی بین دو سرور تقسیم شود ، سرور A برای اختصاص آدرس های IP 10.0.20.1 تا 10.0.20.125 و سرور B برای اختصاص آدرس IP 10.0.20.126 تا 10.0.20.254 پیکربندی شده است.

Server A

ip dhcp excluded-address 10.0.20.126 10.0.20.255!ip dhcp pool A network 10.0.20.0 255.255.255.0

Server B

ip dhcp excluded-address 10.0.20.0 10.0.20.125!ip dhcp pool B network 10.0.20.0 255.255.255.0 

 

  • پیکربندی استخرهای آدرس DHCP

در مثال زیر ، سه مجموعه آدرس DHCP ایجاد شده است: یکی در شبکه 172.16.0.0 ، دیگری در زیر شبکه 172.16.1.0 و دیگری در زیر شبکه 172.16.2.0. ویژگی های شبکه 172.16.0.0 - مانند نام دامنه ، سرور سیستم نام دامنه (DNS) ، (سیستم ورودی / خروجی پایه شبکه) سرور نام NetBIOS و نوع   node- NetBIOS  در شبکه های فرعی 172.16.1.0 و 172.16.2.0 به منتقل می شوند. در هر استخر ، IP Address ها به مشتریان 30 روز اجاره داده می شود و کلیه آدرس ها در هر شبکه فرعی ، به جز excluded address شده ، برای مشتری اختصاص داده شده که در سرور DHCP موجود است. در جدول زیر آدرس IP برای دستگاه ها در سه مجموعه آدرس DHCP ذکر شده است.

 

      Pool 2 (Subnetwork 172.16.2.0) Pool 1 (Subnetwork 172.16.1.0) Pool 0 (Network 172.16.0.0)
IP Address  Device IP Address Device IP Address Device

172.16.2.100

172.16.2.101

Default devices

172.16.1.100

172.16.1.101

  ------------ Default devices
--------- -------- --------- --------------

172.16.1.102

172.16.2.102

DNS server
--------- -------- --------- --------------

172.16.1.103

172.16.2.103

NetBIOS name server
--------- -------- --------- -------------- h-node NetBIOS node type

 

ip dhcp database ftp://user:password@172.16.4.253/router-dhcp write-delay 120

ip dhcp excluded-address 172.16.1.100 172.16.1.103

ip dhcp excluded-address 172.16.2.100 172.16.2.103

!

ip dhcp pool 0

 network 172.16.0.0 /16

 domain-name cisco.com

 dns-server 172.16.1.102 172.16.2.102

 netbios-name-server 172.16.1.103 172.16.2.103

 netbios-node-type h-node

!

ip dhcp pool 1

 network 172.16.1.0 /24

 default-router 172.16.1.100 172.16.1.101

 lease 30

!

ip dhcp pool 2

 network 172.16.2.0 /24

 default-router 172.16.2.100 172.16.2.101

 lease 30

 

  • پیکربندی استخر آدرس DHCP با چندین زیرمجموعه جداگانه

چندین زیر شبکه جدا از هم در یک DHCP در هر یک از توپولوژی های شبکه زیر قابل استفاده است:

  • جمع آوری آدرس IP address pooling سرویس گیرنده و سرور DHCP در یک زیر شبکه قرار دارند
  • DHCP -Relay سرویس گیرنده DHCP و سرور DHCP از طریق یک عامل رله DHCP در جایی که رابط رله با آدرس های IP ثانویه پیکربندی می شود ، ارتباط برقرار می کنند.
  • Hirearchical- DHCP  سرور DHCP به عنوان سرور تخصیص زیر شبکه DHCP پیکربندی شده است. سرویس گیرنده DHCP و سرور تخصیص زیر شبکه DHCP از طریق یک روتر حوض آدرس ((ODAP

در مثال زیر ، یک استخر آدرس DHCP به نام pool3 ایجاد شده است. زیرشبکه اولیه 172.16.0.0/16 ، یک زیرشبکه ثانویه 172.16.1.0/24 و زیرشبکه دوم 172.16.2.0/24 است.

  • وقتی آدرس های IP در زیرشبکه اصلی به اتمام رسید ، سرور DHCP زیر مجموعه های فرعی را به ترتیب اضافه شدن زیرشبکه ها به استخر بازرسی می کند.
  • هنگامی که سرور DHCP یک آدرس IP از زیر شبکه فرعی 172.16.1.0/24 اختصاص می دهد ، سرور از لیست دستگاه پیش فرض مخصوص زیر شبکه استفاده می کند که شامل آدرس های IP 172.16.1.100 و 172.16.1.101 است. با این حال ، هنگامی که سرور DHCP یک آدرس IP از زیر شبکه 172.16.2.0/24 اختصاص می دهد ، سرور از لیست گسترده استخر استفاده می کند که از چهار آدرس IP از 172.16.0.100 تا 172.16.0.103 تشکیل شده است.
  • ویژگی های دیگر از زیر شبکه اصلی 172.16.0.0/16 مانند نام دامنه ، سرور DNS ، نام سرور NetBIOS و نوع Node NetBIOS - در هر دو زیر شبکه فرعی به ارث(inherited)  می رسند.
  • به DHCP Client    30 روز اجاره نامه های IP در استخر تعلق می گیرد. همه آدرس ها در هر زیر شبکه ، به جز آدرس های مستثنی ، برای اختصاص دادن به سرویس گیرنده ها در دسترس سرور DHCP است.

 

      Second Secondary Subnet (172.16.2.0/24) First Secondary Subnet (172.16.1.0/24) Primary Subnet (172.16.0.0/16)
IP Address Device IP Address

Device

IP Address Device

172.16.0.100

172.16.0.101

172.16.0.102

172.16.0.103

Default devices

172.16.1.100

172.16.1.101

Default devices

172.16.0.100

172.16.0.101

172.16.0.102

172.16.0.103

Default devices
------------- ------------ ----------- -----------------

172.16.1.102

172.16.2.102

DNS server
------------- ------------ ----------- -----------------

172.16.1.103

172.16.2.103

NetBIOS name server
------------- ------------ ----------- ----------------- h-node NetBIOS node type

 

ip dhcp database ftp://user:password@172.16.4.253/router-dhcp write-delay 120

ip dhcp excluded-address 172.16.0.100 172.16.1.103

ip dhcp excluded-address 172.16.1.100 172.16.1.101

!

ip dhcp pool pool3

 network 172.16.0.0 /16

 default-router 172.16.0.100 172.16.2.101 172.16.0.102 172.16.0.103

 domain-name cisco.com

 dns-server 172.16.1.102 172.16.2.102

 netbios-name-server 172.16.1.103 172.16.2.103

 netbios-node-type h-node

 lease 30

!

 network 172.16.1.0 /24 secondary

  override default-router 172.16.1.100 172.16.1.101

  end

!

 network 172.16.2.0 /24 secondary

 

DHCP SERVER CONFIGURATION


به اشتراک بگذارید :

علی عسکری / آداک فن آوری مانیا 

کلمات کلیدی
  • آدرس دفتر مرکزی: تهران، بلوار نلسون ماندلا (آفریقا)، خ فرزان شرقی، پ 33

  • تلفن ویژه: 43672 (9821+) 88193969 (9821+)
  • ایمیل: info@mania-co.com