ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

秒懂!详细!DHCP中继

2022-10-07 12:02:10  阅读:222  来源: 互联网

标签:


DHCP中继原理

**

DHCP实验流程

**

sw2配置

The device is running!

huawei>u t m

Info: Current terminal monitor is off. huawei>sys

Enter system view, return user view with Ctrl+Z. [Huawei]sysn [Huawei]sysname SW2 [SW2]v b 10 20 Info: This operation may take a few seconds. Please wait for a moment…done. [SW2]int e0/0/1 [SW2-Ethernet0/0/1]p l a [SW2-Ethernet0/0/1]p d v 10 [SW2-Ethernet0/0/1]un sh Info: Interface Ethernet0/0/1 is not shutdown. [SW2-Ethernet0/0/1]int e0/0/2 [SW2-Ethernet0/0/2]p l a [SW2-Ethernet0/0/2]p d v 20 [SW2-Ethernet0/0/2]un sh Info: Interface Ethernet0/0/2 is not shutdown. [SW2-Ethernet0/0/2]int e0/0/3 [SW2-Ethernet0/0/3]p l a [SW2-Ethernet0/0/3]p d v 10 [SW2-Ethernet0/0/3]un sh Info: Interface Ethernet0/0/3 is not shutdown. [SW2-Ethernet0/0/3]int e0/0/4 [SW2-Ethernet0/0/4]p l a [SW2-Ethernet0/0/4]p d v 20 [SW2-Ethernet0/0/4]un sh Info: Interface Ethernet0/0/4 is not shutdown. [SW2-Ethernet0/0/4]int g0/0/1 [SW2-GigabitEthernet0/0/1]p l t [SW2-GigabitEthernet0/0/1]p t a v 10 20 [SW2-GigabitEthernet0/0/1]un sh Info: Interface GigabitEthernet0/0/1 is not shutdown. [SW2-GigabitEthernet0/0/1] User interface con0 is available

Please Press ENTER.

sys Enter system view, return user view with Ctrl+Z. [SW2]dis cu [SW2]dis current-configuration

 

sysname SW2

 

vlan batch 10 20

 

cluster enable ntdp enable ndp enable

 

drop illegal-mac alarm

 

diffserv domain default

 

drop-profile default

 

aaa authentication-scheme default authorization-scheme default accounting-scheme default domain default domain default_admin local-user admin password simple admin local-user admin service-type http

 

[SW2]et [SW2]ret [SW2]return sav save The current configuration will be written to the device. Are you sure to continue?[Y/N]y Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]: Jun 29 2020 15:18:06-08:00 SW2 %%01CFM/4/SAVE(l)[0]:The user chose Y when decidi ng whether to save the configuration to the device. Now saving the current configuration to the slot 0. Save the configuration successfully.

**

R1

** The device is running!

u t m Info: Current terminal monitor is off. sys Enter system view, return user view with Ctrl+Z. [Huawei]sysn [Huawei]sysname R1 [R1]dhcp en [R1]dhcp enable Info: The operation may take a few seconds. Please wait for a moment.done. [R1]int g0/0/0.10 [R1-GigabitEthernet0/0/0.10]d [R1-GigabitEthernet0/0/0.10]dh [R1-GigabitEthernet0/0/0.10]dhcp en [R1-GigabitEthernet0/0/0.10]dhcp en [R1-GigabitEthernet0/0/0.10]dhcp s [R1-GigabitEthernet0/0/0.10]dhcp select r [R1-GigabitEthernet0/0/0.10]dhcp select relay [R1-GigabitEthernet0/0/0.10]dh [R1-GigabitEthernet0/0/0.10]dhcp r [R1-GigabitEthernet0/0/0.10]dhcp relay s [R1-GigabitEthernet0/0/0.10]dhcp relay server-ip 14.0.0.2

