实验教程原文地址:1、VLAN Practice Lab Setup in Packet Tracer和2、Configure DHCP Server for multiple VLANs on the Switch。
实验一:VLAN Practice Lab Setup in Packet Tracer
实验结果展示
6台PC: PC1-PC5依次进行配置。 Office1:
enable
configure terminal
hostname S1
vtp mode server
vtp domain example
vtp password vinita
vlan 10
exit
vlan 20
exit
interface fastEthernet 0/1
switchport access vlan 10
exit
interface fastEthernet 0/2
switchport access vlan 20
exit
interface gigabitethernet 0/1
switchport mode trunk
exit
interface gigabitethernet 0/2
switchport mode trunk
exit
interface fastethernet 0/24
switchport mode trunk
exit
Office2:
enable
configure terminal
hostname S2
vtp mode client
vtp domain example
vtp password vinita
interface fastEthernet 0/1
switchport access vlan 10
exit
interface fastEthernet 0/2
switchport access vlan 20
exit
interface gigabitethernet 0/1
switchport mode trunk
exit
interface gigabitethernet 0/2
switchport mode trunk
exit
interface fastethernet 0/23
switchport mode trunk
exit
interface fastethernet 0/24
switchport mode trunk
exit
Office3:
enable
configure terminal
hostname S3
vtp mode client
vtp domain example
vtp password vinita
interface fastEthernet 0/1
switchport access vlan 10
exit
interface fastethernet 0/24
switchport mode trunk
exit
路由器Pouter0
enable
configure terminal
interface fastEthernet 0/0
no ip address
no shutdown
exit
interface fastEthernet 0/0.10
encapsulation dot1Q 10
ip address 10.0.0.1 255.0.0.0
exit
interface fastEthernet 0/0.20
encapsulation dot1Q 20
ip address 20.0.0.1 255.0.0.0
exit
**最后进行接口连接(Connected To 和 Connected With),非常非常重要,注意接口的匹配,如果选择 这种方式自动连接会产生错误,不能进行有效通信。 通信测试:
实验二:Configure DHCP Server for multiple VLANs on the Switch
结果展示:
环境配置: Switch:
enable
configure terminal
vlan 10
exit
vlan 20
exit
vlan 30
exit
interface FastEthernet 0/1
switchport access vlan 10
exit
interface FastEthernet 0/2
switchport access vlan 10
exit
interface FastEthernet 0/3
switchport access vlan 20
exit
interface FastEthernet 0/4
switchport access vlan 20
exit
interface FastEthernet 0/5
switchport access vlan 30
exit
interface FastEthernet 0/6
switchport access vlan 30
exit
interface GigabitEthernet 0/1
switchport mode trunk
exit
ip dhcp excluded-address 10.0.0.1 10.0.0.10
ip dhcp excluded-address 20.0.0.1 20.0.0.10
ip dhcp excluded-address 30.0.0.1 30.0.0.10
ip dhcp pool vPool10
network 10.0.0.0 255.0.0.0
default-router 10.0.0.1
dns-server 4.4.4.4
exit
ip dhcp pool vPool20
network 20.0.0.0 255.0.0.0
default-router 20.0.0.1
dns-server 8.8.8.8
exit
ip dhcp pool vPool30
network 30.0.0.0 255.0.0.0
default-router 30.0.0.1
dns-server 30.0.0.2
exit
interface vlan 10
ip address 10.0.0.5 255.0.0.0
exit
interface vlan 20
ip address 20.0.0.5 255.0.0.0
exit
interface vlan 30
ip address 30.0.0.5 255.0.0.0
exit
Router
enable
configure terminal
interface FastEthernet 0/0
no ip address
no shutdown
exit
interface FastEthernet 0/0.10
encapsulation dot1Q 10
ip address 10.0.0.1 255.0.0.0
exit
interface FastEthernet 0/0.20
encapsulation dot1Q 20
ip address 20.0.0.1 255.0.0.0
exit
interface FastEthernet 0/0.30
encapsulation dot1Q 30
ip address 30.0.0.1 255.0.0.0
exit
原本使用的Cisco Packet Tracer 5.3,总是出现问题,能分配到IP地址,但是不能进行通信,后来改用了Cisco Packet Tracer 7.3,才完成了整个实验。
|