提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
前言
当企业的内部网络规模较大时,通常被划分为多个不同的子网,网络内配置了 VLAN,VLAN能隔离广播,而DHCP协议使用广播
一、实验中继原理
二、操作流程
2. 1.二层交换机
LSW2]undo info
[LSW2]undo info-center en
[LSW2]undo info-center enable
Info: Information center is disabled.
[LSW2]vlan batch 10 20 192
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW2]int e0/0/1
[LSW2-Ethernet0/0/1]p l a
[LSW2-Ethernet0/0/1]p d v 10
[LSW2-Ethernet0/0/1]int e0/0/2
[LSW2-Ethernet0/0/2]p l a
[LSW2-Ethernet0/0/2]p d v 20
[LSW2-Ethernet0/0/2]int e0/0/4
[LSW2-Ethernet0/0/4]p l a
[LSW2-Ethernet0/0/4]p d v 192
[LSW2-Ethernet0/0/4]int e0/0/3
[LSW2-Ethernet0/0/3]p l t
[LSW2-Ethernet0/0/3]p t a v a
2.2三层交换机
代码如下:
[RW1]undo info
[RW1]undo info-center en
[RW1]undo info-center enable
Info: Information center is disabled.
[RW1]vlan batch 10 20 192
Info: This operation may take a few seconds. Please wait for a moment...done.
[RW1]int vlanif 10
[RW1-Vlanif10]ip add 192.168.10.1 24
[RW1-Vlanif10]int vlanif 20
[RW1-Vlanif20]ip add 192.168.20.1 24
[RW1-Vlanif20]int vlanif 192
[RW1-Vlanif192]ip add 192.168.192.1 24
[RW1-Vlanif192]int e0/0/1
^
Error: Unrecognized command found at '^' position.
[RW1-Vlanif192]int g0/0/1
[RW1-GigabitEthernet0/0/1]p l t
[RW1-GigabitEthernet0/0/1]p t a v a
[RW1-GigabitEthernet0/0/1]q
[RW1]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[RW1]int vlanif 10
[RW1-Vlanif10]dhcp select relay
[RW1-Vlanif10]int vlanif 20
[RW1-Vlanif20]dhcp select relay
[RW1-Vlanif20]
2.3配置地址池
2.4重启网络服务和查看端口已开启
2.5增加网卡ens37的网关