码迷,mamicode.com
首页 > 其他好文 > 详细

交换基础 VLAN TRUNK VTP

时间:2015-03-07 14:10:04      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
两台交换机互连,每台交换机下有两台pc(路由器做交换机添加交换模块,路由器做pc关闭路由功能)
第一台交换机下的pc1 f0/0:ip地址为192.168.10.1 vlan10,pc2 f0/0:192.168.20.1 vlan20,第二天交换机下的pc3 f0/0:ip地址为

192.168.10.2 vlan10,pc4 f0/0:192.168.20.2 vlan20 sw1 

R3(config)#no ip routing
R3(config)#int f0/0
R3(config-if)#ip add 192.168.10.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#end

R4(config)#no ip routing
R4(config)#int f0/0
R4(config-if)#ip add 192.168.20.1 255.255.255.0
R4(config-if)#no shut
R4(config-if)#end

R5(config)#no ip routing
R5(config)#int f0/0
R5(config-if)#ip add 192.168.20.2 255.255.255.0
R5(config-if)#no shut
R5(config-if)#end

R6(config)#no ip routing
R6(config)#int f0/0
R6(config-if)#ip add 192.168.20.2 255.255.255.0
R6(config-if)#no shut
R6(config-if)#end

R1#vlan database
R1(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
R1(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
R1(vlan)#exit
R1#conf t
R1(config)#int f0/0
R1(config-if)#switchport mode access
R1(config-if)#switchport access vlan 10
R1(config-if)#int f0/1
R1(config-if)#switchport mode access
R1(config-if)#switchport access vlan 20
R1(config-if)#end
R1(config)#int f0/15
R1(config-if)#switchport trunk encapsulation dot1q
R1(config-if)#switchport mode trunk
R1(config-if)#end


R2#vlan database
R2(vlan)#vlan 10
VLAN 10 added:
    Name: VLAN0010
R2(vlan)#vlan 20
VLAN 20 added:
    Name: VLAN0020
R2(vlan)#exit
R2#conf t
R2(config)#int f0/0
R2(config-if)#switchport mode access
R2(config-if)#switchport access vlan 10
R2(config-if)#int f0/1
R2(config-if)#switchport mode access
R2(config-if)#switchport access vlan 20
R2(config-if)#end
R2(config)#int f0/15
R2(config-if)#switchport trunk encapsulation dot1q
R2(config-if)#switchport mode trunk
R2(config-if)#end


交换基础 VLAN TRUNK VTP

标签:

原文地址:http://blog.csdn.net/shienquan/article/details/44115863

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!