Q1:PC不能正常PING通,PC端口处于down状态
HCL模拟器实现交换机DHCP配置案例
配置步骤
(1)将交换机的名字修改为SW1
(2)在交换机分别创建VLAN 10、VLAN 20
(3)VLAN 10的IP设置为:192.168.10.1 255.255.255.0
(4)VLAN 20的IP设置为:192.168.20.1 255.255.255.0
(5)将F0/1端口划分到VLAN 10
(6)将F0/2端口划分到VLAN 20
(7)开启DHCP功能
(8)分别创建两个地址池,分配子网、默认网关、DNS
(9)PC_2和PC_3都能通过DHCP自动获取IP地址
配置关键点
将交换机的名字修改为SW1:
system-view
System View: return to User View with Ctrl+Z.
[h3c]sysname sw1
#创建vlan
[sw1]vlan 10
[sw1-vlan10]vlan 20
[sw1-vlan20]quit
[sw1]dis vlan brief
#给vlan 设置IP地址
[sw1]int vlan 10
[sw1-Vlan-interface10]ip address 192.168.10.1 24
[sw1-Vlan-interface10]quit
[sw1]int vlan 20
[sw1-Vlan-interface20]ip address 192.168.20.1 24
[sw1-Vlan-interface20]quit
#端口划分到vlan 10 vlan 20
[sw1]int GigabitEthernet 1/0/2
[sw1-GigabitEthernet1/0/2]port link-type access
[sw1-GigabitEthernet1/0/2]port access vlan 10
[sw1-GigabitEthernet1/0/2]quit
[sw1]int GigabitEthernet 1/0/3
[sw1-GigabitEthernet1/0/3]port link-type access
[sw1-GigabitEthernet1/0/3]port access vlan 20
[sw1-GigabitEthernet1/0/3]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 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
[sw1]save
转载此文是出于传递更多信息目的。若来源标注错误或侵犯了您的合法权益,请与本站联系,我们将及时更正、删除、谢谢。
https://www.414w.com/read/740124.html