VLAN 实验

一:实验要求

VLAN 实验_第1张图片

二:实验拓扑图

pc1和pc3在同一个网段,IP配置为:192.168.1.0

pc2/4/5/6在同一个网段,IP配置为:192.168.2.0

VLAN 实验_第2张图片

三:创建VLAN

 

 四:对R1配置DHCP服务

首先开启全局dhcp服务,然后在对每个接口开启dhcp服务

开启全局dhcp服务
dhcp enable

对接口g0/0/0配置IP并且启用,将他设置为vlan 3,4,5的服务器

VLAN 实验_第3张图片

 然后配置池子v2

VLAN 实验_第4张图片

 配置池子V3

VLAN 实验_第5张图片

结果是:

VLAN 实验_第6张图片 

设置子接口0/0/0.1来配置vlan2的服务器

VLAN 实验_第7张图片

 五:对交换机的配置

        LSW1

        接口e0/0/4为混杂接口,带v 2的标签,不带vlan 3 to 5的标签

     VLAN 实验_第8张图片

         接口e0/0/1为混杂接口模式,带有所有的标签

        VLAN 实验_第9张图片

        接口e0/0/2为接入模式因为要求配置为access接口,修改默认pvid为2。

        VLAN 实验_第10张图片

         接口e0/0/3为混杂模式,不允许所有vlan,pvid为4

        VLAN 实验_第11张图片

         结果是: 

VLAN 实验_第12张图片

      LSW2

        e0/0/1 为接口模式,允许vlan 2 to 5 的标签        

VLAN 实验_第13张图片

     e0/0/2 为混杂接口模式,允许vlan 2 to 5 的标签

VLAN 实验_第14张图片

 e0/0/3 为接入接口模式,pvid为2

VLAN 实验_第15张图片

         e0/0/4 为混杂接口模式,pvid为4,不允许带vlan 1 to 4 的标签

VLAN 实验_第16张图片

        结果是:

        VLAN 实验_第17张图片  

        LSW3

       e0/0/1 为混杂接口模式,允许带vlan2 to 5 所有标签

VLAN 实验_第18张图片

        e0/0/2 为混杂接口模式,pvid为4,不允许带vlan 2 to 4 标签

VLAN 实验_第19张图片

     e0/0/3 为混杂接口模式,pvid为5,不允许带vlan 2 to 3 5 标签

VLAN 实验_第20张图片

结果是:

 VLAN 实验_第21张图片

 六:最后结果

VLAN 实验_第22张图片

VLAN 实验_第23张图片

VLAN 实验_第24张图片VLAN 实验_第25张图片VLAN 实验_第26张图片VLAN 实验_第27张图片

 PC1 可以ping 2/4/5/6

PC>ping 192.168.2.250

Ping 192.168.2.250: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.250: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.2.250: bytes=32 seq=3 ttl=127 time=79 ms
From 192.168.2.250: bytes=32 seq=4 ttl=127 time=93 ms
From 192.168.2.250: bytes=32 seq=5 ttl=127 time=94 ms

--- 192.168.2.250 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/86/94 ms

PC>ping 192.168.2.253

Ping 192.168.2.253: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.253: bytes=32 seq=2 ttl=127 time=110 ms
From 192.168.2.253: bytes=32 seq=3 ttl=127 time=109 ms
From 192.168.2.253: bytes=32 seq=4 ttl=127 time=109 ms
From 192.168.2.253: bytes=32 seq=5 ttl=127 time=94 ms

--- 192.168.2.253 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/105/110 ms

PC>ping 192.168.2.252

Ping 192.168.2.252: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.252: bytes=32 seq=2 ttl=127 time=125 ms
From 192.168.2.252: bytes=32 seq=3 ttl=127 time=125 ms
From 192.168.2.252: bytes=32 seq=4 ttl=127 time=140 ms
From 192.168.2.252: bytes=32 seq=5 ttl=127 time=78 ms

--- 192.168.2.252 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/117/140 ms

PC>ping 192.168.2.251

Ping 192.168.2.251: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.251: bytes=32 seq=2 ttl=127 time=94 ms
From 192.168.2.251: bytes=32 seq=3 ttl=127 time=141 ms
From 192.168.2.251: bytes=32 seq=4 ttl=127 time=125 ms
From 192.168.2.251: bytes=32 seq=5 ttl=127 time=125 ms

--- 192.168.2.251 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/121/141 ms

 PC3 可以ping 2/4/5/6

PC>ping 192.168.2.250

Ping 192.168.2.250: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.250: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.2.250: bytes=32 seq=3 ttl=127 time=79 ms
From 192.168.2.250: bytes=32 seq=4 ttl=127 time=93 ms
From 192.168.2.250: bytes=32 seq=5 ttl=127 time=94 ms

--- 192.168.2.250 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/86/94 ms

PC>ping 192.168.2.253

Ping 192.168.2.253: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.253: bytes=32 seq=2 ttl=127 time=110 ms
From 192.168.2.253: bytes=32 seq=3 ttl=127 time=109 ms
From 192.168.2.253: bytes=32 seq=4 ttl=127 time=109 ms
From 192.168.2.253: bytes=32 seq=5 ttl=127 time=94 ms

--- 192.168.2.253 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/105/110 ms

PC>ping 192.168.2.252

Ping 192.168.2.252: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.252: bytes=32 seq=2 ttl=127 time=125 ms
From 192.168.2.252: bytes=32 seq=3 ttl=127 time=125 ms
From 192.168.2.252: bytes=32 seq=4 ttl=127 time=140 ms
From 192.168.2.252: bytes=32 seq=5 ttl=127 time=78 ms

--- 192.168.2.252 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/117/140 ms

PC>ping 192.168.2.251

Ping 192.168.2.251: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.2.251: bytes=32 seq=2 ttl=127 time=94 ms
From 192.168.2.251: bytes=32 seq=3 ttl=127 time=141 ms
From 192.168.2.251: bytes=32 seq=4 ttl=127 time=125 ms
From 192.168.2.251: bytes=32 seq=5 ttl=127 time=125 ms

--- 192.168.2.251 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/121/141 ms

 PC4可以ping PC5,不能ping pc6


PC>ping 192.168.2.252

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

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

PC>ping 192.168.2.251

Ping 192.168.2.251: 32 data bytes, Press Ctrl_C to break
From 192.168.2.253: Destination host unreachable
From 192.168.2.253: Destination host unreachable
From 192.168.2.253: Destination host unreachable
From 192.168.2.253: Destination host unreachable
From 192.168.2.253: Destination host unreachable

--- 192.168.2.251 ping statistics ---
  5 packet(s) transmitted
  0 packet(s) received
  100.00% packet loss

PC>

你可能感兴趣的:(网络,安全)