[R1-GigabitEthernet0/0/0.10]int g0/0/0.20 [R1-GigabitEthernet0/0/0.20]dhcp s [R1-GigabitEthernet0/0/0.20]dhcp sel [R1-GigabitEthernet0/0/0.20]dhcp select r [R1-GigabitEthernet0/0/0.20]dhcp select relay [R1-GigabitEthernet0/0/0.20]dhcp relay server-ip 14.0.0.2 [R1-GigabitEthernet0/0/0.20]un sh Info: Interface GigabitEthernet0/0/0.20 is not shutdown. [R1-GigabitEthernet0/0/0.20]dis thi [R1-GigabitEthernet0/0/0.20]dis thi [R1-GigabitEthernet0/0/0.20]dis thi [V200R003C00]

 

interface GigabitEthernet0/0/0.20 dhcp select relay dhcp relay server-ip 14.0.0.2

 

return [R1-GigabitEthernet0/0/0.20]int g0/0/1 [R1-GigabitEthernet0/0/1]ip add 14.0.0.1 24 [R1-GigabitEthernet0/0/1]un sh Info: Interface GigabitEthernet0/0/1 is not shutdown. [R1-GigabitEthernet0/0/1]int g0/0/2 [R1-GigabitEthernet0/0/2]ip add 12.0.0.1 24 [R1-GigabitEthernet0/0/2]un sh Info: Interface GigabitEthernet0/0/2 is not shutdown. [R1-GigabitEthernet0/0/2]q [R1]int g0/0/0.10 [R1-GigabitEthernet0/0/0.10]a [R1-GigabitEthernet0/0/0.10]arp b [R1-GigabitEthernet0/0/0.10]arp broadcast en [R1-GigabitEthernet0/0/0.10]arp broadcast enable

Error: This interface is not a termination interface. [R1-GigabitEthernet0/0/0.10]d [R1-GigabitEthernet0/0/0.10]do [R1-GigabitEthernet0/0/0.10]dot1q t [R1-GigabitEthernet0/0/0.10]dot1q termination v [R1-GigabitEthernet0/0/0.10]dot1q termination vid 10 [R1-GigabitEthernet0/0/0.10]a [R1-GigabitEthernet0/0/0.10]arp b [R1-GigabitEthernet0/0/0.10]arp broadcast e [R1-GigabitEthernet0/0/0.10]arp broadcast enable [R1-GigabitEthernet0/0/0.10]ip add 192.168.10.1 24 [R1-GigabitEthernet0/0/0.10]un sh Info: Interface GigabitEthernet0/0/0.10 is not shutdown. [R1-GigabitEthernet0/0/0.10]q [R1]int g0/0/0.20 [R1-GigabitEthernet0/0/0.20]d [R1-GigabitEthernet0/0/0.20]do [R1-GigabitEthernet0/0/0.20]dot1q t [R1-GigabitEthernet0/0/0.20]dot1q termination v [R1-GigabitEthernet0/0/0.20]dot1q termination vid 20 [R1-GigabitEthernet0/0/0.20]a [R1-GigabitEthernet0/0/0.20]arp b [R1-GigabitEthernet0/0/0.20]arp broadcast e [R1-GigabitEthernet0/0/0.20]arp broadcast enable [R1-GigabitEthernet0/0/0.20]ip add 192.168.20.1 24 [R1-GigabitEthernet0/0/0.20]un sh Info: Interface GigabitEthernet0/0/0.20 is not shutdown. [R1-GigabitEthernet0/0/0.20]dis th [R1-GigabitEthernet0/0/0.20]dis th [V200R003C00]

 

interface GigabitEthernet0/0/0.20 dot1q termination vid 20 ip address 192.168.20.1 255.255.255.0 arp broadcast enable dhcp select relay dhcp relay server-ip 14.0.0.2

 

return [R1-GigabitEthernet0/0/0.20] [R1-GigabitEthernet0/0/0.20]q [R1]ip r [R1]ip ro [R1]ip route-static 15.0.0.0 24 12.0.0.2 [R1]

Please check whether system data has been changed, and save data in time

Configuration console time out, please press any key to log on

sys Enter system view, return user view with Ctrl+Z. [R1]dis c [R1]dis calibrate ^ Error:Incomplete command found at ‘^’ position. [R1]dis cu [R1]dis current-configuration [V200R003C00]

 

sysname R1

 

snmp-agent local-engineid 800007DB03000000000000 snmp-agent

 

clock timezone China-Standard-Time minus 08:00:00

 

portal local-server load portalpage.zip

 

