關於單個交換機的VLAN的搭建
一: 實現的目標
1. 瞭解VLAN的含義及用途。
VLAN是覆蓋面積相對狹小的幾臺計算機和設備相連的的網絡。
VLAN 可以隔離廣播域,實現部分網絡的安全。如:銷售部和財務部之間劃分VLAN可以實現銷售部不能直接訪問財務部的內部網絡,從而實現兩個部門的安全性。
VLAN 方便管理,有利於以後網絡拓撲的變化。
2. VLAN的配置
3. VLAN的管理
4. VLAN的應用
二.單個交換機劃分VLAN拓撲結構
三.實驗過程
1.使用平行線連接交換機和pc。
2. 配置pc的ip地址
PC IP 接口
Pc0 192.168.1.2 fa0/1
Pc1 192.168.1.3 fa0/2
Pc2 192.168.1.4 fa0/3
Pc3 192.168.1.5 fa0/4
Pc4 192.168.1.6 fa0/5
Pc5 192.168.1.7 fa0/6
Pc6 192.168.1.8 fa0/7
3.在交換機上配置VLAN
1.建立VLAN
Switch # vlan database
Switch<vlan>#vlan 2 name xiaoshuo
Switch<vlan>#vlan 3 name gongguan
Switch<vlan>#vlan 4 name caiwu
Switch<vlan>#end
2.pc加入vlan
Switch#conf t
Switch<config>#int fa0/1
Switch<config-if>#switchport access vlan 2
Switch<config>#int fa0/2
Switch <config-if>#switchport access vlan2
Switch<config-if>#end
Switch#conf t
Switch<config>#int fa0/3
Switch <config-if>#switchport access vlan3
Switch<config-if>#end
Switch#conf t
Switch<config>#int fa0/4
Switch <config-if>#switchport access vlan3
Switch<config-if>#end
Switch#conf t
Switch<config>#int fa0/5
Switch <config-if>#switchport access vlan4
Switch<config-if>#end
Switch#conf t
Switch<config>#int fa0/6
Switch <config-if>#switchport access vlan4
Switch<config-if>#end
Switch#conf t
Switch<config>#int fa0/7
Switch <config-if>#switchport access vlan4
Switch<config-if>#end
3.檢測pc0和pc2之間的ping是否通信
Vlan2與vlan2之間能否通信
Reply from 192.168.1.3: bytes=32 time=90ms TTL=128
Reply from 192.168.1.3: bytes=32 time=40ms TTL=128
Reply from 192.168.1.3: bytes=32 time=30ms TTL=128
Reply from 192.168.1.3: bytes=32 time=40ms TTL=128
Ping statistics for 192.168.1.3:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 30ms, Maximum = 90ms, Average = 50ms
,
Vlan2與vlan3之間能否通信
Pinging 192.168.1.4 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.1.4:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Vlan2與vlan4之間能否通信
PC>ping 192.168.1.6
Pinging 192.168.1.6 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.1.6:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
PC>
四.總結
1.VLAN可以隔離廣播域,保證子網內部的安全。
2.vlan 可以劃分與站點的位置無關,它可以是相當性質的站點的集合。
3.方便日後的管理。