本文共 1211 字,大约阅读时间需要 4 分钟。
实验目的:
1.DHCP自动分配地址
2.Vlan间通信
实验步骤:
- 在两台二层交换机上创建vlan【sw1vlan10 sw2vlan20】并将三个端口加入相应的vlan中[sw1]vlan 10[sw1-vlan10]q[sw1-GigabitEthernet0/0/1]undo shInfo: Interface GigabitEthernet0/0/1 is not shutdown.[sw1-Ethernet0/0/1]port link-type acc//选择access模式[sw1-Ethernet0/0/1]port def vlan 10 //加入vlan10其他端口同理【sw2上只是把vlan10换成vlan20】
- 配置三层交换机:创建vlan10、2将vlan10/20加入端口【access模式】配置vlanIP:[dhcp-Vlanif10]undo shInfo: Interface Vlanif10 is not shutdown.[dhcp-Vlanif10][dhcp-Vlanif10][dhcp-Vlanif10]ip add 192.168.10.254 255.255.255.0[dhcp-Vlanif20]ip add 192.168.20.254 255.255.255.0创建地址池:[dhcp]ip pool vlan-10Info:It's successful to create an IP address pool.[dhcp-ip-pool-vlan-10]network 192.168.10.0 mask 255.255.255.0[dhcp-ip-pool-vlan-10]gateway-list 192.168.10.254[dhcp]ip pool vlan-20Info:It's successful to create an IP address pool.[dhcp-ip-pool-vlan-20]network 192.168.20.0 mask 255.255.255.0[dhcp-ip-pool-vlan-20]gateway-list 192.168.20.254开启DHCP功能,端口开启DHCP全局:[dhcp]dhcp enable Info: The operation may take a few seconds. Please wait for a moment.done.[dhcp-Vlanif10]dhcp select global[dhcp-Vlanif20]dhcp select global配置完成3.验证、测试、保存实验拓扑图:
转载于:https://blog.51cto.com/13556999/2062411