单臂路由配置详解
以下实验在Cisco Packet Tracer 6.0下完成,和真机可能有所出入。
先建如下拓扑图

从switch0开始配置
enable /进入特权模式
conf t /进入配置模式
vtp mode server /配置为VTP Server模式
vtp domain sunny /配置VTP 域名为sunny
vlan 2 /新增vlan2 (中间有空格)
name Testvlan2 /vlan 2的名字
exit
vlan 3 /新增vlan3
name Testvlan3 /vlan3的名字
exit
vlan 4 /新增vlan4
name Testvlan4 /vlan4的名字
exit
vlan 5 /新增vlan5
name Testvlan5 /vlan5的名字
exit /退出
int range f0/1-10 /进入f0/1-10的接口模式
switchport mode access /修改端口模式为access
switchport access vlan 2 /将f0/1-10加入vlan2
int range f0/11-20
switchport mode access
switchport access vlan 3
int range f0/21-24
switchport mode access
switchport access vlan 4
int range G1/1-2
switchport mode trunk /修改端口模式為trunk
switchport access vlan 5 /将G1/1-2加入vlan 5
switchport trunk allowed vlan 1-5 /指定1-5的vlan通过trunk
end
show vlan /显示vlan信息
show vtp status /显示vtp信息
进入SW1的山配置
enable
conf t
vtp mode client
vtp domin sunny
end
show vtp
conf t
int range f0/1-10
switchport mode access
switchport access vlan 2
no shutdown
int range f0/11-20
switchport mode access
switchport access vlan 3
no shutdown
int range f0/21-24
switchport mode access
switchport access vlan 4
no shutdown
int range G1/1-2
switchport mode trunk
switchport access vlan 5
switchport trunk allowed vlan 1-5
no shutdown
SW2&SW3重複以上配置
進入路由器的配置
enable
conf t
int g0/2 /進入接口
no shutdown /開啟接口
int g0/2.1 /進入子接口
encapsulation dot1q 2 /封裝類型為802.1Q
ip address 192.168.1.1 255.255.255.0 /給子接口配ip地址
no shutdown
int g0/2.2
encapsulation dot1q 3
ip address 192.168.2.1 255.255.255.0
no shutdown
int g0/2.3
encapsulation dot1q 4
ip address 192.168.3.1 255.255.255.0
no shutdown
int g0/2.4
encapsulation dot1q 5
ip address 192.168.4.1 255.255.255.0
no shutdown
end
show ip interface brief

未經本人同意,請勿轉載。謝謝
转载于:https://blog.51cto.com/jyc168/1191776