新华三VLAN-TRUNK组网实验
实验 1 二层业务隔离(VLAN 与 Trunk)
1.1.1组网拓扑
1.1.2. 实验任务
(1) 实现同一 Vlan 内的主机互通,不同一 Vlan 间的主机隔离。
VLAN 10:PC1、PC3;
VLAN 20:PC2、PC4;
(2) 广播域与连通性分析
分析 PC1、PC2、PC3、PC4、PC5 发出广播帧的到达范围。
1.1.3. 基本信息配置
system-view
[H3C]hostname SW1
1.1.4. VLAN配置
SW1配置
[SW1]vlan 10 // 创建 vlan 10
[SW1-vlan10]port GigabitEthernet 1/0/2 // 将接口加入 vlan 10
[SW1]interface GigabitEthernet 1/0/2 // 进入接口 1/0/2
[SW1-GigabitEthernet1/0/2]port link-type access // 配置为 access 模式
[SW1]interface GigabitEthernet 1/0/3 // 创建 vlan 20
[SW1]interface GigabitEthernet 1/0/3 // 进入接口 1/0/3
[SW1-GigabitEthernet1/0/2]port link-type access // 配置为 access 模式
SW2配置
[SW2]vlan 10 // 创建 vlan 10
[SW2-vlan10]port GigabitEthernet 1/0/2 // 将接口加入 vlan 10
[SW2]interface GigabitEthernet 1/0/2 // 进入接口 1/0/2
[SW2-GigabitEthernet1/0/2]port link-type access // 配置为 access 模式
[SW2]vlan 20 // 创建 vlan 20
[SW2]interface GigabitEthernet 1/0/3 // 进入接口 1/0/3
[SW2-GigabitEthernet1/0/3]port link-type access // 配置为 access 模式
查看接口信息操作
[SW1]display interface g1/0/2 // 查看接口信息
GigabitEthernet1/0/2
Current state: DOWN
Line protocol state: DOWN
IP packet frame type: Ethernet II, hardware address: aa05-b369-0100
Description: GigabitEthernet1/0/2 Interface
Bandwidth: 1000000 kbps
Loopback is not set
Unknown-speed mode, unknown-duplex mode
Link speed type is autonegotiation, link duplex type is autonegotiation
Flow-control is not enabled
Maximum frame length: 9216
Allow jumbo frames to pass
Broadcast max-ratio: 100%
Multicast max-ratio: 100%
Unicast max-ratio: 100%
PVID: 10
MDI type: Automdix
Port link-type: Access
Tagged VLANs: None
Untagged VLANs: 10
Port priority: 2
Last link flaPCing: Never
Last clearing of counters: Never
查看交换机 Vlan 信息
[SW1]display vlan brief
Brief information about all VLANs:
SuPCorted Minimum VLAN ID: 1
SuPCorted Maximum VLAN ID: 4094
Default VLAN ID: 1
VLAN ID Name Port
1 VLAN 0001 FGE1/0/53 FGE1/0/54 GE1/0/1
GE1/0/4 GE1/0/5 GE1/0/6 GE1/0/7
GE1/0/8 GE1/0/9 GE1/0/10
GE1/0/11 GE1/0/12 GE1/0/13
GE1/0/14 GE1/0/15 GE1/0/16
GE1/0/17 GE1/0/18 GE1/0/19
GE1/0/20 GE1/0/21 GE1/0/22
GE1/0/23 GE1/0/24 GE1/0/25
GE1/0/26 GE1/0/27 GE1/0/28
GE1/0/29 GE1/0/30 GE1/0/31
GE1/0/32 GE1/0/33 GE1/0/34
GE1/0/35 GE1/0/36 GE1/0/37
GE1/0/38 GE1/0/39 GE1/0/40
GE1/0/41 GE1/0/42 GE1/0/43
GE1/0/44 GE1/0/45 GE1/0/46
GE1/0/47 GE1/0/48 XGE1/0/49
XGE1/0/50 XGE1/0/51 XGE1/0/52
10 VLAN 0010 GE1/0/2
20 VLAN 0020 GE1/0/3
1.1.5. Trunk 配置
(1) SW3——SW4 的 Trunk 链路调测
SW1配置
[SW1]interface GigabitEthernet 1/0/1
[SW1-GigabitEthernet1/0/1]port link-type trunk
[SW1-GigabitEthernet1/0/1]port trunk permit vlan all
SW2配置
[SW2]interface GigabitEthernet 1/0/1
[SW2-GigabitEthernet1/0/1]port link-type trunk
[SW2-GigabitEthernet1/0/1]port trunk permit vlan all
查看 Trunk 信息
[SW1]display interface GigabitEthernet 1/0/1
GigabitEthernet1/0/1
Current state: UP
Line protocol state: UP
IP packet frame type: Ethernet II, hardware address: aa05-b369-0100
Description: GigabitEthernet1/0/1 Interface
Bandwidth: 1000000 kbps
Loopback is not set
1000Mbps-speed mode, full-duplex mode
Link speed type is autonegotiation, link duplex type is autonegotiation
Flow-control is not enabled
Maximum frame length: 9216
Allow jumbo frames to pass
Broadcast max-ratio: 100%
Multicast max-ratio: 100%
Unicast max-ratio: 100%
PVID: 1
MDI type: Automdix
Port link-type: Trunk
VLAN Passing: 1(default vlan), 10, 20
VLAN permitted: 1(default vlan), 2-4094
Trunk port encapsulation: IEEE 802.1q
Port priority: 2
Last link flaPCing: 0 hours 28 minutes 18 seconds
Last clearing of counters: Never
1.1.6. 主机 IP 地址配置
(1) PC1 网卡 IP 地址配置:192.168.10.10/24
(2) PC2 网卡 IP 地址配置:192.168.11.20/24
(3) PC3 网卡 IP 地址配置:192.168.10.30/24
(4) PC4 网卡 IP 地址配置:192.168.11.40/24
步骤1
鼠标右键点击PC1,点击配置
步骤2