drop illegal-mac alarm

 

set cpu-usage threshold 80 restore 75

 

dhcp enable

 

aaa authentication-scheme default authorization-scheme default accounting-scheme default domain default domain default_admin local-user admin password cipher % % K8m.Nt84DZ}e#<0`8bmE3Uw}% %

[R1]ret sve sa save The current configuration will be written to the device. Are you sure to continue? (y/n)[n]:y It will take several minutes to save configuration file, please wait… Configuration file had been saved successfully Note: The configuration file will take effect after being activated

**

R2配置

** The device is running!

u t m Info: Current terminal monitor is off. sys Enter system view, return user view with Ctrl+Z. [Huawei]sysn [Huawei]sysname R2 [R2]

Please check whether system data has been changed, and save data in time

Configuration console time out, please press any key to log on

utm ^ Error: Unrecognized command found at ‘^’ position. u t m Info: Current terminal monitor is off. sys Enter system view, return user view with Ctrl+Z. [R2]int g0/0/0 [R2-GigabitEthernet0/0/0]ip add 12.0.0.2 24 [R2-GigabitEthernet0/0/0]un sh Info: Interface GigabitEthernet0/0/0 is not shutdown. [R2-GigabitEthernet0/0/0]q [R2]dh [R2]dhcp e [R2]dhcp enable Info: The operation may take a few seconds. Please wait for a moment.done. [R2]int g0/0/1 [R2-GigabitEthernet0/0/1]ip add 15.0.0.1 24 [R2-GigabitEthernet0/0/1]dh [R2-GigabitEthernet0/0/1]dhcp s [R2-GigabitEthernet0/0/1]dhcp select r [R2-GigabitEthernet0/0/1]dhcp select relay [R2-GigabitEthernet0/0/1]dh [R2-GigabitEthernet0/0/1]dhcp r [R2-GigabitEthernet0/0/1]dhcp relay s [R2-GigabitEthernet0/0/1]dhcp relay server-ip 14.0.0.2 [R2-GigabitEthernet0/0/1]un sh Info: Interface GigabitEthernet0/0/1 is not shutdown. [R2-GigabitEthernet0/0/1]dis th [R2-GigabitEthernet0/0/1]dis th [V200R003C00]

 

interface GigabitEthernet0/0/1 ip address 15.0.0.1 255.255.255.0 dhcp select relay dhcp relay server-ip 14.0.0.2

 

return [R2-GigabitEthernet0/0/1] [R2-GigabitEthernet0/0/1]q [R2]ip ro [R2]ip route-static 0.0.0.0 0.0.0.0 12.0.0.1 [R2]

Please check whether system data has been changed, and save data in time

Configuration console time out, please press any key to log on

sys Enter system view, return user view with Ctrl+Z. [R2]dis ip ro Route Flags: R - relay, D - download to fib

Routing Tables: Public Destinations : 11 Routes : 11

Destination/Mask Proto Pre Cost Flags NextHop Interface

0.0.0.0/0   Static  60   0          RD   12.0.0.1        GigabitEthernet

0/0/0 12.0.0.0/24 Direct 0 0 D 12.0.0.2 GigabitEthernet 0/0/0 12.0.0.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 12.0.0.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 15.0.0.0/24 Direct 0 0 D 15.0.0.1 GigabitEthernet 0/0/1 15.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 15.0.0.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

[R2]dis ip int b *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 3 The number of interface that is DOWN in Physical is 1 The number of interface that is UP in Protocol is 3 The number of interface that is DOWN in Protocol is 1

Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 12.0.0.2/24 up up GigabitEthernet0/0/1 15.0.0.1/24 up up GigabitEthernet0/0/2 unassigned down down NULL0 unassigned up up(s) [R2]ret sa save The current configuration will be written to the device. Are you sure to continue? (y/n)[n]:y It will take several minutes to save configuration file, please wait… Configuration file had been saved successfully Note: The configuration file will take effect after being activated

**

R3 配置

** The device is running!

