实验拓扑图

实验环境
R4作为DHCP服务器,R1,R2上做中继服务,实现不同网段的pc获取地址
1,配置sw交换机
<Huawei>sys ##进入系统视图模式
[Huawei]sysname SW1 ##修改名字
[SW1]vlan bat 10 20 ##创建vlan10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int e0/0/1 ##进接口
[SW1-Ethernet0/0/1]port link-type access ##配置为access口
[SW1-Ethernet0/0/1]port default vlan 10 ##将接口放到vlan10中
[SW1-Ethernet0/0/1]un sh ##开启
[SW1-Ethernet0/0/1]int e0/0/2 ##e0/0/2接口
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 20 ##放到vlan20中
[SW1-Ethernet0/0/2]un sh
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]port link-type access
[SW1-Ethernet0/0/3]port default vlan 10
[SW1-Ethernet0/0/3]un sh
[SW1-Ethernet0/0/3]int e0/0/4
[SW1-Ethernet0/0/4]port link-type access
[SW1-Ethernet0/0/4]port default vlan 20
[SW1-Ethernet0/0/4]un sh
[SW1-Ethernet0/0/4]dis vlan ##查看vlan信息
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up; D: Down; TG: Tagged; UT: Untagged;
MP: Vlan-mapping; ST: Vlan-stacking;
#: ProtocolTransparent-vlan; *: Management-vlan;
--------------------------------------------------------------------------------
VID Type Ports