Access+Trunk 配置

实验拓扑

实验需求

  1. 按图示给各 PC 配置 IP 地址
  2. 在SW1和SW2上创建聚合组
  3. PC1 与 PC3 属于 VLAN 10 ; PC2 与 PC4 属于 VLAN 20
  4. 利用 Access 与 Trunk 端口属性,解决同 VLAN 的 PC 能够互通,不同 VLAN 的 PC 无法互通

实验步骤

1. 在SW1创建聚合组,设置为Trunk类型

[SW1]int Eth-Trunk 12
[SW1-Eth-Trunk12]trunkport Ethernet 0/0/1 to 0/0/3
[SW1-Eth-Trunk12]port trunk allow-pass vlan all

2. 在SW2创建聚合组,设置为Trunk类型

[SW2]int Eth-Trunk 12
[SW2-Eth-Trunk12]trunkport Ethernet 0/0/1 to 0/0/3
[SW2-Eth-Trunk12]port trunk allow-pass vlan all

3. 在SW2上查看聚合组

[SW2-Eth-Trunk12]dis eth-trunk 12
Eth-Trunk12's state information is:
WorkingMode: NORMAL         Hash arithmetic: According to SIP-XOR-DIP         
Least Active-linknumber: 1  Max Bandwidth-affected-linknumber: 8              
Operate status: up          Number Of Up Port In Trunk: 3                     
--------------------------------------------------------------------------------
PortName                      Status      Weight 
Ethernet0/0/1                 Up          1      
Ethernet0/0/2                 Up          1      
Ethernet0/0/3                 Up          1  

4. SW1 上划分VLAN 10 设置为Access 端口

 [SW1]vlan batch 10 20
 [SW1]int e0/0/4
 [SW1-Ethernet0/0/4]port link-type access
 [SW1-Ethernet0/0/4]port default vlan 10
 
[SW1]int e0/0/5
[SW1-Ethernet0/0/5]port link-type access 
 [SW1-Ethernet0/5]port default vlan 20

5. SW2 上划分VLAN 20 30 ,设置为Access端口

[SW2]VLAN 20
[SW2]int e0/0/4
[SW2-Ethernet0/0/4]port link-type access
[SW2-Ethernet0/0/4]port default vlan 20

6. PC2 PING PC3 在相同VLAN 可以互通

PC>ping 192.168.1.4

Ping 192.168.1.4: 32 data bytes, Press Ctrl_C to break
From 192.168.1.4: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.1.4: bytes=32 seq=2 ttl=128 time=47 ms
From 192.168.1.4: bytes=32 seq=3 ttl=128 time=62 ms
From 192.168.1.4: bytes=32 seq=4 ttl=128 time=63 ms
From 192.168.1.4: bytes=32 seq=5 ttl=128 time=62 ms

--- 192.168.1.4 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 47/62/78 ms

7. PC1 PING PC2,不同VLAN 不能通信

PC>ping 192.168.1.3

Ping 192.168.1.3: 32 data bytes, Press Ctrl_C to break
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable
From 192.168.1.1: Destination host unreachable

--- 192.168.1.3 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss
posted @ 2019-07-18 13:17  我是C  阅读(935)  评论(0编辑  收藏  举报