第一次作业
修改PC获取IP方式为DHCPPC1到PC6配置相同:交换机配置分析拓扑图得知,vlan2单独为一个网段,设置为access口,而其他局域网为一个网段,但又因为具有多个vlan所以采取hybird口。又因为路由器子接口可以接收带标签的数据帧,而物理接口不能接收带标签的数据帧且在路由器与交换机连接的那个接口需要通过多个vlan的数据流,故将其PVID设置为vlan1。

修改PC获取IP方式为DHCP
PC1到PC6配置相同:

交换机配置
分析拓扑图得知,vlan2单独为一个网段,设置为access口,而其他局域网为一个网段,但又因为具有多个vlan所以采取hybird口。又因为路由器子接口可以接收带标签的数据帧,而物理接口不能接收带标签的数据帧且在路由器与交换机连接的那个接口需要通过多个vlan的数据流,故将其PVID设置为vlan1。(vlan1默认斯标签发送)

配置
LSW1:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW1
[LSW1]vlan batch 2 to 6
Info: This operation may take a few seconds. Please wait for a moment...done.
May 17 2024 22:41:30-08:00 LSW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 5, the
change loop count is 0, and the maximum number of records is 4095.
[LSW1]int GigabitEthernet 0/0/1
[LSW1-GigabitEthernet0/0/1]port link-type access
[LSW1-GigabitEthernet0/0/1]port default vlan 2
[LSW1-GigabitEthernet0/0/1]
May 17 2024 22:41:50-08:00 LSW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 7, the
change loop count is 0, and the maximum number of records is 4095.
[LSW1-GigabitEthernet0/0/1]int g0/0/2
[LSW1-GigabitEthernet0/0/2]port hybrid pvid vlan 3
[LSW1-GigabitEthernet0/0/2]
May 17 2024 22:42:20-08:00 LSW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 8, the
change loop count is 0, and the maximum number of records is 4095.
[LSW1-GigabitEthernet0/0/2]port hybrid untagged vlan 3 to 6
May 17 2024 22:42:50-08:00 LSW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 9, the
change loop count is 0, and the maximum number of records is 4095.
[LSW1-GigabitEthernet0/0/2]int g0/0/3
[LSW1-GigabitEthernet0/0/3]port link-type trunk
May 17 2024 22:43:10-08:00 LSW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.
[LSW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 6
[LSW1-GigabitEthernet0/0/3]int g0/0/4
[LSW1-GigabitEthernet0/0/4]
May 17 2024 22:43:40-08:00 LSW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 11, the
change loop count is 0, and the maximum number of records is 4095.
[LSW1-GigabitEthernet0/0/4]port hybrid pvid vlan 1
May 17 2024 22:44:00-08:00 LSW1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 12, the
change loop count is 0, and the maximum number of records is 4095.
[LSW1-GigabitEthernet0/0/4]port hybrid untagged vlan 3 to 6
LSW2:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW2
[LSW2]vlan batch 2 to 6
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW2]int g0/0/1
May 17 2024 22:47:59-08:00 LSW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 6, the
change loop count is 0, and the maximum number of records is 4095.
[LSW2-GigabitEthernet0/0/1]port link-type access
[LSW2-GigabitEthernet0/0/1]port default vlan 2
[LSW2-GigabitEthernet0/0/1]int g0/0/2
May 17 2024 22:48:20-08:00 LSW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 7, the
change loop count is 0, and the maximum number of records is 4095.
[LSW2-GigabitEthernet0/0/2]port hybrid pvid vlan 4
May 17 2024 22:48:40-08:00 LSW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 8, the
change loop count is 0, and the maximum number of records is 4095.
[LSW2-GigabitEthernet0/0/2]port hybrid untagged vlan 3 to 6
[LSW2-GigabitEthernet0/0/2]int g0/0/3
[LSW2-GigabitEthernet0/0/3]
May 17 2024 22:48:50-08:00 LSW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 9, the
change loop count is 0, and the maximum number of records is 4095.
[LSW2-GigabitEthernet0/0/3]port link-type trunk
[LSW2-GigabitEthernet0/0/3]
May 17 2024 22:49:00-08:00 LSW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.
[LSW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 to 6
May 17 2024 22:49:20-08:00 LSW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 11, the
change loop count is 0, and the maximum number of records is 4095.
[LSW2-GigabitEthernet0/0/3]int g0/0/4
[LSW2-GigabitEthernet0/0/4]port link-type trunk
May 17 2024 22:49:40-08:00 LSW2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 12, the
change loop count is 0, and the maximum number of records is 4095.6
[LSW2-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 to 6
LSW3:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname LSW3
May 17 2024 22:51:51-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 4, the
change loop count is 0, and the maximum number of records is 4095.
[LSW3]vlan batch 2 to 6
Info: This operation may take a few seconds. Please wait for a moment...done.
May 17 2024 22:52:01-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 5, the
change loop count is 0, and the maximum number of records is 4095.
[LSW3]int GigabitEthernet 0/0/1
[LSW3-GigabitEthernet0/0/1]port hybrid pvid vlan 5
May 17 2024 22:52:31-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 6, the
change loop count is 0, and the maximum number of records is 4095.
[LSW3-GigabitEthernet0/0/1]port hybrid untagged vlan 3 to 5
[LSW3-GigabitEthernet0/0/1]int g0/0/2
May 17 2024 22:52:41-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 7, the
change loop count is 0, and the maximum number of records is 4095.
[LSW3-GigabitEthernet0/0/2]port hybrid pvid vlan 6
May 17 2024 22:53:01-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 8, the
change loop count is 0, and the maximum number of records is 4095.
[LSW3-GigabitEthernet0/0/2]port hybrid untagged vlan 3 4 6
[LSW3-GigabitEthernet0/0/2]
May 17 2024 22:53:11-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 9, the
change loop count is 0, and the maximum number of records is 4095.
[LSW3-GigabitEthernet0/0/2]int g0/0/4
[LSW3-GigabitEthernet0/0/4]port link-type trunk
May 17 2024 22:53:32-08:00 LSW3 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.2
5.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.
[LSW3-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 to 6
因为路由器需要通过vlan2的数据帧,故在LSW1上加一条:
[LSW1]int g0/0/4
[LSW1-GigabitEthernet0/0/4]port hybrid tagged vlan 2
查看
LSW1:

LSW2:

LSW3:

路由器配置:
DHCP配置:
因为6个vlan,两个网段,一个子接口只能配置一个vlan,故将该子接口用于接管vlan2,其余的使用物理口接管。
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[R1-GigabitEthernet0/0/0]int g0/0/0.1
[R1-GigabitEthernet0/0/0.1]ip add 192.168.2.1 24
[R1-GigabitEthernet0/0/0.1]dot1q termination vid 2
May 17 2024 23:01:33-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0.1 has entered the UP state.
[R1-GigabitEthernet0/0/0.1]arp broadcast enable
[R1-GigabitEthernet0/0/0.1]q
[R1]dis ip int b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 3
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/24 up up
GigabitEthernet0/0/0.1 192.168.2.1/24 up down
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
[R1]
[R1]dhcp enable
[R1]ip pool a
[R1-ip-pool-a]network 192.168.1.0 mask 24
[R1-ip-pool-a]gateway-list 192.168.1.1
[R1-ip-pool-a]dns-list 8.8.8.8
[R1-ip-pool-a]q
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]dhcp select global
[R1-GigabitEthernet0/0/0]q
[R1]ip pool b
[R1-ip-pool-b]network 192.168.2.0 mask 24
[R1-ip-pool-b]gateway-list 192.168.2.1
[R1-ip-pool-b]dns-list 8.8.8.8
[R1-ip-pool-b]q
[R1]int g0/0/0.1
[R1-GigabitEthernet0/0/0.1]dhcp select global
查询
PC1:

PC2:

PC3:

PC4:

PC5:

PC6:

网络测试
PC2访问PC4/5/6:



PC4访问PC6:

PC5访问PC6:

PC1访问PC2/4/5/6




PC3访问PC2/4/5/6:




DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐

所有评论(0)