DHCPRelay(DHCPR)DHCP中繼 也叫做DHCP中繼代理,如果DHCP客戶機與DHCP服務(wù)器在同一個物理網(wǎng)段,則客戶機可以正確地獲得動態(tài)分配的ip地址。如果不在同一個物理網(wǎng)段,則需要DHCP Relay Agent(中繼代理)。用DHCP Relay代理可以去掉在每個物理的網(wǎng)段都要有DHCP服務(wù)器的必要,它可以傳遞消息到不在同一個物理子網(wǎng)的DHCP服務(wù)器,也可以將服務(wù)器的消息傳回給不在同一個物理子網(wǎng)的DHCP客戶機。
為徽縣等地區(qū)用戶提供了全套網(wǎng)頁設(shè)計制作服務(wù),及徽縣網(wǎng)站建設(shè)行業(yè)解決方案。主營業(yè)務(wù)為成都網(wǎng)站設(shè)計、網(wǎng)站建設(shè)、徽縣網(wǎng)站設(shè)計,以傳統(tǒng)方式定制建設(shè)網(wǎng)站,并提供域名空間備案等一條龍服務(wù),秉承以專業(yè)、用心的態(tài)度為用戶提供真誠的服務(wù)。我們深信只要達(dá)到每一位用戶的要求,就會得到認(rèn)可,從而選擇與我們長期合作。這樣,我們也可以走得更遠(yuǎn)!實驗需求:
C1、C2、C3屬于不同的VLAN,分別是VLAN10,20,30;
三層交換實現(xiàn)PC間互通,并通過dhcp中繼代理在R2獲取IP地址;
R2開啟dhcp服務(wù)為PC分配IP地址;
實驗步驟:
實驗所用 :HUAWEI eNsp
1.LSW2交換機 批量添加VLAN 10,20 配置 Ethernet 0/0/3 VLAN 10 讓PC1屬于VLAN10; 配置Ethernet 0/0/4 PC2屬于VLAN20 配置Ethernet 0/0/2 中繼TRUNK口;
<Huawei>sy //特權(quán)模式;
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan bat 10 20 //批量添加VLAN10,20;
Info: This operation may take a few seconds. Please wait for a moment...done.
Mar 31 2016 19:12:26-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5
.25.191.3.1 configurations have been changed. The current change number is 4, th
e change loop count is 0, and the maximum number of records is 4095.
[Huawei]int e0/0/3 //進GigabitEthernet0/0/3物理接口;
[Huawei-Ethernet0/0/3]port link-type access //設(shè)置為訪問口;
[Huawei-Ethernet0/0/3]port default vlan 10 //添加為VLAN10;
[Huawei-Ethernet0/0/3]int e0/0/4 //進GigabitEthernet0/0/4物理接口;
[Huawei-Ethernet0/0/4]port link-type access //設(shè)置為訪問口;
[Huawei-Ethernet0/0/4]port default vlan 20 //添加為VLAN20;
[Huawei-Ethernet0/0/4]int e0/0/2 //進GigabitEthernet0/0/2物理接口;
[Huawei-Ethernet0/0/2]port link-type trunk //設(shè)置為中繼TRUNK口;
[Huawei-Ethernet0/0/2]port trunk allow-pass vlan 10 20 //允許VLAN10,20成員的流量通過;
2.LSW1批量添加VLAN10,20 配置VLAN10,20,30 IP地址為PC的網(wǎng)關(guān)地址及子網(wǎng)掩碼 添加VLAN100 為GigabitEthernet0/0/1 設(shè)置IP地址實現(xiàn)上口互聯(lián) 設(shè)置靜態(tài)路由所有IP地址轉(zhuǎn)發(fā)到10.0.0.2 開啟dhcp功能并設(shè)置dhcp中繼;
<Huawei>sy //特權(quán)模式;
[Huawei]vlan bat 10 20 //批量添加VLAN10,20;
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int vlan 10 //進VLAN10接口;
[Huawei-Vlanif10]ip add 192.168.1.1 24 //配置IP地址及子網(wǎng)掩碼;
[Huawei-Vlanif10]q
[Huawei]int vlan 20 //進VLAN20接口;
[Huawei-Vlanif20]
Mar 31 2016 19:18:31-08:00 Huawei %%01IFNET/4/IF_STATE(l)[3]:Interface Vlanif20
has turned into UP state.
[Huawei-Vlanif20]ip add 192.168.2.1 24 //配置IP地址、子網(wǎng)掩碼;
[Huawei-Vlanif20]q
[Huawei]int vlan 30 //進VLAN30接口;
[Huawei-Vlanif30]
Mar 31 2016 19:18:48-08:00 Huawei %%01IFNET/4/IF_STATE(l)[5]:Interface Vlanif30
has turned into UP state.
[Huawei-Vlanif30]ip add 192.168.3.1 24 //配置IP地址、子網(wǎng)掩碼;
[Huawei-Vlanif30]
Mar 31 2016 19:18:55-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[6]:The line protocol
IP on the interface Vlanif30 has entered the UP state.
[Huawei]vlan 100 //創(chuàng)建VLAN100;
[Huawei-vlan100]int vlan 100 //進VLAN100接口;
[Huawei-Vlanif100]ip add 10.0.0.1 24 //配置IP地址及子網(wǎng)掩碼;
[Huawei]int g0/0/1 //進GigabitEthernet0/0/1物理接口;
[Huawei-GigabitEthernet0/0/1]port link-type access //設(shè)置接口類型為訪問口;
[Huawei-GigabitEthernet0/0/1]port default vlan 100 //添加進VLAN100;
[Huawei-GigabitEthernet0/0/1]q
[Huawei]ip route-static 0.0.0.0 0.0.0.0 10.0.0.2 //配置靜態(tài)路由;
[Huawei]q
<Huawei>ping 12.0.0.3 //測試上層互通性;
PING 12.0.0.3: 56 data bytes, press CTRL_C to break
Request time out
Reply from 12.0.0.3: bytes=56 Sequence=2 ttl=254 time=130 ms
Reply from 12.0.0.3: bytes=56 Sequence=3 ttl=254 time=40 ms
Reply from 12.0.0.3: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 12.0.0.3: bytes=56 Sequence=5 ttl=254 time=60 ms
[Huawei]dhcp enable //開啟dhcp服務(wù);
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]int vlan 10 //進VLAN10接口;
[Huawei-Vlanif10]dhcp select relay //配置dhcp中繼;
[Huawei-Vlanif10]dhcp relay server-ip 12.0.0.3 //設(shè)置dhcp中繼服務(wù)端地址;
[Huawei-Vlanif10]int vlan 20 //進VLAN20接口;
[Huawei-Vlanif20]dhcp select relay //配置dhcp中繼;
[Huawei-Vlanif20]dhcp relay server-ip 12.0.0.3 //設(shè)置dhcp中繼服務(wù)端地址;
[Huawei-Vlanif20]int vlan 30 //進VLAN30接口;
[Huawei-Vlanif30]dhcp select relay //配置dhcp中繼;
[Huawei-Vlanif30]dhcp relay server-ip 12.0.0.3 //設(shè)置dhcp中繼服務(wù)端地址;
3.路由器AR1配置GigabitEthernet0/0/1 、GigabitEthernet0/0/0 IP地址 設(shè)置靜態(tài)路由實現(xiàn)網(wǎng)絡(luò)互通;
<Huawei>sy //特權(quán)模式;
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/1 //進物理接口GigabitEthernet0/0/1;
[Huawei-GigabitEthernet0/0/1]ip add 10.0.0.2 24 //配置IP地址及子網(wǎng)掩碼;
Mar 31 2016 19:19:58-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[Huawei]int g0/0/0 //進接口GigabitEthernet0/0/0;
[Huawei-GigabitEthernet0/0/0]ip add 12.0.0.2 24 //配置IP地址及子網(wǎng)掩碼;
[Huawei-GigabitEthernet0/0/0]q
[Huawei]ip route-static 0.0.0.0 0.0.0.0 12.0.0.3 //配置靜態(tài)路由;
[Huawei]ip route-static 192.168.1.0 255.255.255.0 10.0.0.1
[Huawei]ip route-static 192.168.2.0 255.255.255.0 10.0.0.1
[Huawei]ip route-static 192.168.3.0 255.255.255.0 10.0.0.1
4.路由器AR2配置GigabitEthernet0/0/0 IP地址 配置v10、v20、v30 dhcp服務(wù)端為PC分配IP地址、網(wǎng)關(guān)、DNS 配置靜態(tài)路由實現(xiàn)網(wǎng)絡(luò)互通 進接口GigabitEthernet0/0/0選擇全局的地址池給DHCP客戶端使用;
<Huawei>sy //特權(quán)模式;
Enter system view, return user view with Ctrl+Z.
[Huawei]int g0/0/0 //進物理接口GigabitEthernet0/0/0;
[Huawei-GigabitEthernet0/0/0]ip add 12.0.0.3 24 //配置IP地址及子網(wǎng)掩碼;
Mar 31 2016 19:21:30-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]q //退出;
[Huawei]ip pool v10 //建立v10地址池;
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-v10]network 192.168.1.0 mask 24 //網(wǎng)絡(luò)段及子網(wǎng)掩碼;
[Huawei-ip-pool-v10]gateway-list 192.168.1.1 //網(wǎng)關(guān)地址;
[Huawei-ip-pool-v10]dns-list 2.2.2.2 4.4.4.4 //DNS地址;
[Huawei-ip-pool-v10]q
[Huawei]ip pool v20 //建立v20地址池;
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-v20]network 192.168.2.0 mask 24 //網(wǎng)絡(luò)段及子網(wǎng)掩碼;
[Huawei-ip-pool-v20]gateway-list 192.168.2.1 //網(wǎng)關(guān)地址;
[Huawei-ip-pool-v20]dns-list 2.2.2.2 // DNS地址;
[Huawei-ip-pool-v20]q
[Huawei]ip pool v30 //建立v30地址池;
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-v30]network 192.168.3.0 mask 24 //網(wǎng)絡(luò)段及子網(wǎng)掩碼;
[Huawei-ip-pool-v30]gateway-list 192.168.3.1 //網(wǎng)關(guān)地址;
[Huawei-ip-pool-v30]dns-list 2.2.2.2 // DNS地址;
[Huawei-ip-pool-v30]q
[Huawei]ip route-static 0.0.0.0 0.0.0.0 12.0.0.2 //設(shè)置靜態(tài)路由;
[Huawei]dhcp enable //開啟dhcp功能;
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]int g0/0/0 //進物理接口GigabitEthernet0/0/0;
[Huawei-GigabitEthernet0/0/0]dhcp select global //dhcp選擇全局地址池;
5.測試PC正常獲取IP地址、子網(wǎng)掩碼、DNS等信息 測試全網(wǎng)互通;
PC>ipconfig //PC1獲取IP地址、子網(wǎng)掩碼、DNS等信息;
Link local IPv6 address...........: fe80::5689:98ff:fe2e:78f6
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-2E-78-F6
DNS server........................: 2.2.2.2
4.4.4.4
PC>ipconfig //PC2獲取IP地址、子網(wǎng)掩碼、DNS等信息;
Link local IPv6 address...........: fe80::5689:98ff:fe5b:5969
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.2.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.2.1
Physical address..................: 54-89-98-5B-59-69
DNS server........................: 2.2.2.2
PC>ipconfig //PC3獲取IP地址、子網(wǎng)掩碼、DNS等信息;
Link local IPv6 address...........: fe80::5689:98ff:fef1:2fe4
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.3.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.3.1
Physical address..................: 54-89-98-F1-2F-E4
DNS server........................: 2.2.2.2
PC>ping 192.168.3.254 //測試PC1、PC3連通性;
Ping 192.168.3.254: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.3.254: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.3.254: bytes=32 seq=3 ttl=127 time=78 ms
From 192.168.3.254: bytes=32 seq=4 ttl=127 time=47 ms
PC>ping 12.0.0.3 //測試PC1、AR2連通性;
Ping 12.0.0.3: 32 data bytes, Press Ctrl_C to break
From 12.0.0.3: bytes=32 seq=1 ttl=253 time=32 ms
From 12.0.0.3: bytes=32 seq=2 ttl=253 time=32 ms
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
文章名稱:DHCP中繼代理[HuaweieNSP]-創(chuàng)新互聯(lián)
本文來源:http://jinyejixie.com/article20/coigjo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供服務(wù)器托管、網(wǎng)站設(shè)計公司、App開發(fā)、用戶體驗、品牌網(wǎng)站制作、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容