思科模拟器-实验 17 三层交换 DHCP 的配置

【实验内容】
(1)按实验线路连接图进行连接。DHCP客户机设置IP地址为自动获取。
思科模拟器-实验 17 三层交换 DHCP 的配置_第1张图片

(2)按照实验线路连接图,在SW1和SW2上分别完成VLAN配置,并在VLAN中添加 相应的端口成员,同时配置Trunk端口。

Switch>en
Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#exit
Switch(config)#interface Fa0/1
Switch(config-if)#switchport access vlan 10
Switch(config-if)#exit
Switch(config)#interface Fa0/2 
Switch(config-if)#switchport access vlan 20
Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console

Switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface Fa0/24
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 10,20
Switch(config-if)#exit
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console

(3)在L3Switch上创建VLAN10和VLAN20,并配置VLAN10的虚接口IP地址为 192.168.10.1,配置VLAN20的虚接口IP地址为192.168.20.1,配置F0/1和F0/2为 Trunk端口,并在L3Switch上使用show ip route命令查看192.168.10.0/24和 192.168.20.0/24网络的直连路由。

Switch>en
Switch#config t
Switch(config)#hostname L3switch
L3switch(config)#vlan 10
L3switch(config-vlan)#vlan 20
L3switch(config-vlan)#exit
L3switch(config)#interface range fastEthernet 0/12
L3switch(config-if-range)#switchport trunk encapsulation dot1q
L3switch(config-if-range)#switchport mode trunk
L3switch(config-if-range)#exit
L3switch(config)#interface vlan 10
L3switch(config-if)#
%LINK-5-CHANGED: Interface Vlan10, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

L3switch(config-if)#ip address 192.168.10.1 255.255.255.0
L3switch(config-if)#no shutdown
L3switch(config-if)#exit
L3switch(config)#interface vlan 20
L3switch(config-if)#
%LINK-5-CHANGED: Interface Vlan20, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

L3switch(config-if)#ip address 192.168.20.1 255.255.255.0
L3switch(config-if)#no shutdown
L3switch(config-if)#exit
L3switch(config)#ip dhcp excluded-address 192.168.10.1 192.168.10.10
L3switch(config)#ip dhcp excluded-address 192.168.20.1 192.168.20.10
L3switch#show ip route

思科模拟器-实验 17 三层交换 DHCP 的配置_第2张图片

(4) 按照实验线路连接图所示,创建DHCP地址池vlan10pool和vlan20pool,同时配 置相应的排除IP地址、网络ID和网关地址。

L3switch(config)#ip dhcp pool vlan10pool
L3switch(dhcp-config)#network 192.168.10.0 255.255.255.0
L3switch(dhcp-config)#default-router 192.168.10.1
L3switch(dhcp-config)#exit
L3switch(config)#ip dhcp pool vlan20pool
L3switch(dhcp-config)#network 192.168.20.0 255.255.255.0
L3switch(dhcp-config)#default-router 192.168.20.1
L3switch(dhcp-config)#exit
L3switch(config)#exit
L3switch#
%SYS-5-CONFIG_I: Configured from console by console

L3switch#
L3switch#config t
Enter configuration commands, one per line.  End with CNTL/Z.
L3switch(config)#ip routing
L3switch(config)#exit
L3switch#
%SYS-5-CONFIG_I: Configured from console by console
L3switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
  as VLAN database mode is being deprecated. Please consult user
  documentation for configuring VTP/VLAN in config mode.
L3switch(vlan)#vlan 10 name VLAN10
VLAN 10 modified:
    Name: VLAN10
L3switch(vlan)#vlan 20 name VLAN20
VLAN 20 modified:
    Name: VLAN20
L3switch(vlan)#

(5) 完成以上配置内容后,在DHCP客户机命令行下使用ipconfig/all命令查看是否 获得IP地址等网络参数。并各台计算机之间相互ping通。
思科模拟器-实验 17 三层交换 DHCP 的配置_第3张图片
在这里插入图片描述
(6)在L3Switch上上使用show ip dhcp binding查看IP地址分配情况。

思科模拟器-实验 17 三层交换 DHCP 的配置_第4张图片

你可能感兴趣的:(思科模拟器)