U T M Info: Current terminal monitor is off. sys Enter system view, return user view with Ctrl+Z. [Huawei]sysn [Huawei]sysname R3 [R3]dh [R3]dhcp en [R3]dhcp enable Info: The operation may take a few seconds. Please wait for a moment.done. [R3]int g0/0/0 [R3-GigabitEthernet0/0/0]ip add 14.0.0.2 24 [R3-GigabitEthernet0/0/0]d [R3-GigabitEthernet0/0/0]dh [R3-GigabitEthernet0/0/0]dhcp sel [R3-GigabitEthernet0/0/0]dhcp select g [R3-GigabitEthernet0/0/0]dhcp select global [R3-GigabitEthernet0/0/0]un sh Info: Interface GigabitEthernet0/0/0 is not shutdown. [R3-GigabitEthernet0/0/0]q [R3]ip p [R3]ip pool d [R3]ip pool dh [R3]ip pool dhcp15 Info: It’s successful to create an IP address pool. [R3-ip-pool-dhcp15]net [R3-ip-pool-dhcp15]network 15.0.0.0 mask 24 [R3-ip-pool-dhcp15]ga [R3-ip-pool-dhcp15]gateway-list 15.0.0.1 [R3-ip-pool-dhcp15]dn [R3-ip-pool-dhcp15]dns-list 8.8.8.8 2.2.2.2 [R3-ip-pool-dhcp15]ex [R3-ip-pool-dhcp15]excluded-ip-address 15.0.0.100 15.0.0.254 [R3-ip-pool-dhcp15]sta [R3-ip-pool-dhcp15]static-bind ip [R3-ip-pool-dhcp15]static-bind ip-address 15.0.0.88 ma [R3-ip-pool-dhcp15]static-bind ip-address 15.0.0.88 mac-address 5489-9877-80A D [R3-ip-pool-dhcp15]q [R3]ip pooldh [R3]ip pool dh [R3]ip pool dhcpvlan10 Info: It’s successful to create an IP address pool. [R3-ip-pool-dhcpvlan10]net [R3-ip-pool-dhcpvlan10]netw [R3-ip-pool-dhcpvlan10]network 192.168.10.0 mask 24 [R3-ip-pool-dhcpvlan10]g [R3-ip-pool-dhcpvlan10]gateway-list 192.168.10.1 [R3-ip-pool-dhcpvlan10]d [R3-ip-pool-dhcpvlan10]dn [R3-ip-pool-dhcpvlan10]dns-list 8.8.8.8 2.2.2.2 [R3-ip-pool-dhcpvlan10]q [R3]ip pool dhcpvlan20 Info: It’s successful to create an IP address pool. [R3-ip-pool-dhcpvlan20]nnetw [R3-ip-pool-dhcpvlan20]netw [R3-ip-pool-dhcpvlan20]network 192.168.20.0 mask 24 [R3-ip-pool-dhcpvlan20]ga [R3-ip-pool-dhcpvlan20]gateway-list 192.168.20.1 [R3-ip-pool-dhcpvlan20]dns [R3-ip-pool-dhcpvlan20]dns-list 8.8.8.8 [R3-ip-pool-dhcpvlan20]q [R3]ip ro [R3]ip route- [R3]ip route-static 0.0.0.0 0.0.0.0 14.0.0.1 [R3]

Please check whether system data has been changed, and save data in time

Configuration console time out, please press any key to log on

sys Enter system view, return user view with Ctrl+Z. [R3]dis cu [R3]dis current-configuration [V200R003C00]

 

sysname R3

 

snmp-agent local-engineid 800007DB03000000000000 snmp-agent

 

clock timezone China-Standard-Time minus 08:00:00

 

portal local-server load portalpage.zip

 

drop illegal-mac alarm

 

set cpu-usage threshold 80 restore 75

 

dhcp enable

 

ip pool dhcp15 gateway-list 15.0.0.1 network 15.0.0.0 mask 255.255.255.0 static-bind ip-address 15.0.0.88 mac-address 5489-9877-80ad excluded-ip-address 15.0.0.100 15.0.0.254 dns-list 8.8.8.8 2.2.2.2

 

[R3]ret save The current configuration will be written to the device. Are you sure to continue? (y/n)[n]:y It will take several minutes to save configuration file, please wait… Configuration file had been saved successfully

标签:
来源:

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有