三层交换机负载均衡配置方法
下面是负载均衡在三层交换机上的配置的全过程,按照以下的步骤,相信你一定可以成功完成整个配置步骤。
三层交换机配置——配置一组二层端口
configure terminal 进入配置状态
nterface range {port-range} 进入组配置状态
三层交换机配置——配置三层端口
configure terminal 进入配置状态
interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} | {port-channel port-channel-number} 进入端口配置状态
no switchport 把物理端口变成三层口
ip address ip_address subnet_mask 配置IP地址和掩码
no shutdown 激活端口
例:
Switch(config)# interface gigabitethernet0/2
Switch(config-if)# no switchport
Switch(config-if)# ip address
Switch(config-if)# no shutdown
三层交换机配置——配置VLAN
configure terminal 进入配置状态
vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改
name vlan-name 可选)输入一个VLAN名,如果没有配置VLAN名,缺省的.名字是VLAN号前面用0填满的4位数,如VLAN0004是VLAN4的缺省名字
mtu mtu-size (可选) 改变MTU大小
例:
Switch# configure terminal
Switch(config)# vlan 20
Switch(config-vlan)# name test20
Switch(config-vlan)# end
或
Switch# vlan database
Switch(vlan)# vlan 20 name test20
Switch(vlan)# exit
三层交换机配置——端口分配给一个VLAN
configure terminal 进入配置状态
interface interface-id 进入要分配的端口
switchport mode access 定义二层口
switchport access vlan vlan-id 把端口分配给某一VLAN
例:
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface fastethernet0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 2
Switch(config-if)# end
Switch#
配置VLAN trunk
configure terminal 进入配置状态
interface interface-Id 进入端口配置状态
switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封装ISL 或 802.1Q 或
三层交换机配置——自动协商
例:
switchport mode {dynamic {auto | desirable} | trunk} 配置二层trunk模式。
dynamic auto—自动协商是否成为trunk
dynamic desirable—把端口设置为trunk如果对方端口是trunk, desirable, 配置Native VLAN
(802.1q)或自动模式,trunk—设置端口为强制的trunk方式,而不理会对方端口是否为trunkswitchport access vlan vlan-id 可选)
指定一个缺省VLAN, 如果此端口不再是trunkswitchport trunk native vlan vlan-id 指定802.1Q native VLAN号
Switch# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)# interface fastethernet0/4
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation dot1q
Switch(config-if)# end
三层交换机配置——定义TRUNK允许的VLAN
configure terminal子 进入配置状态
interface interface-id 进入端口配置
switchport mode trunk 配置二层口为trunk
switchport trunk allowed vlan {add | all | except | remove} vlan-list可选) 配置trunk允许的VLAN.使用add, all, except, remove关健字
no switchport trunk allowed vlan 允许所有VLAN通过
例:
Switch(config)# interface fastethernet0/1
Switch(config-if)# switchport trunk allowed vlan remove 2
Switch(config-if)# end
三层交换机配置——配置Native VLAN(802.1q)
configure terminal 进入配置状态
interface interface-id 进入配置成802.1qtrunk的端口
switchport trunk native vlan vlan-Id 配置native VLAN号
no switchport trunk native vlan 端口配置命令回到缺省的状态
三层交换机配置——配置基于端口权值的负载均衡
configure terminal 进入Switch 1配置状态
vtp domain domain-name 配置VTP域
vtp mode server 将Switch 1配置成VTP server.
show vtp status 验证VTP的配置
show vlan 验证VLAN
configure terminal 进入配置状态
interface fastethernet 0/1 进入F0/1端口
switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封装
switchport mode trunk 配置成trunk
show interfaces fastethernet0/1 switchport 验证VLAN配置
按以上步骤对想要负载均衡的接口进行配置
在另一个交换机上进行此配置
show vlan 当trunk已经起来,在switch2上验证已经学到相的vlan配置
configure terminal 在Switch 1上进入配置状态
interface fastethernet0/1 进入要配置的端口
spanning-tree vlan 8 port-priority 10 将端口权值10赋与VLAN 8.
spanning-tree vlan 9 port-priority 10 将端口权值10赋与VLAN 9.
spanning-tree vlan 10 port-priority 10 将端口权值10赋与VLAN 10.
interface fastethernet0/2 进入F0/2
spanning-tree vlan 3 port-priority 10 将端口权值10赋与VLAN 3.
spanning-tree vlan 4 port-priority 10 将端口权值10赋与VLAN 4
spanning-tree vlan 5 port-priority 10 将端口权值10赋与VLAN 5
spanning-tree vlan 6 port-priority 10 将端口权值10赋与VLAN 10
end 退出
show running-config 验证配置
copy running-config startup-config 保存配置
配置STP路径值的负载均衡
Trunk1走VLAN8-10,Trunk2走VLAN2-4
configure terminal 进入 Switch 1配置状态
interface fastethernet 0/1 进入F0/1
switchport trunk encapsulation {isl | dot1q | negotiate}配置封装
switchport mode trunk 配置Trunk,缺省是ISL封装
exit 退回
在F0/2口上重复2-4步骤
exit 退回
show running-config 验证配置
show vlan验证switch1 已经学到Vlan
configure terminal 进入配置状态
interface fastethernet 0/1 进入F0/1
spanning-tree vlan 2 cost 30 设置Vlan2生成树路径值为30
spanning-tree vlan 3 cost 30 设置Vlan3生成树路径值为30
spanning-tree vlan 4 cost 30 设置Vlan4生成树路径值为30
end 退出
在switch1的F0/2上重复9-11步骤设置VLAN8,9,10生成树路径值为30
end 退出
show running-config 验证配置
copy running-config startup-config 保存配置
负载均衡在三层交换机上的配置的全过程就为你介绍完了,按照以上的步骤,相信你一定可以成功完成整个配置步骤。
-
2017年计算机应用基础试题带答案
一、选择题1、计算机系统由硬件系统和软件系统两部分组成,下列选项中不属于硬件系统的是__________。A.中央处理器B.内存储器C.I/O设备D.系统软件答案:D。解析:本题考查计算机系统基本组成的相关知识。计算机系统由硬件系统和软件系统两个部分组成。其中硬件系统...
-
把Word转换成PPT的办法
我们通常用Word来录入、编辑、打印材料,而有时需要将已经编辑、打印好的材料,做成PowerPoint演示文稿,以供演示、讲座使用。如果在PowerPoint中重新录入,既麻烦又浪费时间。如果在两者之间,通过一块块地复制、粘贴,一张张地制成幻灯片,也比较费事。其实,我们可以利用Po...
-
怎样打开隐藏文件
由于计算机具有高运算速度和精度以及逻辑判断能力,因此出现了计算力学、计算物理、计算化学、生物控制论等新的学科。以下是小编整理的打开隐藏文件的方法,希望大家认真阅读!随便打开一个文件夹,比如打开我的文档点击上面工具栏中的.工具,选择下面的文件夹选项在弹...
-
2017计算机应用基础统考选择题字母排序版
开头为空白数字符号____是Internet的主要互联设备。路由器“32位微型计算机”中的32指的是____。机器的字长“更改默认主页”是在InternetExplorer浏览器的选项卡中进行设置,这个选项卡是____。常规“美国信息交换标准代码”的缩写是____。ASCII“同一台计算机,...