CISCO IOS VLAN

219阅读 0评论2011-12-08 wfeng
分类:系统运维

 多个交换机中的VLAN 划分 vtp配置 与端口加入

 

拓扑如下 同一水平线为同一个VLAN 网 共三个 值得注意的是 在不同的交换机 需要承载VLAN 信息需要开启干道链路(trunk)

VTP 信息可以帮助其他相邻的交换机 更新VTP 信息和VLAN 信息 可以减少网络管理工作量

 

0
Switch>en
Switch#conf t
Switch#vlan database
Switch(vlan)#vlan 2 name redhatd1
VLAN 2 added:
    Name: redhatd1
Switch(vlan)#vlan 3 name redhatd2
VLAN 3 added:
    Name: redhatd2

Switch(vlan)#vlan 4 name redhatd3
VLAN 4 added:
    Name: redhatd3

Switch(vlan)#vtp domain redhatd      

//VTP 配置玉米 和密码 输入 vtp [server][client][transparent] 可更改对应的模式 默认为server
Changing VTP domain name from NULL to redhatd
Switch(vlan)#vtp password 123456
Setting device VLAN database password to 123456


Switch(config)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vtp status               //查看VTP 信息
VTP Version                     : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 255
Number of existing VLANs        : 7
VTP Operating Mode              : Server     //SERVER 模式会接受 修改和创建的配置 默认在此模式下
VTP Domain Name                 : redhatd
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x29 0x05 0x43 0x53 0xE5 0x53 0xF9 0xD6
Configuration last modified by 0.0.0.0 at 3-1-93 00:14:10
Local updater ID is 0.0.0.0 (no valid interface found)

 

Switch(config)#int f0/1
Switch()#switchport access vlan 2
Switch(config-if)#int f0/2
Switch(config-if)#switchport access vlan 3
Switch(config-if)#int f0/3
Switch(config-if)#switchport access vlan 4
Switch(config-if)#^Z
Switch#show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig1/1, Gig1/2
2    redhatd1                         active    Fa0/1
3    redhatd2                         active    Fa0/2
4    redhatd3                         active    Fa0/3
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   

 

Switch(config)#int f0/4
Switch(config-if)#switchport mode trunk       //开启干道链路 承载VLAN 信息
Switch0 配置结束

 

Switch1

Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/4
Switch(config-if)#sw mode tr
Switch(config-if)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vtp status
VTP Version     
               : 2
Configuration Revision          : 0
Maximum VLANs supported locally : 255
Number of existing VLANs        : 5
VTP Operating Mode              : Server
VTP Domain Name                 : redhatd
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0xED 0x8C 0xA2 0x30 0x42 0x64 0xAD 0x5F
Configuration last modified by 0.0.0.0 at 0-0-00 00:00:00
Local updater ID is 0.0.0.0 (no valid interface found)   

//因为开启 TRUNK 已获得同步更新的VTP 信息和 VLAN 信息 不过端口需重新加入

Switch#show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15, Fa0/16, Fa0/17
                                                Fa0/18, Fa0/19, Fa0/20, Fa0/21
                                                Fa0/22, Fa0/23, Fa0/24, Gig1/1
                                                Gig1/2
2    redhatd1                         active   
3    redhatd2                         active   
4    redhatd3                         active
   
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   

Switch(config)#int f0/1
Switch(config-if)#switchport access vlan 2
Switch(config-if)#int f0/2
Switch(config-if)#switchport access vlan 3
Switch(config-if)#int f0/3
Switch(config-if)#switchport access vlan 4

Switch(config-if)#^Z
Switch#

%SYS-5-CONFIG_I: Configured from console by console
show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig1/1, Gig1/2
2    redhatd1                         active    Fa0/1
3    redhatd2                         active    Fa0/2
4    redhatd3                         active    Fa0/3

1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup


Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/5
Switch(config-if)#switchport mode trunk       //开启trunk

Switch1配置结束

 

Switch2

Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/4
Switch(config-if)#switchport mode trunk
Switch(config-if)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vtp status
VTP Version                     : 2
Configuration Revision          : 3
Maximum VLANs supported locally : 255
Number of existing VLANs        : 8
VTP Operating Mode              : Server
VTP Domain Name                 : redhatd
VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0x52 0x3B 0x59 0x49 0xB7 0x39 0x43 0x88
Configuration last modified by 0.0.0.0 at 3-1-93 00:51:14
Local updater ID is 0.0.0.0 (no valid interface found)

Switch(config)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/5
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13
                                                Fa0/14, Fa0/15, Fa0/16, Fa0/17
                                                Fa0/18, Fa0/19, Fa0/20, Fa0/21
                                                Fa0/22, Fa0/23, Fa0/24, Gig1/1
                                                Gig1/2
2    redhatd1                         active   
3    redhatd2                         active   
4    redhatd3                         active   
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/1
Switch(config-if)#switchport access vlan 2
Switch(config-if)#int f0/2
Switch(config-if)#switchport access vlan 3
Switch(config-if)#int f0/3
Switch(config-if)#switchport access vlan 4
Switch(config-if)#^Z
Switch#
%SYS-5-CONFIG_I: Configured from console by console
show vlan b

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig1/1, Gig1/2
2    redhatd1                         active    Fa0/1
3    redhatd2                         active    Fa0/2
4    redhatd3                         active    Fa0/3
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   
Switch#

Switch2 配置结束

 

PS:实际过程中配置完毕别忘记用write memory 保存



CCIE Security 2009 IOS防火墙合集


上一篇:ospf 多区域试验脚本
下一篇:CISCO 3750G VLAN配置实例