大家伙,我用模拟器里面s5820 v2的交换机配dhcp server不生效,是不是没这个功能,或者打出命令步骤给我,好人一生平安!
如题
(0)
最佳答案
您好,请知:
以下是HCL模拟器内DHCP的配置案例,请参考:
https://zhiliao.h3c.com/theme/details/96485
将交换机的名字修改为SW1:
[H3C]sysname SW1
在交换机分别创建VLAN 10、VLAN 20:
[SW1]vlan 10
[SW1-vlan10]quit
[SW1]vlan 20
[SW1-vlan20]quit
VLAN 10的IP设置为:192.168.10.1 255.255.255.0:
[SW1]int vlan 10
[SW1-Vlan-interface10]ip address 192.168.10.1 24
[SW1-Vlan-interface10]quit
VLAN 20的IP设置为:192.168.20.1 255.255.255.0:
[SW1]int vlan 20
[SW1-Vlan-interface20]ip address 192.168.20.1 24
[SW1-Vlan-interface20]quit
将GI1/0/1端口划分到VLAN 10:
[SW1]int gi 1/0/1
[SW1-GigabitEthernet1/0/1]port link-type access
[SW1-GigabitEthernet1/0/1]port access vlan 10
[SW1-GigabitEthernet1/0/1]quit
将GI1/0/2端口划分到VLAN 20:
[SW1]int gi 1/0/2
[SW1-GigabitEthernet1/0/2]port link-type access
[SW1-GigabitEthernet1/0/2]port access vlan 20
[SW1-GigabitEthernet1/0/2]quit
开启DHCP功能:
[SW1]dhcp enable
创建DHCP地址池,命名为VLAN10,分配网段、子网掩码、默认网关、DNS:
[SW1]dhcp server ip-pool vlan10
[SW1-dhcp-pool-vlan10]network 192.168.10.0 mask 255.255.255.0
[SW1-dhcp-pool-vlan10]gateway-list 192.168.10.1
[SW1-dhcp-pool-vlan10]dns-list 114.114.114.114
[SW1-dhcp-pool-vlan10]quit
[SW1]
创建DHCP地址池,命名为VLAN20,分配网段、子网掩码、默认网关、DNS:
[SW1]dhcp server ip-pool vlan20
[SW1-dhcp-pool-vlan20]network 192.168.20.0 mask 255.255.255.0
[SW1-dhcp-pool-vlan20]gateway-list 192.168.20.1
[SW1-dhcp-pool-vlan20]dns-list 114.114.114.114
[SW1-dhcp-pool-vlan20]quit
(0)
您好,该设备开启DHCP服务的命令是dhcp enable命令。
(0)
开了,还是获取不到ip
功能确实支持,但是模拟器里面选择PC可能是获取不到的,不太稳定
[H3C] dhcp enable [H3C] dhcp server ip-pool 5 [H3C-dhcp-pool-5] network 192.168.5.0 mask 255.255.255.0 [H3C-dhcp-pool-5] dns-list 8.8.8.8 [H3C-dhcp-pool-5] gateway-list 192.168.5.254 [H3C-dhcp-pool-5] quit
居然可以了,dhcp server ip-pool 5和dhcp server ip-pool vlan5好像都可以,交换机是通过什么勾连vlan 5的
可以在接口下指定地址池的,进入接口dhcp server apply ip-pool pool-name
配置DHCP服务
# 开启DHCP服务。
<SwitchA> system-view
[SwitchA] dhcp enable
# 配置VLAN接口10和VLAN接口20工作在DHCP服务器模式。
[SwitchA] interface vlan-interface 10
[SwitchA-Vlan-interface10] dhcp select server
[SwitchA-Vlan-interface10] quit
[SwitchA] interface vlan-interface 20
[SwitchA-Vlan-interface20] dhcp select server
[SwitchA-Vlan-interface20] quit
# 配置不参与自动分配的IP地址(DNS服务器、WINS服务器和网关地址)。
[SwitchA] dhcp server forbidden-ip 10.1.1.2
[SwitchA] dhcp server forbidden-ip 10.1.1.4
[SwitchA] dhcp server forbidden-ip 10.1.1.126
[SwitchA] dhcp server forbidden-ip 10.1.1.254
# 配置DHCP地址池1,用来为10.1.1.0/25网段内的客户端分配IP地址和网络配置参数。
[SwitchA] dhcp server ip-pool 1
[SwitchA-dhcp-pool-1] network 10.1.1.0 mask 255.255.255.128
[SwitchA-dhcp-pool-1] expired day 10 hour 12
[SwitchA-dhcp-pool-1] domain-name ***.***
[SwitchA-dhcp-pool-1] dns-list 10.1.1.2
[SwitchA-dhcp-pool-1] gateway-list 10.1.1.126
[SwitchA-dhcp-pool-1] nbns-list 10.1.1.4
[SwitchA-dhcp-pool-1] quit
# 配置DHCP地址池2,用来为10.1.1.128/25网段内的客户端分配IP地址和网络配置参数。
[SwitchA] dhcp server ip-pool 2
[SwitchA-dhcp-pool-2] network 10.1.1.128 mask 255.255.255.128
[SwitchA-dhcp-pool-2] expired day 5
[SwitchA-dhcp-pool-2] domain-name ***.***
[SwitchA-dhcp-pool-2] dns-list 10.1.1.2
[SwitchA-dhcp-pool-2] gateway-list 10.1.1.254
[SwitchA-dhcp-pool-2] quit
(0)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
请问下交换机是根据什么将地址池跟vlan匹配的