当前位置:文档之家› 中小企业双出口网络VLAN配置

中小企业双出口网络VLAN配置


A楼: VLAN 子网地址
IT部 11 10.1.1.0 10.1.1.1-10.1.1.254
人力资源部 12 10.1.2.0 10.1.2.1-20.1.2.254


B楼
销售 21 10.2.1.0
市场 22 20.2.2.0

C楼
财务 31 10.3.1.0
会计 32 10.3.2.0



-------------------------------------
VLAN信息查看:
Switch#show vlan
Switch#show vlan brief
VLAN Name Status Ports
---- ---------- -------- ------------------------
1 default active Fa0/1, Fa0/2, Fa0/3
VLAN号 VLAN名称 VLAN状态 VLAN成员


VLAN的添加方法:
1:全局模式
Switch(config)#vlan 10 虚拟网的创建
Switch(config-vlan)#name jishu 虚拟网的名称
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name xiaoshou
Switch(config-vlan)#vlan 30
Switch(config-vlan)#name renliziyuan
Switch(config-vlan)#exit

2:特权模式
Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#vlan
Switch(vlan)#vlan 20 name Shichangbu
VLAN 20 added:
Name: Shichangbu
Switch(vlan)#
Switch(vlan)#exit
APPLY completed.
Exiting....
Switch#

3:自动生成
Switch(config)#interface f0/5
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 31
% Access VLAN does not exist. Creating vlan 31

Switch(config)#interface f0/6
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 32
% Access VLAN does not exist. Creating vlan 32


VLAN划分:
Switch(config)#interface f0/1 进入接口配置子模式
Switch(config-if)#switchport mode access 当前接口是一个用户接入接口(PC设备,服务器设备,路由器)
Switch(config-if)#switchport access vlan 10 声明当前接口下的设备属于哪一个VLAN(虚拟网、用户组)
Switch(config-if)#exit

Switch(config)#interface f0/2
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 20

Switch(config-if)#int f0/3
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 30



中继链路的配置:先起封装,再配中继
Switch(config)#interface f0/1
Switch(config-if)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode.

Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk

Sw2#show interfaces trunk
Port Mode Encapsulation Status Native vlan
Fa0/3 on 802.1q trunking 1

Port Vlans allowed on trunk
Fa0/3 1-1005

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

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




VTP:(这是cisco的私有设备,咱们机房是不

能用的)
方法1
Switch(config)#vtp domain https://www.doczj.com/doc/809241174.html,
Changing VTP domain name from NULL to https://www.doczj.com/doc/809241174.html,

Switch(config)#vtp mode server
Device mode already VTP SERVER.

Switch(config)#vtp password cisco
Setting device VLAN database password to cisco


SW1#show vtp status
VTP Version : 2 版本号信息
Configuration Revision : 2 配置修订号
Maximum VLANs supported locally : 255 设备支持的VLAN数量
Number of existing VLANs : 7 当前设备总VLAN数
VTP Operating Mode : Server VTP模式
VTP Domain Name : https://www.doczj.com/doc/809241174.html, VTP域名
VTP Pruning Mode : Disabled 是否开启修剪功能
VTP V2 Mode : Disabled 是否开始了VTP V2模式
VTP Traps Generation : Disabled 是否可以发送SNMP Trap消息
MD5 digest : 0xF3 0xAB 0x16 0xAF 0x7C 0x77 0xDC 0x26
Configuration last modified by 0.0.0.0 at 3-1-93 00:00:49
Local updater ID is 0.0.0.0 (no valid interface found)

方法2:
Switch#vlan database
% Warning: It is recommended to configure VLAN from config mode,
as VLAN database mode is being deprecated. Please consult user
documentation for configuring VTP/VLAN in config mode.

Switch(vlan)#?
VLAN database editing buffer manipulation commands:
exit Apply changes, bump revision number, and exit mode
no Negate a command or set its defaults
vlan Add, delete, or modify values associated with a single VLAN

vtp Perform VTP administrative functions.
Switch(vlan)#vtp ?
client Set the device to client mode.
domain Set the name of the VTP administrative domain.
password Set the password for the VTP administrative domain.
server Set the device to server mode.
transparent Set the device to transparent mode.
v2-mode Set the administrative domain to V2 mode.

Switch(vlan)#vtp server
Device mode already VTP SERVER.
Switch(vlan)#vtp domain https://www.doczj.com/doc/809241174.html,
Domain name already set to https://www.doczj.com/doc/809241174.html,.
Switch(vlan)#vtp password cisco
Password already set to cisco
Switch(vlan)#exit
APPLY completed.
Exiting....



VLAN间通信:单臂路由
1.交换机
Switch(config)#interface f0/5
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk

2.路由器
Router(config)#hostname R1
R1(config)#interface f0/0
R1(config-if)#no shutdown

R1(config)#interface f0/0.10
R1(config-subif)#encapsulation dot1Q 10
R1(config-subif)#ip address 10.0.0.10 255.255.255.0
R1(config-subif)#exit

R1(config)#interface f0/0.20
R1(config-subif)#
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 20.0.0.10 255.255.255.0
R1(config-subif)#
R1(config-subif)#exit

R1(config)#interface f0/0.30
R1(config-subif)#
R1(config-subif)#encapsulation dot1Q 30
R1(config-subif)#ip address 30.0.0.10 255.255.255.0
R1(config-subif)#



生成树:
BPDU:桥协议数据单元

1 ROOT 根桥(相连的交换网络中唯一的一台交换设备)
优先级+设备MAC地址(Bridge ID)
优先级默认:32768 取值范围 0-61440

2 根端口(相连的交换网络各台设备到达根桥最近的端口)
1 cost 各端口到达根桥的路径开销
2 该交换机各个端口相邻设备的Bridge ID
3 PORT ID (端口优先级+端口号)
端口优先级默认值:128 取值范围 (0-255)



二层以太通道的配置:
Switch(config)#interface range f0/1 - 4
Switch(config-if-range)#channel-group 1 mode on
Switch(config-if-range)#no shutdown

Switch(config)#interface port-channel 1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk

路由协议
二进制
子网计算
RIP
OSPF
ACL

相关主题
相关文档 最新文档