交换基础 VLAN TRUNK VTP


一台交换机是一个广播域 一个交换机端口是一个冲突域
两台交换机互连,每台交换机下有两台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

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.10.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
R1#show vlan-s  真机用show vlan即可

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14
10   VLAN0010                         active    Fa0/0
20   VLAN0020                         active    Fa0/1
1002 fddi-default                     active
1003 token-ring-default               active
1004 fddinet-default                  active
1005 trnet-default                    active

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        1002   1003
10   enet  100010     1500  -      -      -        -    -        0      0
20   enet  100020     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        1      1003
1003 tr    101003     1500  1005   0      -        -    srb      1      1002
1004 fdnet 101004     1500  -      -      1        ibm  -        0      0
1005 trnet 101005     1500  -      -      1        ibm  -        0      0

R1#show interfaces trunk--查看trunk接口

Port      Mode         Encapsulation  Status        Native vlan
Fa0/15    on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa0/15    1-1005

Port      Vlans allowed and active in management domain
Fa0/15    1,10,20

Port      Vlans in spanning tree forwarding state and not pruned
Fa0/15    1,10,20

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值