溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

華為路由器上的 DHCP 配置(詳細(xì)步驟)

發(fā)布時(shí)間:2020-07-20 22:03:11 來源:網(wǎng)絡(luò) 閱讀:85341 作者:會(huì)飛的云彩 欄目:系統(tǒng)運(yùn)維

 

華為路由器上的 DHCP 配置(詳細(xì)步驟) 

 

 

 

 

 

 

 華為路由器上的 DHCP 配置步驟:

 

 

1、確??蛻舳伺c服務(wù)器之間的鏈路是互通的;

        #SW1

           創(chuàng)建 VLAN 10  

           將端口放入VLAN 10 ;

        #Gateway

           在 Router 上為 VLAN 10 配置一個(gè) 網(wǎng)關(guān)IP 地址;

 

2、配置 DHCP 客戶端;

        # 進(jìn)入 PC ,選擇“自動(dòng)獲取”,點(diǎn)“應(yīng)用”;

 

3、配置 DHCP 服務(wù)器;

        # 創(chuàng)建 IP 地址池;

            ip pool VLAN-10

               network 192.168.10.0 mask 255.255.255.0

               gateway-list  192.168.10.254

               dns-list 8.8.8.8

               lease day 3

               

        # 開啟 DHCP 服務(wù) ;

            dhcp enable         

        # 在 接收 DHCP 報(bào)文的端口上,配置 DHCP 的選擇方式 -  global ;

            interface gi0/0/0

               dhcp select global // 表示的是當(dāng)端口上收到 DHCP 報(bào)文以后

                                      直接去 DHCP 服務(wù)器在全局配置的IP

                                      地址池中選擇一個(gè)可用的IP地址;

                        

一:sw1配置

 

[sw1]vlan batch 10 20 //創(chuàng)建vlan

[sw1]int g0/0/1

[sw1-GigabitEthernet0/0/1]port link-type access //端口加vlan

[sw1-GigabitEthernet0/0/1]port default vlan 10

[sw1-GigabitEthernet0/0/1]q

[sw1]int g0/0/2

[sw1-GigabitEthernet0/0/2]port link-type access

[sw1-GigabitEthernet0/0/2]port default vlan 20

[sw1-GigabitEthernet0/0/2]q

[sw1]int vlan 10

[sw1-Vlanif10]ip add 192.168.10.254 24

[sw1-Vlanif10]int vlan 20

 [sw1-Vlanif20]ip add 192.168.20.1 24

[sw1-Vlanif20]int g0/0/3

[sw1-GigabitEthernet0/0/3]port link-type access

[sw1-GigabitEthernet0/0/3]port default vlan 20

[sw1-GigabitEthernet0/0/3]q

[sw1]rip             //RIP應(yīng)用

[sw1-rip-1]version 2

[sw1-rip-1]network 192.168.10.0

[sw1-rip-1]network 192.168.20.0

[sw2]dhcp enable  //啟用dhcp

[sw1]int vlan 10

[sw1-Vlanif10]dhcp select relay //dhcp中繼

[sw1-Vlanif10]dhcp relay server-ip 192.168.100.2

Sw2配置:

[sw2]vlan batch 30 40 50 60

[sw2]int g0/0/2

[sw2-GigabitEthernet0/0/2]port link-type a 

[sw2-GigabitEthernet0/0/2]port link-type access

[sw2-GigabitEthernet0/0/2]port d   

[sw2-GigabitEthernet0/0/2]port def 

[sw2-GigabitEthernet0/0/2]port default vlan 30

[sw2-GigabitEthernet0/0/2]q

[sw2]int eth0/0/3

[sw2-Ethernet0/0/3]port link-type access

[sw2-Ethernet0/0/3]port default vlan 40

[sw2-Ethernet0/0/3]q

[sw2-Ethernet0/0/4]port link-type access

[sw2-Ethernet0/0/4]port default vlan 50

[sw2-Ethernet0/0/4]q

[sw2]int eth0/0/5

[sw2-Ethernet0/0/5]port link-type access

[sw2-Ethernet0/0/5]port default vlan 60

[sw2-Ethernet0/0/5]q

[sw2-Ethernet0/0/1]port link-type access

[sw2-Ethernet0/0/1]port default vlan 50

[sw2-Ethernet0/0/1]int g0/0/6

[sw2-Ethernet0/0/1]q

[sw2]int eth0/0/6

[sw2-Ethernet0/0/6]port link-type access

[sw2-Ethernet0/0/6]port default vlan 60

[sw2-Ethernet0/0/6]q

[sw2]int vlan 30

[sw2-Vlanif30]ip add 192.168.30.254

[sw2-Vlanif30]ip add 192.168.30.254 24

[sw2-Vlanif30]q

[sw2]int vlan 40

[sw2-Vlanif40]ip add 192.168.40.254 24

[sw2]int vlan 50

[sw2-Vlanif50]ip add 192.168.50.1 24

[sw2]int vlan 60

[sw2-Vlanif60]ip add 192.168.60.1 24

[sw2-Vlanif50]q

[sw2]rip

[sw2-rip-1]version 2

[sw2-rip-1]network 192.168.30.0

[sw2-rip-1]network 192.168.40.0

[sw2-rip-1]network 192.168.50.0

[sw2-rip-1]network 192.168.60.0

[sw2-rip-1]q

[sw2]dhcp enable

[sw2]int vlan 30

