以上为拓扑图,以下为相关的说明:
1.中间交换机之间的VLAN的学习使用vtp协议进行配置,使得其客户端能够学到核心交换机的vlan;
2.包括核心交换机(SW1)的Fa0/1和接入交换机的(SW2)的Fa0/2、3、4,均将端口模式配置为access模式;
3.SW1的Fa0/2和SW2的Fa0/1配置为trunk模式。
请看详细配置:
sw1配置:
hostname SW1
hcp excluded-address 192.168.10.1
ip dhcp pool vlan
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server 8.8.8.8
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
interface FastEthernet0/2
switchport trunk allowed vlan 10
interface FastEthernet0/3
switchport access vlan 10
switchport mode access
interface FastEthernet0/4
switchport access vlan 10
switchport mode access
interface Vlan1
no ip address
shutdown
interface Vlan10
ip address 192.168.10.1 255.255.255.0
ip classless
SW1(config)#vtp mode server
SW1(config)#vtp domain vlan
SW1(config)#vtp password 1234
SW1(config)#vtp version 2
SW2配置
interface FastEthernet0/1
switchport trunk allowed vlan 10
switchport mode trunk
interface FastEthernet0/2
switchport access vlan 10
switchport mode access
interface FastEthernet0/3
switchport access vlan 10
switchport mode access
interface FastEthernet0/4
switchport access vlan 10
switchport mode access
SW2(config)#vtp mode client
SW2(config)#vtp domain vlan
SW2(config)#vtp password 1234
SW2(config)#vtp version 2
PC获取的IP地址
完成。