H3C交换机配置DHCP
DHCP简介
DHCP(Dynamic Host Configuration Protocol,动态主机配置协议)用来为网络设备动态地分配IP地址等网络配置参数。
DHCP采用C/S通信模式,由客户端向服务器提出请求分配网络配置参数的申请,服务器返回为客户端分配的IP地址等配置信息,以实现IP地址等信息的动态配置。
实验拓扑
实验目标
1.网络中有两个vlan,vlan10,vlan20, DHCP Server服务器能够跨网段为vlan10、vlan20分配地址,PC1能够从DHCP服务器上获取192.168.10.0/24网段的地址,PC2能够从DHCP服务器上获取192.168.20.0/24网段的地址。
实验步骤
1.配置SW1
[H3C]sysname SW1
[SW1]vlan 10 20
[SW1]interface GigabitEthernet 1/0/2
[SW1-GigabitEthernet1/0/2]port access vlan 10
[SW1-GigabitEthernet1/0/2]interface GigabitEthernet 1/0/3
[SW1-GigabitEthernet1/0/3]port access vlan 20
[SW1-GigabitEthernet1/0/3]exit
[SW1]interface GigabitEthernet 1/0/1
[SW1-GigabitEthernet1/0/1]port link-type trunk
[SW1-GigabitEthernet1/0/1]port trunk permit vlan 10 20
[SW1]dhcp enable
2.配置 DHCP Relay
[H3C]sysname DHCP Relay
[DHCP Relay]dhcp enable
[DHCP Relay]vlan 10 20 30
[DHCP Relay]interface GigabitEthernet 1/0/1
[DHCP Relay-GigabitEthernet1/0/1]port link-type trunk
[DHCP Relay-GigabitEthernet1/0/1]port trunk permit vlan 10 20
[DHCP Relay-GigabitEthernet1/0/2]port access vlan 30
[DHCP Relay-GigabitEthernet1/0/2]exit
[DHCP Relay]interface Vlan-interface 30
[DHCP Relay-Vlan-interface30]ip address 10.1.23.2 24
[DHCP Relay]interface Vlan-interface 10
[DHCP Relay-Vlan-interface10]dhcp relay server-address 10.1.23.3
[DHCP Relay-Vlan-interface10]dhcp select relay
[DHCP Relay-Vlan-interface10]interface Vlan-interface 20
[DHCP Relay-Vlan-interface20]dhcp select relay
[DHCP Relay-Vlan-interface20]dhcp relay server-address 10.1.23.3
[DHCP Relay-Vlan-interface20]quit
3.配置DHCP Server
[DHCP Server]dhcp enable
[DHCP Server]vlan 10 20 30
[DHCP Server]interface Vlan-interface 30
[DHCP Server-Vlan-interface30]ip address 10.1.23.3 24
[DHCP Server]interface GigabitEthernet 1/0/1
[DHCP Server-GigabitEthernet1/0/1]port access vlan 30
[DHCP Server]dhcp server ip-pool vlan10
[DHCP Server-dhcp-pool-vlan10]gateway-list 192.168.10.254
[DHCP Server-dhcp-pool-vlan10]network 192.168.10.0 24
[DHCP Server-dhcp-pool-vlan10]dns-list 114.114.114.114 8.8.8.8
[DHCP Server]dhcp server ip-pool vlan20
[DHCP Server-dhcp-pool-vlan20]gateway-list 192.168.20.254
[DHCP Server-dhcp-pool-vlan20]network 192.168.20.0 24
[DHCP Server-dhcp-pool-vlan20]dns-list 114.114.114.114 8.8.8.8
[DHCP Server]interface Vlan-interface 10
[DHCP Server-Vlan-interface10]dhcp server apply ip-pool vlan10
[DHCP Server-Vlan-interface10]interface Vlan-interface 20
[DHCP Server-Vlan-interface20]dhcp server apply ip-pool vlan20
[DHCP Server]ip route-static 0.0.0.0 0 10.1.23.2
实验结果
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/36018.html