[sw2-Vlanif30]dhcp select relay

[sw2-Vlanif30]dhcp relay server-ip 192.168.100.2

[sw2-Vlanif30]q

[sw2]int vlan 40

[sw2-Vlanif40]dhcp select relay

[sw2-Vlanif40]dhcp relay server-ip 192.168.100.2

三:R1配置

[r1]int g0/0/0

[r1-GigabitEthernet0/0/0]ip add 192.168.20.254

[r1-GigabitEthernet0/0/0]ip add 192.168.20.254 24

[r1-GigabitEthernet0/0/0]int g0/0/2

[r1-GigabitEthernet0/0/2]ip add 192.168.100.1 24

[r1-GigabitEthernet0/0/2]q

[r1]int g0/0/1

[r1-GigabitEthernet0/0/1]ip add 192.168.70.1 24

[r1]rip

[r1-rip-1]version 2

[r1-rip-1]network  192.168.20.0

[r1-rip-1]network 192.168.100.0

[r1-rip-1]network 192.168.70.0

[r1-rip-1]q

[r1]dhcp enable

[r1]int g0/0/0

[r1-GigabitEthernet0/0/0]dhcp select relay

[r1-GigabitEthernet0/0/0]dhcp relay server-ip 192.168.100.2

四.R2配置

[r2]int g0/0/1

[r2-GigabitEthernet0/0/1]ip add 192.168.70.2 24

[r2-GigabitEthernet0/0/1]q

[r2]int g0/0/0

[r2-GigabitEthernet0/0/0]ip add 192.168.50.254 24

[r2-GigabitEthernet0/0/0]ip add 192.168.60.254

 [r2-GigabitEthernet0/0/0]ip add 192.168.60.254 24

[r2-GigabitEthernet0/0/0]rip

[r2-rip-1]version 2

[r2-rip-1]network 192.168.70.0

[r2-rip-1]network 192.168.50.0

[r2-rip-1]network 192.168.60.0

[r2]dhcp enable

[r2]int g0/0/0

[r2-GigabitEthernet0/0/0]dhcp select relay

[r2-GigabitEthernet0/0/0]dhcp  relay server-ip 192.168.100.2

[r2-GigabitEthernet0/0/0]q

[r2]int g0/0/2

[r2-GigabitEthernet0/0/2]dhcp select relay

[r2-GigabitEthernet0/0/2]dhcp relay server-ip 192.168.100.2

五.Dhcp配置:

[dhcp]int vlan 100

[dhcp]interface g0/0/1

[dhcp-GigabitEthernet0/0/1]port link-type access

[dhcp-GigabitEthernet0/0/1]port default vlan 100

[dhcp-Vlanif100]ip add 192.168.100.2 24

[dhcp-Vlanif100]q

[dhcp]dhcp enable

[dhcp]ip pool vlan10     //建地址池

[dhcp-ip-pool-vlan10]network 192.168.10.0 mask 24

[dhcp-ip-pool-vlan10]gateway-list 192.168.10.254

[dhcp-ip-pool-vlan10]dns-list 8.8.8.8

[dhcp-ip-pool-vlan10]Q

[dhcp]ip pool vlan20

[dhcp-ip-pool-vlan20]network 192.168.20.0 mask 24

[dhcp-ip-pool-vlan20]gateway-list 192.168.20.254

[dhcp-ip-pool-vlan20]dns-list 8.8.8.8

[dhcp-ip-pool-vlan20]q

[dhcp]ip pool vlan30

[dhcp-ip-pool-vlan30]network 192.168.30.0 mask 24

[dhcp-ip-pool-vlan30]gateway-list 192.168.30.254 mask 24

[dhcp-ip-pool-vlan30]gateway-list 192.168.30.254 mask 24

[dhcp-ip-pool-vlan30]gateway-list 192.168.30.254 mask 30

[dhcp-ip-pool-vlan30]gateway-list 192.168.30.254 mask 24

[dhcp-ip-pool-vlan30]gateway-list 192.168.30.254

[dhcp-ip-pool-vlan30]dns-list 8.8.8.8

[dhcp-ip-pool-vlan30]q

[dhcp]ip pool vlan40

[dhcp-ip-pool-vlan40]network 192.168.40.0 mask 24

 [dhcp-ip-pool-vlan40]gateway-list 192.168.40.254

[dhcp-ip-pool-vlan40]dns-list 8.8.8.8

[dhcp]ip pool vlan50

[dhcp-ip-pool-vlan50]network 192.168.50.0 mask 24

[dhcp-ip-pool-vlan50]gateway-list 192.168.50.254

[dhcp-ip-pool-vlan50]dns-list 8.8.8.8

 [dhcp]ip pool vlan60

[dhcp-ip-pool-vlan60]network 192.168.60.0 mask 24

[dhcp-ip-pool-vlan60]gateway-list 192.168.60.254

[dhcp-ip-pool-vlan60]dns-list 8.8.8.8

[dhcp-ip-pool-vlan60]q

[dhcp]int vlan 100

[dhcp-Vlanif100]dhcp select global

[dhcp-Vlanif100]q

[dhcp]ip route-static 0.0.0.0 0.0.0.0 192.168.100.1

六.獲得ip并相互ping通

華為路由器上的 DHCP 配置(詳細(xì)步驟)

華為路由器上的 DHCP 配置(詳細(xì)步驟)

 

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI