pc1和pc3在同一个网段,IP配置为:192.168.1.0
pc2/4/5/6在同一个网段,IP配置为:192.168.2.0
首先开启全局dhcp服务,然后在对每个接口开启dhcp服务
开启全局dhcp服务
dhcp enable
对接口g0/0/0配置IP并且启用,将他设置为vlan 3,4,5的服务器
然后配置池子v2
配置池子V3
结果是:
设置子接口0/0/0.1来配置vlan2的服务器
接口e0/0/4为混杂接口,带v 2的标签,不带vlan 3 to 5的标签
接口e0/0/1为混杂接口模式,带有所有的标签
接口e0/0/2为接入模式因为要求配置为access接口,修改默认pvid为2。
接口e0/0/3为混杂模式,不允许所有vlan,pvid为4
结果是:
e0/0/1 为接口模式,允许vlan 2 to 5 的标签
e0/0/2 为混杂接口模式,允许vlan 2 to 5 的标签
e0/0/3 为接入接口模式,pvid为2
e0/0/4 为混杂接口模式,pvid为4,不允许带vlan 1 to 4 的标签
结果是:
e0/0/1 为混杂接口模式,允许带vlan2 to 5 所有标签
e0/0/2 为混杂接口模式,pvid为4,不允许带vlan 2 to 4 标签
e0/0/3 为混杂接口模式,pvid为5,不允许带vlan 2 to 3 5 标签
结果是:
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>