{"id":306,"date":"2024-02-12T15:00:40","date_gmt":"2024-02-12T11:30:40","guid":{"rendered":"https:\/\/zharfpouyan.net\/docs\/?p=306"},"modified":"2025-01-13T13:32:58","modified_gmt":"2025-01-13T10:02:58","slug":"%d8%b3%d8%b1%d9%88%db%8c%d8%b3-dhcp","status":"publish","type":"post","link":"https:\/\/zharfpouyan.net\/docs\/%d8%b3%d8%b1%d9%88%db%8c%d8%b3-dhcp\/","title":{"rendered":"\u0633\u0631\u0648\u06cc\u0633 DHCP"},"content":{"rendered":"<p><strong>1-1. \u0633\u0646\u0627\u0631\u06cc\u0648 \u062a\u0633\u062a server<\/strong><\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-307\" src=\"https:\/\/zharfpouyan.net\/docs\/wp-content\/uploads\/2024\/02\/DHCP-test.jpg\" alt=\"\" width=\"866\" height=\"211\" srcset=\"https:\/\/zharfpouyan.net\/docs\/wp-content\/uploads\/2024\/02\/DHCP-test.jpg 866w, https:\/\/zharfpouyan.net\/docs\/wp-content\/uploads\/2024\/02\/DHCP-test-300x73.jpg 300w, https:\/\/zharfpouyan.net\/docs\/wp-content\/uploads\/2024\/02\/DHCP-test-768x187.jpg 768w\" sizes=\"(max-width: 866px) 100vw, 866px\" \/><\/p>\n<p><strong>1-2. \u0647\u062f\u0641<br \/>\n<\/strong><\/p>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u0633\u0646\u0627\u0631\u06cc\u0648 \u0631\u0648\u062a\u0631 \u0698\u0631\u0641 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0633\u0631\u0648\u0631\u00a0 DHCP \u00a0\u00a0\u062f\u0631 \u0646\u0638\u0631 \u06af\u0631\u0641\u062a\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a \u0648 \u0627\u0632 \u067e\u0648\u0631\u062a gbeth 0 \u00a0\u00a0\u0628\u0647 PC \u0627\u06cc \u06a9\u0647 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 DHCP Client \u062f\u0631 \u0646\u0638\u0631 \u06af\u0631\u0641\u062a\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a \u060c \u0645\u062a\u0635\u0644 \u0627\u0633\u062a.<\/p>\n<ul>\n<li>\u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0631\u0648\u062a\u0631 \u0698\u0631\u0641 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646DHCP Server<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true \">Zharf(config)# interface gbeth 0\r\nZharf(config-if)# ip address 192.168.100.1 255.255.255.0\r\nZharf(config)# ip dhcp pool pool1\r\nZharf(dhcp-config)# network 192.168.100.0 255.255.255.0\r\nZharf(config)# ip dhcp excluded_address192.168.100.1 192.168.100.10 pool pool1\r\n<\/pre>\n<p><strong>1-2-1. \u062f\u0631\u0633\u062a\u06cc \u06cc\u0627\u0628\u06cc<\/strong><\/p>\n<p>\u067e\u0633 \u0627\u0632 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0645\u0631\u0628\u0648\u0637\u0647\u060c DHCP Client \u06cc\u0627 \u0647\u0645\u0627\u0646 PC1 \u060c\u06cc\u06a9 \u0622\u062f\u0631\u0633 IP \u062f\u0631 \u0631\u0646\u062c \u0645\u0634\u062e\u0635 \u0634\u062f\u0647 \u062f\u0631 DHCP pool \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a\u00a0 \u062e\u0648\u0627\u0647\u062f \u06a9\u0631\u062f.<\/p>\n<pre class=\"lang:default decode:true \">PC1&gt; show ip \r\nNAME        : PC1[1]\r\nIP\/MASK     : 192.168.100.11\/24\r\nGATEWAY     : 0.0.0.0\r\nDNS         : \r\nDHCP SERVER : 192.168.100.1\r\nDHCP LEASE  : 43195, 43200\/21600\/37800\r\nMAC         : 00:50:79:66:68:00\r\nLPORT       : 10000\r\nRHOST:PORT  : 127.0.0.1:10001\r\n<\/pre>\n<p><strong>1-2-3. \u0639\u06cc\u0628 \u06cc\u0627\u0628\u06cc<\/strong><\/p>\n<p>\u062f\u0631 \u0635\u0648\u0631\u062a\u06cc \u06a9\u0647 DHCP Client \u0622\u062f\u0631\u0633 IP \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u0646\u06a9\u0631\u062f \u0627\u0632 \u0635\u062d\u062a \u0627\u0631\u062a\u0628\u0627\u0637\u0627\u062a \u0641\u06cc\u0632\u06cc\u06a9\u06cc \u0648 \u06a9\u0627\u0646\u0641\u06cc\u06af DHCP Server \u0627\u0637\u0645\u06cc\u0646\u0627\u0646 \u062d\u0627\u0635\u0644 \u06a9\u0646\u06cc\u062f.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>2-1. \u0633\u0646\u0627\u0631\u06cc\u0648 \u062a\u0633\u062a Client \u060cDHCP relay agent \u0648 Server<\/strong><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-308\" src=\"https:\/\/zharfpouyan.net\/docs\/wp-content\/uploads\/2024\/02\/DHCP-relay.jpg\" alt=\"\" width=\"1212\" height=\"214\" srcset=\"https:\/\/zharfpouyan.net\/docs\/wp-content\/uploads\/2024\/02\/DHCP-relay.jpg 1212w, https:\/\/zharfpouyan.net\/docs\/wp-content\/uploads\/2024\/02\/DHCP-relay-300x53.jpg 300w, https:\/\/zharfpouyan.net\/docs\/wp-content\/uploads\/2024\/02\/DHCP-relay-1024x181.jpg 1024w, https:\/\/zharfpouyan.net\/docs\/wp-content\/uploads\/2024\/02\/DHCP-relay-768x136.jpg 768w\" sizes=\"(max-width: 1212px) 100vw, 1212px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>2-2<\/strong><strong>. \u0647\u062f\u0641<\/strong><\/p>\n<p>\u062f\u0631 \u0627\u06cc\u0646 \u0633\u0646\u0627\u0631\u06cc\u0648 \u0647\u062f\u0641 \u062a\u0633\u062a \u0631\u0648\u062a\u0631 \u0698\u0631\u0641 \u062f\u0631 \u0633\u0647 \u0646\u0642\u0634 DHCP Server (Zharf1) \u060c DHCP Relay (Zharf2) \u0648 DHCP Client(Zharf3)<\/p>\n<p>\u0645\u06cc \u0628\u0627\u0634\u062f \u060c Zharf1 \u00a0\u0648\u0638\u06cc\u0641\u0647 \u0627\u062e\u062a\u0635\u0627\u0635 \u062f\u0627\u062f\u0646 IP \u0628\u0647 Client \u0647\u0627 \u0631\u0627 \u0628\u0647 \u0639\u0647\u062f\u0647 \u062f\u0627\u0631\u062f \u060c Zharf2 \u062f\u0631 \u0646\u0642\u0634 \u0648\u0627\u0633\u0637 \u06a9\u0647 DHCP Server \u0631\u0627 \u0628\u0631\u0627\u06cc Client \u0647\u0627 \u062c\u0647\u062a \u062f\u0631\u06cc\u0627\u0641\u062a IP \u0642\u0627\u0628\u0644 \u062f\u0633\u062a\u0631\u0633 \u0645\u06cc\u00ad\u06a9\u0646\u062f.<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>\u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0631\u0648\u062a\u0631 \u0698\u0631\u0641 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646DHCP Server<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true \">Zharf1(config)#interface gbeth 0\r\nZharf1(config-if)# ip address 192.168.12.1 255.255.255.0\r\nZharf1(config-if)# no shutdown\r\nZharf1(config)# exit\r\nZharf1(config)# ip dhcp pool pool1\r\nZharf1(dhcp-config)# network 192.168.23.0 255.255.255.0\r\nZharf1(dhcp-config)# exit\r\nZharf1(config)# ip dhcp pool pool2\r\nZharf1(dhcp-config)# network 192.168.12.0 255.255.255.0\r\nZharf1(dhcp-config)# exit\r\nZharf1(config)# ip route 0.0.0.0\/0 192.168.12.2\r\n<\/pre>\n<ul>\n<li>\u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0631\u0648\u062a\u0631 \u0698\u0631\u0641 \u0628\u0647 \u00a0\u0639\u0646\u0648\u0627\u0646DHCP relay<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true \">Zharf2(config)# interface gbeth 0\r\nZharf2(config-if)# ip address 192.168.12.2 255.255.255.0\r\nZharf2(config-if)# no shutdown\r\nZharf2(config-if)# ip helper-address 192.168.12.1 \r\nZharf2(config)# interface gbeth 1\r\nZharf2(config-if)# ip address 192.168.23.2 255.255.255.0\r\nZharf2(config-if)# no shutdown\r\nZharf2(config-if)# ip helper-address 192.168.12.1 \r\n<\/pre>\n<ul>\n<li>\u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0631\u0648\u062a\u0631 \u0698\u0631\u0641 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 DHCP Client<\/li>\n<\/ul>\n<pre class=\"lang:default decode:true\">Zharf3(config)# interface gbeth 0\r\nZharf3(config-if)# ip address dhcp\r\nZharf3(config) # no shutdown\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>2-2-1<\/strong><strong>. \u062f\u0631\u0633\u062a\u06cc \u06cc\u0627\u0628\u06cc<br \/>\n<\/strong><\/p>\n<p>\u0628\u0639\u062f \u0627\u0632 \u0627\u0639\u0645\u0627\u0644 \u062a\u0646\u0638\u06cc\u0645\u0627\u062a\u060c \u062f\u0631 \u0631\u0648\u062a\u0631 Zharf3 \u06a9\u0647 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 Client \u00a0\u062f\u0631 \u0646\u0638\u0631 \u06af\u0631\u0641\u062a\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a \u0645\u0634\u0627\u0647\u062f\u0647 \u062e\u0648\u0627\u0647\u062f \u0634\u062f \u06a9\u0647 IP \u0627\u062e\u062a\u0635\u0627\u0635 \u06cc\u0627\u0641\u062a\u0647 \u060c \u0648 \u0627\u06cc\u0646 \u0622\u062f\u0631\u0633 \u062f\u0631 \u0631\u0646\u062c \u0622\u062f\u0631\u0633 \u0645\u0634\u062e\u0635 \u0634\u062f\u0647 \u062f\u0631 pool1 \u0627\u0633\u062a. \u0628\u0647 \u06a9\u0645\u06a9 \u062f\u0633\u062a\u0648\u0631 show ip interface brief \u00a0\u0645\u06cc\u062a\u0648\u0627\u0646 \u0627\u0632 \u0635\u062d\u062a \u0627\u06cc\u0646 \u0645\u0648\u0631\u062f \u0627\u0637\u0645\u06cc\u0646\u0627\u0646 \u06cc\u0627\u0641\u062a.<\/p>\n<pre class=\"lang:default decode:true \">Zharf3# show ip interface brief\r\nInterface       OK?     IP-Address              Method       Status                Protocol              \r\n----------      -----   -----------             ------       ------                ------                \r\ngbeth0          YES     unassigned              unset        Administratively down down                  \r\ngbeth1          YES     192.168.23.3             dhcp        up                    up                    \r\ngbeth2          YES     unassigned              unset        Administratively down down                  \r\ngbeth3          YES     unassigned              unset        Administratively down down                  \r\ngbeth4          YES     unassigned              unset        Administratively down down                  \r\ngbeth5          YES     unassigned              unset        Administratively down down            \r\n<\/pre>\n<p><strong>2-2-3<\/strong><strong>. \u0639\u06cc\u0628 \u06cc\u0627\u0628\u06cc<br \/>\n<\/strong><\/p>\n<p>\u062f\u0631 \u0635\u0648\u0631\u062a\u06cc \u06a9\u0647 DHCP Client \u0622\u062f\u0631\u0633 IP \u0631\u0627 \u062f\u0631\u06cc\u0627\u0641\u062a \u0646\u06a9\u0631\u062f \u0627\u0632 \u0635\u062d\u062a \u0627\u0631\u062a\u0628\u0627\u0637\u0627\u062a \u0641\u06cc\u0632\u06cc\u06a9\u06cc \u0648 \u06a9\u0627\u0646\u0641\u06cc\u06af DHCP Server \u0648 DHCP relay \u0627\u0637\u0645\u06cc\u0646\u0627\u0646 \u062d\u0627\u0635\u0644 \u06a9\u0646\u06cc\u062f.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1-1. \u0633\u0646\u0627\u0631\u06cc\u0648 \u062a\u0633\u062a server 1-2. \u0647\u062f\u0641 \u062f\u0631 \u0627\u06cc\u0646 \u0633\u0646\u0627\u0631\u06cc\u0648 \u0631\u0648\u062a\u0631 \u0698\u0631\u0641 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 \u0633\u0631\u0648\u0631\u00a0 DHCP \u00a0\u00a0\u062f\u0631 \u0646\u0638\u0631 \u06af\u0631\u0641\u062a\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a \u0648 \u0627\u0632 \u067e\u0648\u0631\u062a gbeth 0 \u00a0\u00a0\u0628\u0647 PC \u0627\u06cc \u06a9\u0647 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646 DHCP Client \u062f\u0631 \u0646\u0638\u0631 \u06af\u0631\u0641\u062a\u0647 \u0634\u062f\u0647 \u0627\u0633\u062a \u060c \u0645\u062a\u0635\u0644 \u0627\u0633\u062a. \u062a\u0646\u0638\u06cc\u0645\u0627\u062a \u0631\u0648\u062a\u0631 \u0698\u0631\u0641 \u0628\u0647 \u0639\u0646\u0648\u0627\u0646DHCP Server Zharf(config)# interface gbeth 0 Zharf(config-if)# ip address 192.168.100.1 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/zharfpouyan.net\/docs\/%d8%b3%d8%b1%d9%88%db%8c%d8%b3-dhcp\/\"> <span class=\"screen-reader-text\">\u0633\u0631\u0648\u06cc\u0633 DHCP<\/span> \u0627\u062f\u0627\u0645\u0647 \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-306","post","type-post","status-publish","format-standard","hentry","category-6"],"_links":{"self":[{"href":"https:\/\/zharfpouyan.net\/docs\/wp-json\/wp\/v2\/posts\/306","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zharfpouyan.net\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zharfpouyan.net\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zharfpouyan.net\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zharfpouyan.net\/docs\/wp-json\/wp\/v2\/comments?post=306"}],"version-history":[{"count":1,"href":"https:\/\/zharfpouyan.net\/docs\/wp-json\/wp\/v2\/posts\/306\/revisions"}],"predecessor-version":[{"id":309,"href":"https:\/\/zharfpouyan.net\/docs\/wp-json\/wp\/v2\/posts\/306\/revisions\/309"}],"wp:attachment":[{"href":"https:\/\/zharfpouyan.net\/docs\/wp-json\/wp\/v2\/media?parent=306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zharfpouyan.net\/docs\/wp-json\/wp\/v2\/categories?post=306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zharfpouyan.net\/docs\/wp-json\/wp\/v2\/tags?post=306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}