思科三层交换机基于环形网络的配置方案(初学者的宝典)

合集下载

三层交换机实现路由功能配置示例与详解(CiscoPackerTracer模拟器)

三层交换机实现路由功能配置示例与详解(CiscoPackerTracer模拟器)

三层交换机实现路由功能配置⽰例与详解(CiscoPackerTracer模拟器)计算机⽹络实验作业 <(* ̄▽ ̄*)/本来计划⼀个晚上写出来的,然后这个⼩⽬标没完成- - ⽤了两天【原理】三层交换机实现路由器功能,需要主机,三个交换机,⼀个路由器【效果图】【配置代码】注意注意端⼝⼀定要对,【我只保留了代码命令,命令后的效果给删除了】交换机1: 配置端⼝Switch>enSwitch#confSwitch(config)#vlan 2Switch(config-vlan)#EXITSwitch(config)#int f0/2Switch(config-if)#switchport access vlan 2Switch(config-if)#no shutSwitch(config-if)#int f0/24Switch(config-if)#switchport mode trunk交换机2:配置端⼝Switch#enSwitch#confSwitch(config)#int f0/2Switch(config-if)#switchport access vlan 2% Access VLAN does not exist. Creating vlan 2Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#int f0/24Switch(config-if)#switchport mode trunk**三层交换机:(配置)Switch>Switch>enSwitch#confSwitch(config)#int f0/1 //配置端⼝f0/1 为trunkSwitch(config-if)#switchport mode accessSwitch(config-if)#switchport mode trunkSwitch(config-if)#EXITSwitch(config)#int f0/2 //配置端⼝ f0/2 为trunkSwitch(config-if)#switchport mode accessSwitch(config-if)#switchport mode trunkSwitch(config-if)#exitSwitch(config)#vlan 2 // 创建vlan2Switch(config-vlan)#exitSwitch(config)#vlan 1 // 创建vlan1Switch(config-vlan)#exitSwitch(config)#int vlan 1 // 配置 vlan 1 的 ip地址(⽹关)Switch(config-if)#no shutSwitch(config-if)#ip address 192.168.1.168 255.255.255.0Switch(config-if)#exitSwitch(config)#int vlan 2 //配置 vlan 2 的 ip地址(⽹关)Switch(config-if)#ip address 192.168.2.168 255.255.255.0Switch(config-if)#exitSwitch(config)#int f0/3 // 配置端⼝f0/3 到路由器为不交换Switch(config-if)#no switchportSwitch(config-if)#ip address 192.168.10.1 255.255.255.0// 配置到路由器 ip 地址Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#ip routing // 配置路由器 IP 地址Switch(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2**路由器:(配置)Router>enRouter#confRouter(config)#int f0/0 //配置端⼝启动Router(config-if)#no shutRouter(config-if)#exitRouter(config)#int f0/1Router(config-if)#no shutRouter(config-if)#exitRouter(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.1 // 配置路由器默认ip地址Router(config)#exitRouter#%SYS-5-CONFIG_I: Configured from console by consoleRouter#confRouter(config)#int f0/1 // 配置路由器到第三层交换机 ip 地址Router(config-if)#ip address 192.168.10.2 255.255.255.0Router(config-if)#// 注意若路由器下直接有主机的话需要以下配置 ip地址 (⽹关)*************************华丽的分割线********************************Router(config)#int f0/0.1 // 配置⼦⽹络1Router(config-subif)#encapsulation dot1Q 1Router(config-subif)#ip address 192.168.3.168 255.255.255.0 // 配置⼦⽹关Router(config-subif)#exitRouter(config)#int f0/0.2 // 配置⼦⽹络 2Router(config-subif)#encapsulation dot1Q 2Router(config-subif)#ip address 192.168.4.168 255.255.255.0 // 配置⼦⽹关Router(config-subif)#exit*************************华丽的分割线********************************【测试】⽤ PC-1 ping 其他主机----- > ping 192.168.2.2同⼀交换机下,不同vlan,不同⽹段,可以ping 通第⼀次出现丢包原因: ping第⼀个数据是,建⽴和对应表,因为是不知道对⽅的所以丢包第⼆次就可以100%成功----- > ping 192.168.2.4不同交换机下,不同vlan ,不同⽹段,可以ping 通----- > ping 192.168.1.3不同交换机下,同⼀vlan ,同⼀⽹段,可以ping 通***************************************************************************************************************************************************若在实现过程中发现问题,欢迎指正 (#^.^#)。

思科三层交换机基于环形网络的配置方案(初学者的宝典)

思科三层交换机基于环形网络的配置方案(初学者的宝典)

Cisco三层交换机网络配置方案二vlan设置此处的实验划分了3个vlan,一个服务器组,一个子站的主环形通道,一个子站的备环形通道。

如果有多个环形通道,按照文章中的主备环形通道的配置方法增加配置即可。

本片文章是以Cisco 3560编写的,配置3750与3560不一样的地方会在每一部分的开头标出,如果没有标出就是两种交换机的配置方法是一样的。

如果配置的是3750(或者其他型号的可堆叠Cisco交换机),请先参阅4.6。

2.1 进入配置模式2.1.1 进入特权模式Switch>en如图6所示。

图 62.1.2 进入配置模式Switch#configure terminal如图7所示。

hou图7进入配置模式后就可以开始划分vlan了(关于“模式”的解释请查阅4.2)。

2.2 划分vlan2.2.1 配置交换机的名称Switch(config)#hostname switch1如图8所示。

图82.2.2 划分3个vlanswitch1(config)#vlan 10 !全局配置模式下进入vlan模式并创建vlan10 switch1(config-vlan)#name commmaster !把vlan10命名为commmasterswitch1(config-vlan)#vlan 20 !vlan模式下创建vlan20switch1(config-vlan)#name commbak !把vlan20命名为commbakswitch1(config-vlan)#vlan 30 !vlan模式下创建vlan30switch1(config-vlan)# name server !把vlan30命名为serverswitch1naswitch1(config)#如图9所示。

图92.2.3 分配端口3560端口1的名称是g0/1,3750堆叠后交换机1的端口1名称是Gi1/0/1。

交换机端口的名字是什么可在特权模式(即switch1#)下用sh vlan brief查看。

三层交换机详细配置实例(图)

三层交换机详细配置实例(图)

三层交换机与路由器的配置实例(图解)目的:学会使用三层交换与路由器让处于不同网段的网络相互通信实验步骤:一:二层交换机的配置:在三个二层交换机上分别划出两VLAN,并将二层交换机上与三层交换或路由器上的接线设置为trunk接口二:三层交换机的配置:1:首先在三层交换上划出两个VLAN,并进入VLAN为其配置IP,此IP将作为与他相连PC 的网关。

2:将与二层交换机相连的线同样设置为trunk接线,并将三层交换与路由器连接的线设置为路由接口(no switchsport)3:将路由器和下面的交换机进行单臂路由的配置实验最终结果:拓扑图下各个PC均能相互通信交换机的配置命令:SW 0:Switch>Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#int f0/2Switch(config-if)#switchport access vlan 2Switch(config-if)#no shutSwitch(config-if)#int f0/3Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to upSwitch(config-if)#exitSwitch(config)#SW 1:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/2Switch(config-if)#switchport access vlan 2% Access VLAN does not exist. Creating vlan 2Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to upSwitch(config-if)#SW 2:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/2Switch(config-if)#switchport access vlan 2% Access VLAN does not exist. Creating vlan 2Switch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#switchport mode trunkSwitch(config-if)#三层交换的配置命令:Switch>enSwitch#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#int f0/1Switch(config-if)#switchport mode trunk%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to downSwitch(config-if)#exitSwitch(config)#int f0/2Switch(config-if)#switchport mode trunkSwitch(config-if)#exitSwitch(config)#vlan 2Switch(config-vlan)#exitSwitch(config)#int vlan 1Switch(config-if)#no shut%LINK-5-CHANGED: Interface Vlan1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up Switch(config-if)#ip address 192.168.1.168 255.255.255.0Switch(config-if)#exitSwitch(config)#int vlan 2%LINK-5-CHANGED: Interface Vlan2, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan2, changed state to upSwitch(config-if)#ip addSwitch(config-if)#ip address 192.168.2.168 255.255.255.0Switch(config-if)#%LINK-5-CHANGED: Interface FastEthernet0/3, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to upSwitch(config-if)#exitSwitch(config)#int f0/3Switch(config-if)#no switchport%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to upSwitch(config-if)#Switch(config-if)#ip address 192.168.10.1 255.255.255.0Switch(config-if)#no shutSwitch(config-if)#exitSwitch(config)#ip routingSwitch(config-if)#exitSwitch(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2Switch(config)#路由器的配置:Router>enRouter#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#int f0/0Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to upRouter(config-if)#exitRouter(config)#int f0/1Router(config-if)#no shut%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to upRouter(config-if)#exitRouter(config)#int f0/0Router(config-if)#no shutRouter(config-if)#exitRouter(config)#int f0/0.1Router(config-subif)#encapsulation dot1Q 1Router(config-subif)#ip address 192.168.3.168 255.255.255.0Router(config-subif)#exitRouter(config)#int f0/0.2Router(config-subif)#encapsulation dot1Q 2Router(config-subif)#ip addRouter(config-subif)#ip address 192.168.4.168 255.255.255.0Router(config-subif)#exitRouter(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.1Router(config)#exit%SYS-5-CONFIG_I: Configured from console by consoleRouter#confConfiguring from terminal, memory, or network [terminal]?Enter configuration commands, one per line. End with CNTL/Z.Router(config)#int f0/1Router(config-if)#ip addRouter(config-if)#ip address 192.168.10.2 255.255.255.0 Router(config-if)#。

思科Cisco交换机配置——三层交换机实现VLAN间通信实验详解

思科Cisco交换机配置——三层交换机实现VLAN间通信实验详解

思科Cisco交换机配置——三层交换机实现VLAN间通信实验详解本⽂实例讲述了思科Cisco三层交换机实现VLAN间通信实验。

分享给⼤家供⼤家参考,具体如下:⼀、实验⽬的:⽤三层交换机让同⼀vlan的主机能通信,不同vlan的主机也能通信⼆、拓扑图如下三、具体步骤如下:先给每台主机和服务器配置ip地址和⽹关例:(1)S1三层交换机配置:Switch>en --进⼊特权模式Switch#conf t --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S1 --修改三层交换机主机名为S1S1(config)#vtp domain test --创建vtp域Domain name already set to test.S1(config)#vtp mode server --设置当前交换机在vtp的⼯作模式为server Device mode already VTP SERVER.S1(config)#vlan 10 --创建vlan 10S1(config-vlan)#vlan 20 --创建vlan 20S1(config-vlan)#vlan 30 --创建vlan 30S1(config-vlan)#vlan 40 --创建vlan40S1(config-vlan)#interface f0/1 --进⼊端⼝S1(config-if)#switchport mode access --将端⼝模式改为access模式S1(config-if)#switchport mode trunk --将端⼝模式改为trunk模式S1(config-if)#interface range f0/2-3 --进⼊端⼝S1(config-if-range)#switchport mode access --将端⼝模式改为access模式S1(config-if-range)#switchport access vlan 40 --将端⼝划⼊vlan 40S1(config-if-range)#exit --返回上⼀级S1(config)#ip routing --启动三层交换机的路由功能S1(config)#interface vlan 10 --进⼊vlan 10S1(config-if)#ip address 192.168.1.254 255.255.255.0 --给vlan 10添加ip地址S1(config-if)#interface vlan 20 --进⼊vlan 20S1(config-if)#ip address 192.168.2.254 255.255.255.0 --给vlan 20添加ip地址S1(config-if)#interface vlan 30 --进⼊vlan 30S1(config-if)#ip address 192.168.3.254 255.255.255.0 --给vlan 30添加ip地址S1(config-if)#interface vlan 40 --进⼊vlan 40S1(config-if)#ip address 192.168.4.254 255.255.255.0 --给vlan 40添加ip地址S1(config-if)#end --返回特权模式S1#copy running-config startup-config --保存配置[OK] --保存成功(2)S2交换机配置Switch>en --进⼊特权模式Switch#conf t --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S2 --修改交换机名为S2S2(config)#vtp mode client --设置当前交换机在vtp中为客户机模式Device mode already VTP CLIENT.S2(config)#interface f0/10 --进⼊端⼝S2(config-if)#switchport mode trunk --将端⼝设置为trunk模式S2(config-if)#interface f0/1 --进⼊端⼝S2(config-if)#switchport mode access --将端⼝设置为access模式S2(config-if)#switchport access vlan 30 --将端⼝划⼊vlan30S2(config-if)#interface f0/2 --进⼊端⼝S2(config-if)#switchport mode access --将端⼝设置为access模式S2(config-if)#switchport access vlan 20 --将端⼝划⼊vlan 20S2(config-if)#interface f0/3 --进⼊端⼝S2(config-if)#switchport mode access --将端⼝设置为access模式S2(config-if)#switchport access vlan 10 --将端⼝划⼊vlan 10S2(config-if)#end --返回特权模式S2#copy running-config startup-config --保存配置[OK] --保存成功(3)S3交换机配置Switch>en --进⼊特权模式Switch#conf t --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S3 --修改交换机名为S3S3(config)#vtp mode client --设置当前交换机在vtp中为客户模式Device mode already VTP CLIENT.S3(config)#interface range f0/10-12 --进⼊端⼝S3(config-if-range)#switchport mode trunk --将端⼝设置为trunk模式S3(config-if-range)#interface f0/1 --进⼊端⼝S3(config-if)#switchport mode access --将端⼝设置为access模式S3(config-if)#switchport access vlan 30 --将端⼝划⼊vlan 30S3(config-if)#interface f0/2 --进⼊端⼝S3(config-if)#switchport mode access --将端⼝设置为access模式S3(config-if)#switchport access vlan 20 --将端⼝划⼊vlan20S3(config-if)#interface f0/3 --进⼊端⼝S3(config-if)#switchport mode access --将端⼝设置为access模式S3(config-if)#switchport access vlan 10 --将端⼝划⼊vlan 20S3(config-if)#end --返回特权模式S3#copy running-config startup-config --保存配置[OK] --保存成功(4)S4交换机配置Switch>en --进⼊特权模式Switch#conf t --进⼊全局配置模式Enter configuration commands, one per line. End with CNTL/Z.Switch(config)#hostname S4 --修改交换机名为S4S4(config)#vtp mode client --设置当前交换机在vtp中为客户模式Device mode already VTP CLIENT.S4(config)#interface f0/10 --进⼊端⼝S4(config-if)#switchport mode trunk --将端⼝设置为trunk模式S4(config-if)#interface f0/1 --进⼊端⼝S4(config-if)#switchport mode access --将端⼝设置为access模式S4(config-if)#switchport access vlan 30 --将端⼝划⼊vlan 30S4(config-if)#interface f0/2 --进⼊端⼝S4(config-if)#switchport mode access --将端⼝设置为access模式S4(config-if)#switchport access vlan 20 --将端⼝划⼊vlan 20S4(config-if)#interface f0/3 --进⼊端⼝S4(config-if)#switchport mode access --将端⼝设置为access模式S4(config-if)#switchport access vlan 10 --将端⼝划⼊vlan 10S4(config-if)#end --返回特权模式S4#copy running-config startup-config --保存配置[OK] --保存成功四、验证测试不同vlan下的主机是否互通(1)PC11与PC33vlan10与vlan30互通(2)PC13与PC21vlan10与vlan20互通。

三层交换机配置教程

三层交换机配置教程

三层交换机配置教程三层交换机是一种具有路由功能的交换机,可以实现不同网段之间的互联。

下面是三层交换机配置教程:1. 连接三层交换机:首先,将三层交换机与其他设备(如路由器或防火墙)进行连接,可以使用网线将它们连接起来。

确保连接的端口是正确的并且连接松紧适中。

2. 访问三层交换机:使用终端或电脑连接到三层交换机的管理端口。

通常,可以通过SSH或Telnet协议访问交换机的管理接口。

3. 进入交换机的命令行界面:成功连接到三层交换机后,输入正确的用户名和密码,进入交换机的命令行界面。

用户名和密码通常是事先设置好的。

4. 设置主机名:在交换机命令行界面中,使用命令"hostname [名称]"来设置交换机的主机名。

主机名可以是任何你喜欢的名称,但通常建议使用简洁的描述性名称。

5. 配置IP地址:使用命令"interface [接口号]"进入交换机的接口配置模式。

然后,使用"ip address [IP地址] [子网掩码]"命令为每个接口设置IP地址和子网掩码。

确保IP地址和子网掩码与网络规划一致。

6. 启用接口:为了使接口生效,使用"no shutdown"命令启用每个接口。

这将使接口进入工作状态。

7. 配置路由:三层交换机可以实现不同网段之间的路由功能。

为了配置路由,使用"ip route [目标网络] [目标子网掩码] [下一跳地址]"命令。

这将指定该网络的下一跳地址。

可以添加多个路由以实现完整的路由表。

8. 保存配置:确认完成配置后,使用命令"copy running-config startup-config"保存配置。

这将保存当前正在运行的配置为交换机的启动配置,以便在重新启动后仍然有效。

以上就是三层交换机配置的基本步骤。

根据实际需求,还可以进行更复杂的配置,如VLAN划分、安全设置、负载均衡等。

思科交换机简单配置(通用教程)

思科交换机简单配置(通用教程)

• 双工模式: Switch(config-if)#duplex ? auto Enable AUTO duplex configuration full Force full duplex operation half Force half-duplex operation
Switch(config-if)#duplex auto Switch(config-if)# • 端口描述 Switch(config-if)#description vlan 10 trunk Switch(config-if)#
配置ip地址的命令格式: ip address {ip-address} {netmask}
测试常用端口类型Acce来自s / trunk将此端口设置为vlan10 的access口 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)# 将此端口设置为vlan10 的trunk口 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan 10
Vlan设置
• Vlan设置范围:1---4094 • 在全局模式下配置vlan Switch#conf t Switch(config)#vlan 10 Switch(config-vlan)#name vlan10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#name vlan20 Vlan名称可以自行定义

思科三层交换机配置总结

思科三层交换机配置总结

思科交换机的基本配置命令学习CISCO交换机基本配置:Console端口连接用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;交换机口令设置:switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname csico ;设置交换机的主机名switch(config)#enable secret csico1 ;设置特权加密口令switch(config)#enable password csico8 ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;虚拟终端允许登录switch(config-line)#password csico6 ;设置虚拟终端登录口令csico6switch#exit ;返回命令交换机VLAN创建,删除,端口属性的设置,配置trunk端口,将某端口加入vlan中,配置VTP:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#vlan 3 name vlan3 ;建VLAN 3并命名为vlan3switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config)#speed ? 查看speed命令的子命令switch(config)#speed 100 设置该端口速率为100mb/s (10/auto)switch(config)#duplex ? 查看duplex的子命令switch(config)#duplex full 设置该端口为全双工(auto/half)switch(config)#description TO_PC1 这是该端口描述为TO_PC1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为trunk模式(access模式)switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain vtpserver ;设置vtp域名相同switch(config)#vtp password ;设置发vtp密码switch(config)#vtp server ;设置vtp服务器模式switch(config)#vtp client ;设置vtp客户机模式交换机设置IP地址,默认网关,域名,域名服务器,配置和查看MAC地址表:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address 192.168.1.1 255.255.255.0 ;设置IP地址switch(config)#ip default-gateway 192.168.1.6 ;设置默认网关switch(config)#ip domain-name 设置域名switch(config)#ip name-server 192.168.1.18 设置域名服务器switch(config)#mac-address-table? 查看mac-address-table的子命令switch(config)#mac-address-table aging-time 100 设置超时时间为100msswitch(config)#mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址在f0/3端口switch(config)#mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入静态地址目标端口f0/6源端口f0/7switch(config)#endswitch#show mac-address-table 查看整个MAC地址表switch#clear mac-address-table restricted static 清除限制性静态地址交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息switch#show int f0/0 status;查看指定端口状态switch#dir flash: ;查看闪存Cisco路由器配置命令大全网络 2010-06-26 06:43:44 阅读657 评论0 字号:大中小订阅 .(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"config t"全局配置模式----接口模式,使用命令"interface+接口类型+接口号"全局配置模式----线控模式,使用命令"line+接口类型+接口号"注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址配置IP地址secondary+IP地址为接口配置第二个IP地址show interface+接口类型+接口号查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码配置明文密码ena sec +密码配置密文密码line vty 0 4/15 进入telnet接口password +密码配置telnet密码line aux 0 进入AUX接口password +密码配置密码line con 0 进入CON接口password +密码配置密码bandwidth+数字配置带宽no ip address 删除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的谪要信息banner motd # +信息 + # 配置路由器或交换机的描素信息description+信息配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称创建VLANswitchport access vlan +vlan号为VLAN为配接口interface vlan +vlan号进入VLAN接口模式ip add +ip地址为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名配置SW的VTP域名vtp +password +密码配置SW的密码switchport mode trunk 启用中继no vlan +vlan号删除VLANshow spamming-tree vlan +vlan号查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface lookback 0 激活逻辑接口passive-interface +接口类型+接口号配置接口为被动模式debug ip +协议动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号激活EIGRP路由协议network +网段+子网掩码发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-IDencapsulation+封装格式更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能show user 查看SW的在线用户clear line +线路号清除线路3. 三层交换机配置命令配置一组二层端口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/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。

Cisco三层交换机VLAN的配置案例教学课件讲议

Cisco三层交换机VLAN的配置案例教学课件讲议
Cisco三层交换机VLAN的配置案例
2、各机房IP地址分配
机房一、二: IP:192.168.7.X/24,网关:192.168.7.254 机房三、四: IP:192.168.8.X/24,网关:192.168.8.254 机房五、六: IP:192.168.10.X/24,网关:192.168.10.254 机房七: IP:192.168.11.X/24,网关:192.168.11.254 服务器: IP:192.168.12.X/24 网关:192.168.12.254
3560(config)#access-list 102 deny ip 192.168.8.0 0.0.0.255 192.168.7.0 0.0.0.255 3560(config)#access-list 102 deny ip 192.168.8.0 0.0.0.255 192.168.10.0 0.0.0.255 3560(config)#access-list 102 deny ip 192.168.8.0 0.0.0.255 192.168.11.0 0.0.0.255 3560(config)#access-list 102 permit ip any any 3560(config)#access-list 103 deny ip 192.168.10.0 0.0.0.255 192.168.7.0 0.0.0.255 3560(config)#access-list 103 deny ip 192.168.10.0 0.0.0.255 192.168.8.0 0.0.0.255 3560(config)#access-list 103 deny ip 192.168.10.0 0.0.0.255 192.168.11.0 0.0.0.255 3560(config)#access-list 103 permit ip any any 3560(config)#access-list 104 deny ip 192.168.11.0 0.0.0.255 192.168.7.0 0.0.0.255 3560(config)#access-list 104 deny ip 192.168.11.0 0.0.0.255 192.168.8.0 0.0.0.255 3560(config)#access-list 104 deny ip 192.168.11.0 0.0.0.255 192.168.10.0 0.0.0.255 3560(config)#access-list 104 permit ip any any

如何配置三层交换机的详细方法

如何配置三层交换机的详细方法

如何配置三层交换机的详细方法配置三层交换机我们可以通过第三方软件来配置?具体配置方法是怎样呢?下面由店铺为你整理了如何配置三层交换机的相关方法,希望对你有帮助!配置三层交换机的方法步骤如下下载好pack软件后解压,如下图:解压后,安装pack(安装步骤省略),并运行,如下图:进入界面后,建立如下图所示(选择虚拟线:三条直通线,一条交叉线。

选择的虚拟pc:三台。

选择的虚拟交换机:二层交换机一个,三层交换机一个):进入二层交换机的CLI,配置成如下的参数(SW1>enSW1#conf tSW1(config)#interface FastEthernet0/1SW1(config-if)#switchport access vlan 10SW1(config)#interface FastEthernet0/2SW1(config-if)#switchport access vlan 20SW1(config)#interface FastEthernet0/3SW1(config-if)#switchport access vlan 30SW1(config-if)#do wrSW1(config-if)#exitSW1(config)#interface FastEthernet0/24SW1(config-if)#switchport mode trunkSW1(config-if)#exit验证结果:(最后要记得保存)SW1(config)#do show run如下图:)进入三层交换机的CLI,配置成如下的参数(Switch>Switch>enSwitch#Switch#conf tEnter configuration commands, one per line. End with CNTL/Z.Switch(config)#interface FastEthernet0/1Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunkSwitch(config)#interface Vlan10Switch(config-if)# ip address 192.168.1.1 255.255.255.0Switch(config)#interface Vlan20Switch(config-if)# ip address 192.168.2.1 255.255.255.0Switch(config)#interface Vlan30Switch(config-if)# ip address 192.168.3.1 255.255.255.0验证结果:(最后要记得保存)Switch#show#show run如下图:)用其中PC机,验证结果:即ping通全网,如下图:。

三层交换机与路由器的配置 实例(图解)

三层交换机与路由器的配置 实例(图解)

三层交换机与路由器的配置实例(图解)本文档旨在提供关于如何配置三层交换机与路由器的详细指南,并附有具体实例和图解。

下面将按照章节细化介绍。

1.交换机与路由器的基本概念及作用
1.1 交换机的作用与工作原理
1.2 路由器的作用与工作原理
2.三层交换机与路由器的区别与联系
2.1 三层交换机的特点和应用场景
2.2 路由器的特点和应用场景
3.三层交换机与路由器的配置前准备
3.1 设备检查与准备
3.2 网络规划与拓扑设计
4.三层交换机的配置步骤
4.1 连接与登录交换机
4.2 设置管理IP地质
4.3 配置VLAN
4.4 配置三层交换机的IP路由功能
5.路由器的配置步骤
5.1 连接与登录路由器
5.2 设置管理IP地质
5.3 配置静态路由
5.4 配置动态路由协议
6.三层交换机与路由器的互通配置
6.1 网络互通的基本原理
6.2 配置路由器与交换机之间的互联
6.3 配置路由器与其他网络设备的互联
7.实际案例分析与图解
7.1 案例一:简单局域网互通配置
7.2 案例二:跨网段通信配置
7.3 案例三:路由器的互联配置
附件:
本文档不涉及附件内容。

法律名词及注释:
1.三层交换机:三层交换机(Layer 3 Switch)是一种将交换机和路由器两者功能集成在一起的网络设备。

它具备交换机的高速交换与路由器的一些路由功能。

2.路由器:路由器(Router)是用于将数据包在互联网络中转发的网络设备。

它根据目的地IP地质来决定下一跳的路径,实现网络间的通信。

Cisco三层交换机配置命令及解释

Cisco三层交换机配置命令及解释

Cisco三层交换机配置命令及解释1、2、DEBUG命令3、思科交换机⽇志管理查看⽇志:show loggingCisco交换机 SNMP配置——————————————————————————————————————基本配置S> enable 进⼊特权模式S# configure terminal 进⼊全局配置模式S(config)# hostname name 改变交换机名称S(config)# enable password level level_# password 设置⽤户⼝令(level_#=1)或特权⼝令(level_#=15)S(config)# line console 0 进⼊控制台接⼝S(config-line)# password console_password 接上⼀条命令,设置控制台⼝令S(config)# line vty 0 15 进⼊虚拟终端S(config-line)# password telnet_password 接上⼀条命令,设置Telnet⼝令S(config-line)# login 允许Telnet登录S(config)# enable password|secret privilege_password 配置特权⼝令(加密或不加密)S(config)# interface ethernet|fastethernet|gigabitethernet slot_#/port_# 进⼊接⼝⼦配置模式S(config-if)# [no] shutdown 关闭或启⽤该接⼝(默认启⽤)S(config)# ip address IP_address sunbet_mask 指定IP地址S(config)# ip default-gateway router's_IP_address 指定哪台路由器地址为默认⽹关S# show running-config 查看当前的配置S# copy running-config startup-config 将RAM中的当前配置保存到NVRAM中S> show interface [type slot_#/port_#] 查看所有或指定接⼝的信息S> show ip 显⽰交换机的IP配置(只在1900系列上可⽤)S> show version 查看设备信息S# show ip interface brief 验证IP配置S(config-if)# speed 10|100|auto 设置接⼝速率S(config-if)# duplex auto|full|half 设置接⼝双⼯模式S> show mac-address-table 查看CAM表S# clear mac-address-table 清除CAM表中的动态条⽬1900(config)# mac-address-table permanent MAC_address type [slot_#/]port_# 在CAM表中创建静态条⽬2950(config)# mac-address-table static MAC_address vlan VLAN_# interface type [slot_#/] port_# 在CAM表中创建静态条⽬1900(config)# mac-address-table restricted static MAC_address source_port list_of_allowed_interface 设置静态端⼝安全措施1900(config-if)# port secure 启⽤粘性学习1900(config-if)# port secure max-mac-count value 设置粘性学习特性能够学到的地址数量(默认132,取值范围是1-132)1900(config)# address-violation suspend|ignore|disable 改变安全选项1900> show mac-address-table security 验证端⼝安全措施2950(config)# switchport mode access 定义接⼝为主机端⼝⽽不是中继端⼝2950(config)# switchport port-security 启⽤端⼝安全措施2950(config)# switchport port-security maximum value 指定可与此接⼝相关的设备的最⼤数量2950(config)# switchport port-security violation protect|restrict|shutdown 指定出现安全违规时应该发⽣的事2950(config)# switchport port-security mac-address MAC_address 指定允许与此接⼝相关的确切的MAC地址2950(config)# switchport port-security mac-address sticky 启⽤粘性学习特性2950(config)# show port interface type [slot_#/] port_# 验证接⼝配置2950(config-if) description name 设置接⼝描述信息2950# show buffers 查看系统缓存的⼤⼩1900# copy nvram tftp:// IP_address_of_TFTP_server/ file_name 将配置⽂件备份到TFTP服务器上1900# copy tftp:// IP_address_of_TFTP_server/ file_name nvram 从TFTP服务器上恢复配置到NVRAM1900# delete nvram 删除配置⽂件2950# erase startup-config 删除配置⽂件3550# show tcam qos TCAM_ID statistics 查看TCAM剩余容量4000> enable 进⼊特权模式4000>(enable) set password 设置⽤户模式密码4000>(enable) set enablepass 设置授权密码4000>(enable) set interface sc0 IP_address mask 配置IP地址4000>(enable) set port enable|disable slot_#/port_# 启⽤/禁⽤接⼝4000>(enable) show port [slot_#/port_#] 显⽰接⼝信息4000>(enable) set port name slot_#/port_# name 设置交换机接⼝描述信息4000>(enable) set port speed slot_#/port_# 4|10|16|100|auto 设置交换机接⼝速率4000>(enable) set port duplex slot_#/port_# full|half 设置交换机接⼝双⼯模式4000>(enable) clear config all 删除NVRAM中的配置信息4000>(enable) erase all 删除FLASH中的内容4000>(enable) show flash 显⽰FLASH中的内容4000>(enable) show cam [count] dynamic|static|permanent|system [vlan_#] 显⽰CAM表VLAN 1900(config)# vtp domain VTP_domain_name 定义交换机域名1900(config)# vtp server|client|transparent 定义交换机VTP模式(默认服务器)1900(config)# vtp password VTP_password 配置VTP⼝令1900(config)# vtp pruning enable|disable 启⽤/禁⽤修剪(默认启⽤)1900(config)# vtp trap enable 启⽤SNMP陷阱(默认启⽤)1900# show vtp 验证VTP配置2950# vtp database 访问VLAN和VTP配置(以下均是在IOS12.1前⽤,12.1后全是在全局配置模式下)2950(vlan)# vtp domain VTP_domain_name 定义交换机域名2950(vlan)# vtp server|client|transparent 定义交换机VTP模式(默认服务器)2950(vlan)# vtp password VTP_password 配置VTP⼝令2950(vlan)# vtp pruning 启⽤/禁⽤修剪(默认启⽤)2950(config)# snmp-server enable traps vtp 启⽤SNMP陷阱(默认启⽤)2950# show vtp status 检查VTP配置2950# show vtp counters 显⽰与VTP消息发送与接收相关的VTP统计信息1900(config-if)# trunk on|off|desirable|auto 指定中继类型1900# show trunk A|B 验证接⼝中继(A是fa0/26,B是fa0/27)2950(config-if)# switchport mode trunk|dynamic desirable|dynamic auto|nonegotiate 指定中继类型(默认⾃动协商)2950(config-if)# switchport trunk native|allowed|pruning vlan VLAN_# 配置中继2950(config-if)# switchport trunk pruning vlan remove VLAN_# 清除不希望消减的VLAN2950# show interfaces [type 0/port_#] switchport|trunk 验证接⼝中继1900(config)# vlan VLAN_# [name VLAN_name] 创建VLAN1900(config-if)# vlan-membership static VLAN_# 将该接⼝静态地分配给⼀个VLAN1900# show vlan 验证VLAN1900# show vlan-membership 查看VLAN成员关系1900# show spantree [VLAN_#] 查看VLAN的STP信息2950# vlan database 进⼊VLAN数据库(ISO12.1前⽤)2950(vlan)# vlan VLAN_# [name VLAN_name] 创建VLAN2950(config)# vlan VLAN_# 进⼊VLAN数据库(ISO12.1后⽤)2950(config-vlan)# name VLAN_name 创建VLAN2950(config-if)# switchport mode access 指定连接是接⼊链路连接2950(config-if)# switchport access vlan VLAN_# 指定VLAN是接⼊链路连接4000>(enable) set vlan VLAN_# name VLAN_name 配置VLAN4000>(enable) set vlan VLAN_# slot_#/port_#-port_# 为VLAN分配端⼝4000>(enable) set trunk slot_#/port_# [on|off|desirable|auto|nonegotiate] [VLAN_#] [isl|dot1q|dot10|lane|negotiate] 配置中继4000>(enable) clear trunk slot_#/port_# VLAN_# 删除VLAN4000>(enable) show trunk slot_#/port_# 验证中继端⼝4000>(enable) set vtp v2 enable 配置VTPv24000>(enable) set vtp [domain name] [mode client|server|transparent] [passwd password] [pruning enable|disable] [v2 enable|disable] 设置VTP4000>(enable) show vtp domain 验证VTP域的信息4000>(enable) show vtp statistics 显⽰发出或收到的VTP通告信息的摘要内容4000>(enable) set vtp pruneeligible VLAN_# 设置VTP消减4000>(enable) clear vtp pruneeligible VLAN_# 清除不希望消减的VLANSTP 4000>(enable) set spantree enable|disable VLAN_# 启⽤/禁⽤STP(默认启⽤)2950(config)# [no] spanning-tree vlan VLAN_# 启⽤/禁⽤STP(默认启⽤)4000>(enable) show spantree [VLAN_#] 验证STP状态2950# show spanning-tree 验证STP状态4000>(enable) set spantree root [secondary] VLAN_# [dia network_diameter] [hello hello_time] 设置主根节点桥、备份节点桥、最⼤桥数量(2-7)、持续时间(1-10,默认2)4000>(enable) set spantree portcost slot_#/port_# cost_# 设置端⼝开销2950(config-if)# spanning-tree cost cost_# 设置端⼝开销4000>(enable) set spantree portpri slot_#/port_# priority_# 设置端⼝优先级4000>(enable) set spantree portvlanpri slot_#/port_# priority_# [VLAN_#] 改变VLAN的优先级设置2950(config-if)# spanning-tree vlan VLAN_# port-priority priority_# 设置端⼝优先级4000>(enable) set spantree fwddelay delay_# [VLAN_#] 设置从侦听状态到学习状态再到转发状态的时间间隔(默认15秒,取值范围是4-30秒)4000>(enable) set spantree hello interval_time [VLAN_#] 设置根节点交换机发送BPDU的时间间隔(默认2秒,取值范围是1-10秒)4000>(enable) set spantree maxage agingtime [VLAN_#] 设置交换机持有BPDU的时间(默认20秒,取值范围是6-40秒)2950(config)# spanning-tree vlan VLAN_# forward-time forward_time 设置从侦听状态到学习状态再到转发状态的时间间隔(默认15秒,取值范围是4-30秒)2950(config)# spanning-tree vlan VLAN_# hello-time hello_time 设置根节点交换机发送BPDU的时间间隔(默认2秒,取值范围是1-10秒)2950(config)# spanning-tree vlan VLAN_# max-age maxage 设置交换机持有BPDU的时间(默认20秒,取值范围是6-40秒)4000>(enable) set port channel slot_#/port_# on 建⽴以太通道集合4000>(enable) show port capabilities slot_#/port_# 查看端⼝的配置4000>(enable) show port channel 验证以太通道集合的配置2950(config-if)# channel-group group_number mode auto|desirable|on 建⽴以太通道集合2950# show etherchannel group_number|brief|detail|load-balance|port|port-channel|summary 验证以太通道集合的配置4000>(enable) set spantree portfast slot_#/port_# enable 配置PortFast2950(config-if)# spanning-tree portfast 配置PortFast4000>(enable) set spantree uplinkfast enable|disable [rate station_update_rate] [all-protocols off|on] 启⽤/禁⽤UplinkFast4000>(enable) show spantree uplinkfast 验证UplinkFast配置2950(config)# spanning-tree uplinkfast [max_update_rate] 启⽤/禁⽤UplinkFast2950# show spanning-tree uplinkfast 验证UplinkFast配置4000>(enable) set spantree backbonefast enable|disable 启⽤/禁⽤BackboneFast4000>(enable) show spantree backbonefast 验证BackboneFast配置2950(config)# spanning-tree backbonefast 启⽤BackboneFast虚拟⽹间路由2600(config)# interface type slot_#/port_#.subint_number 配置⼦接⼝2600(config-subif)# encapsulation dot1q|isl|sde|tr-isl VLAN_# 配置封装类型4000>(enable) show module 查看交换机的硬件配置4000>(enable) session module_# 访问L3SML3SM(config-if)# mac-address mac_address 分配MAC地址MLS 2600(config)# mls rp ip 启动MLS2600(config-if)# mls rp vtp-domain domain_name 分配路由器接⼝到VTP域中2600(config-if)# mls rp vlan-id VLAN_# 向接⼝分配VLAN2600(config-if)# mls rp management-interface 指定该接⼝为管理接⼝2600# show mls rp 提供全局MLS信息2600# show mls rp interface type slot_#/port_# 提供指定接⼝的MLS信息2600# show mls rp vtp-domain domain_name 提供VTP域的MLS信息6500>(enable) set mls enable 在MLS-SE上启动MLS6500>(enable) set mls include rp_ip_address 告诉交换机哪⼀个IP地址是正确的6500>(enable) show mls include 显⽰外部路由处理器的IP地址列表6500>(enable) set mls flow [destination|destination-source|full] 告诉MLS交换机要缓存候选数据包的哪些信息6500>(enable) show mls entry 显⽰第三层缓存表6500>(enable) set mls agingtime aging_time 改变缓存的衰⽼时间(默认256秒,取值范围是8-2032秒中的8的倍数值)6500>(enable) set mls agingtime fast fast_aging_time pkt_threshold 改变快速衰⽼周期和数据包门限值6500>(enable) show mls ip 验证MLS-SE的配置6500>(enable) clear mls entry [destination IP_address] [source IP_address] [flow protocol] [source_port] [destination_port] [all] 删除所有或指定MLS缓存记录3550(config)# ip routing 启动IP路由3550(config)# ip cef 启动CEF3550(config-if)# no switchport 将第⼆层接⼝转换为第三层接⼝3550(config-if)# ip route-cache cef 在接⼝上启动CEF3550# show ip cef 验证CEF组播3640(config)# ip multicast-routing 启动路由器上的组播服务3640(config-if)# ip pim dense-mode 将接⼝设置为PIM密集模式3640(config-if)# ip pim sparse-mode 将接⼝设置为PIM稀疏模式3640(config-if)# ip pim sparsed-dense-mode 将接⼝设置为PIM稀疏-密集模式3640(config)# ip pim rp-address IP_address group_ACL_# [override] ⼿⼯配置RP3640(config)# ip pim send-rp-announce type slot_#/port_# scope ttl_value group-list ACL_# 通告RP组的分配3640(config)# ip pim send-rp-discovery scope ttl_value 配置RP映射代理3640(config-if)# ip multicast ttl-threshold ttl_value 设置TTL门限值3640(config-if)# ip igmp join-group group_address 加⼊组播组3640# show ip mroute 查看组播信息3640# ping 验证RP之间或其他组播路由器之间的连接3640# mtrace source_IP_address [destination_IP_address] [group] 组播traceroute3640(config-if)# ip cgmp 配置CGMP路由器4000>(enable) set cgmp enable 启动CGMP4000>(enable) show cgmp statistics 查看CGMP统计信息4000>(enable) show multicast group cgmp 查看交换机了解到的组播组信息4000>(enable) set cgmp leave enable 检查由客户端产⽣的IGMPv2的离开信息4000>(enable) set igmp enable 启动IGMP4000>(enable) ip igmp snooping 启动IGMP探听4000>(enable) set igmp fastleave enable 启动快速离开过程4000>(enable) show igmp statistics 显⽰交换机上IGMP探听的状态信息QoS 2950(config)# wrr-queue cos-map queue_ID cos_value 建⽴队列2950(config)# wrr-queue bandwidth bandwidth_value 设置队列门限2950(config)# class-maps name 定义对信息传输分类时的匹配标准2950(config-cmap)# match access-group ACL_# 识别被分类的信息传输2950(config)# policy-map name 确定为接⼊信息传输所设置的分类标准2950(config-pmap)# class name2950(config-pmap-c)# set ip dscp number2950(config-if)# service-policy input name 对该接⼝应⽤策略3550(config)# mls qos 启动QoS3550(config-if)# auto qos voip 在接⼝上启动⾃动服务质量3550(config)# priority-list priority_queue_# protocol protocol high|medium|normal|low [list ACL_#] 为优先级队列定义信息流3550(config)# priority-list priority_queue_# queue-limit limit_# 定义特定优先级队列的最⼤队列空间3550(config-if)# priority-group priority_queue_# 向特定输出接⼝分配优先级队列3550(config)# queue-list queue_list_# interface type slot_#/port_# queue_number 为⼀个特定的定制队列定义信息流3550(config)# queue-list queue_list_# queue queue_number byte-count size_in_bytes [limit number_of_queue] 为特定的定制队列定义队列的最⼤空间3550(config-if)# custom-queue-list custom_queue_number 为特定的输出接⼝分配优先级队列4840(config)# ip slb serverfarm serverfarm_name 配置SLB冗余4840(config-slb-sfarm)# real IP_address [port_#] 指定虚拟IP地址4840(config-slb-sfarm)# inservice 启动服务器4840(config)# virtual IP_address [network_mask] tcp|udp [port_number|wsp|wsp-wtp|wsp-wtls|wsp-wtp-wtls] [service service_name] 建⽴虚拟服务器IP地址h。

配置思科三层交换的综合案例

配置思科三层交换的综合案例

配置思科三层交换的综合案例网络基本情况网络拓扑结构为:中心交换机采用Cisco Catalyst 4006-S3,Supervisor Engine III G引擎位于第1插槽,用于实现三层交换;1块24口1000Base-T模块位于第2插槽,用于连接网络服务器;1块6端口1000Base-X模块位于第3插槽,用于连接6台骨干交换机。

一台交换机采用Cisco Catalyst 3550-24-EMI,并安装1块1000Base-X GBIC千兆模块。

一台交换机采用Cisco Catalyst 3550-24-SMI,也安装1块1000Base-X GBIC千兆模块。

另外四台交换机采用Cisco Catalyst 2950G-24-SMI,安装1块1000Base-T GBIC千兆模块。

所有服务器划分为一个VLAN,即VLAN 50。

四台Catalyst 2950G-24-SMI交换机也只划分为一个VLAN,分别为VLAN 60、VLAN 70、VLAN 80和VLAN 90。

Catalyst 3550-24-EMI划分为4个VLAN,分别为VLAN 10、VLAN 20、VLAN 30和VLAN 40。

Catalyst 3550-24-SMI划分2个VLAN,分别为VLAN 60和VLAN 80,与另外两台Catalyst 2950G-24-SMI交换机分别位于同一VLAN。

***************************实例分析****************************由于所有Catalyst 2950G交换机都是一个独立的VLAN,因此,必须先在这些交换机上创建VLAN(VLAN 60~VLAN 90),并将所有端口都指定至该VLAN。

然后,再在Catalyst 4006交换机相应端口上分别创建VLAN。

Catalyst 4006的1000Base-X端口分别与各Catalyst 2950G的1000Base-X端口连接。

2、思科模拟器 实验二(三层交换机VLAN配置)hao

2、思科模拟器 实验二(三层交换机VLAN配置)hao

思科模拟器三层交换机VLAN配置一、实验拓扑图:交换机switch 1的端口fei_0/1和交换机switch 2的端口fei_0/1属于VLAN 10;交换机switch 1的端口fei_0/2和交换机switch 2的端口fei_0/2属于VLAN 20,均为Access端口。

两台交换机通过端口fei_0/16以Trunk方式连接,两端口为Trunk端口。

二、操作步骤:1、在switch 1上配置VLAN10和VLAN20,VLAN10的成员包括fei_0/1和上行端口fei_0/16,VLAN20的成员包括fei_0/2上行端口fei_0/16。

2、在switch 2上配置VLAN10和VLAN20,VLAN10的成员包括fei_0/1和上行端口fei_0/16,VLAN20的成员包括fei_0/2和上行端口fei_0/16。

switch 1配置命令如下:ZXR10>enableZXR10#vlan database------在特权模式下配置VLAN数据库ZXR10(vlan)#vlan 10-------创建VLAN 10ZXR10(vlan)#vlan 20------创建VLAN 20ZXR10(vlan)#exitZXR10#configure terminalZXR10(config)#1、进入端口fei_0/1,把端口fei_0/1加入vlan 10,fei_0/1模式为access;ZXR10(config)#interface fastethernet 0/1ZXR10(config-if)#switchport mode accessZXR10(config-if)#switchport access vlan 10ZXR10(config-if)#exit2、进入端口fei_0/2,把端口fei_0/2加入vlan 20,fei_0/2模式为access;ZXR10(config)#interface fastethernet 0/2ZXR10(config-if)#switchport mode accessZXR10(config-if)#switchport access vlan 20ZXR10(config-if)#exit3、进入fei_0/16端口,将该端口设置成trunk模式,并且把端口fei_0/16以trunk模式加入vlan10,vlan 20ZXR10(config)#interface fastethernet 0/16ZXR10(config-if)#switchport mode trunkZXR10(config-if)#switchport trunk allowed vlan 10,20ZXR10(config-if)#endZXR10#write---------保存文件(备注:switch 2配置命令同switch 1一样)三、验证方法:1. PC-1和PC-2不能互通,PC-3和PC-4不能互通2. PC-1和PC-3互通,PC-2和PC-4互通。

三层交换机路由配置

三层交换机路由配置

模块2 三层交换机与路由器间 静态路由的建立
1. 教学目标 □ 掌握三层交换机连接路由器的方法 □ 掌握三层交换机静态路由配置技能
2. 工作任务
某校园局域网由若干台交换机构成,现学校需要将 校园网接入互联网,学校在出口使用一台路由器连接互 联网。请做静态路由配置实现三层交换机通过SVI和路由 器之间的互通。
4. 相关理论知识
□ 三层交换机上路由接口 (1)设置交换机路由口
通过命令开启三层交换机的接口的路由功能(默认 是关闭的),然后可以在接口上配置IP地址 。 例如:设置端口fastethernet 0/20为路由口
switch(config)#interface fastethernet 0/20 switch(conifg-if)#no switchport switch(conifg-if)#ip; switch(conifg-if)#no shutdown
项目九 三层交换机路由配置
1.教学目标
□掌握三层交换机工作原理及其与路由器的区 别,正确理解三层交换机在局域网中作用,熟练配 置三层交换机相关参数,具体如下:
(1)掌握三层交换机Vlan间路由建立方法 (2)掌握三层交换机与路由器间静态路由配置技 能 (3)掌握三层交换机动态路由协议RIP及OSPF的 配置技能
192.168.10.1/24S3550-24
Vlan20
192.168.20.2/24 Fa1
Fa 0/10
Fa 0/20
RouterA Fa0 192.168.30.1/24
PC1
192.168.20.1/24
PC2
Vlan10
PC1: IP地址:192.168.10.10 掩码:255.255.255.0 网关:192.168.10.1

三层交换机路由配置

三层交换机路由配置

路由协议性能问题及解决方案
总结词
路由协议性能问题是指在网络中,由于路由 协议的运行效率低下或资源占用过高,导致 网络性能下降。
详细描述
路由协议性能问题可能由多种原因引起,如 路由表过大、路由收敛时间过长、资源占用 过高等。这些问题可能导致网络延迟增加、 数据包丢失或网络拥塞等问题。
路由协议性能问题及解决方案
性能
三层交换机在数据交换和路由方面具有更高的性 能,适用于大规模网络。
功能
路由器具有更多的路由功能,如NAT、VPN等, 而三层交换机主要侧重于数据交换和路由。
02
三层交换机路由配置基 础
IP地址及子网掩码
IP地址
用于标识网络中的设备,由32位二进 制数字组成,通常以点分十进制格式 表示,如192.168.1.1。
解决方案:为解决路由协 议不匹配问题,可以采用 以下方法
在路由器上启用兼容模式 或特定路由协议的映射功 能,以确保不同协议之间 的正确通信。
ABCD
选择支持多种路由协议的 路由器,以便更好地与其 他厂商或型号的路由器进 行互操作。
在网络规划阶段,充分了 解各种路由协议的特点和 限制,合理选择适合的协 议和设备。
定期维护和检查路由配置
总结词
定期维护和检查路由配置是保持网络性能和稳定性的必 要措施。
详细描述
定期检查路由配置可以及时发现并解决潜在的网络问题 ,如路由环路、配置错误等。同时,应定期备份路由配 置,以便在需要时恢复网络设置。此外,还应关注网络 安全威胁,及时更新安全补丁,以保障网络的安全稳定 运行。
三层交换机路由配置
目录
• 三层交换机概述 • 三层交换机路由配置基础 • 三层交换机路由配置实例 • 三层交换机路由配置问题及解决方案 • 三层交换机路由配置优化建议
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Cisco三层交换机网络配置方案二vlan设置此处的实验划分了3个vlan,一个服务器组,一个子站的主环形通道,一个子站的备环形通道。

如果有多个环形通道,按照文章中的主备环形通道的配置方法增加配置即可。

本片文章是以Cisco 3560编写的,配置3750与3560不一样的地方会在每一部分的开头标出,如果没有标出就是两种交换机的配置方法是一样的。

如果配置的是3750(或者其他型号的可堆叠Cisco交换机),请先参阅4.6。

2.1 进入配置模式2.1.1 进入特权模式Switch>en如图6所示。

图 62.1.2 进入配置模式Switch#configure terminal如图7所示。

hou图7进入配置模式后就可以开始划分vlan了(关于“模式”的解释请查阅4.2)。

2.2 划分vlan2.2.1 配置交换机的名称Switch(config)#hostname switch1如图8所示。

图82.2.2 划分3个vlanswitch1(config)#vlan 10 !全局配置模式下进入vlan模式并创建vlan10 switch1(config-vlan)#name commmaster !把vlan10命名为commmasterswitch1(config-vlan)#vlan 20 !vlan模式下创建vlan20switch1(config-vlan)#name commbak !把vlan20命名为commbakswitch1(config-vlan)#vlan 30 !vlan模式下创建vlan30switch1(config-vlan)# name server !把vlan30命名为serverswitch1naswitch1(config)#如图9所示。

图92.2.3 分配端口3560端口1的名称是g0/1,3750堆叠后交换机1的端口1名称是Gi1/0/1。

交换机端口的名字是什么可在特权模式(即switch1#)下用sh vlan brief查看。

2.2.3中的命令是在3560下做的测试。

gi1/0/21-22switch1(config)#interface range g0/1-2 !进入一组端口g0/1-2switch1(config-if-range)#switchport mode access !配置这组端口的模式为接入模式(可省略)switch1(config-if-range)#switchport access vlan 10 !把该组端口接入到vlan10switch1(config-if-range)#interface range g0/23-24 !同上switch1(config-if-range)#switchport mode accessswitch1(config-if-range)#switchport access vlan 20switch1(config-if-range)#interface range g0/13-14switch1(config-if-range)#switchport mode accessswitch1(config-if-range)#switchport access vlan 30switch1(config-if-range)#exitswitch1(config)# !退回到全局配置模式如图10所示。

图10备注:如果想把交换机的g0/1端口分配给多个vlan,比如分给配vlan 10,vlan 20,valn 30,那么必须将g0/1端口设置为trunk。

步骤解析1、switch1(config)#interface range g0/1 !是进入要分配的端口2、switchport trunk encapsulation dot1q !是将gi1/0/11封装成trunk,必须先封装;3、switchport mode trunk !是将g0/1端口模式改为trunk模式4、switchport trunk allowed vlan 10,20,30 !是指将g0/1端口同时分配给vlan 10,vlan 20,vlan30这时,这g0/1端口,可以供vlan 10,vlan 20,vlan30三个网段同时使用了。

回到“特权模式”可用show run可进行全局配置查看扩展:switchport为交换接口No switchport 即为非交换接口2.3.4 设置网关为每个vlan设置网关,划分网段。

子站RTU或者主站计算机配置上所属vlan 的子网IP、网关,启动路由后即可进行主站与子站之间的通信。

switch1(config)#interface vlan 10 !进入SVI端口vlan 10(关于“SVI”,请查阅4.3) 如果给端口分配IP,进入端口int gi0/1;改变端口模式no switchport;然后可配置IP。

switch1(config-if)#ip address 10.202.31.1 255.255.255.0 !设置vlan 10的端口网关、子网掩码switch1(config-if)#no shutdown !将该端口激活switch1(config-if)#interface vlan 20 !同上switch1(config-if)#ip address 10.202.32.1 255.255.255.0switch1(config-if)#no shutdownswitch1(config-if)#interface vlan 30switch1(config-if)#ip address 192.168.1.1 255.255.255.0switch1(config-if)#no shutdownswitch1(config-if)#exit !退回到全局配置模式switch1(config)#ip routing !启动路由功能Switch1(config)#如图11所示。

图112.3.5 设置ACL公司项目的需求:各个子站之间不能相互访问,主站与各个子站之间可以相互访问。

那么这就需要设置访问控制列表(Access Control List)。

为vlan 10 设置访问控制列表,vlan 10里的RTU只允许与192.168.1.0(即服务器组的主机)网段的主机通信。

switch1(config)#access-list 110 permit ip 10.202.31.0 0.0.0.255 10.10.1.0 0.0.0.255!10.202.31.0是源地址网段,192 .168.1.0是目的地址网段。

0.0.0.255是反向掩码,是掩码的取反。

access-list 107 permit ip 10.202.107.0 0.0.0.255 10.10.1.0 0.0.0.255switch1(config)#access-list 110 deny ip 10.202.31.0 0.0.0.255 anyswitch1(config)#interface vlan 10 (如果接入端口,则int gi0/1)swith1(config-if)#ip access-group 110 inswitch1(config-if)#exitswitch1(config)#同上,为vlan 20 设置访问控制列表。

switch1(config)#access-list 120 permit ip 10.202.32.0 0.0.0.255 192.168.1.0 0.0.0.255switch1(config)#access-list 120 deny ip 10.202.32.0 0.0.0.255 anyswitch1(config)#interface vlan 20swith1(config-if)#ip access-group 120 inswitch1(config-if)#exitswitch1(config)#exitswitch1#访问控列表的序号取值的范围查阅4.4。

vlan之间的通信默认都是允许的,服务器组(位于vlan 30中)需要允许各子站访问,所以不需要为vlan 30设置访问控制列表。

对vlan 10、vlan20的设置如图12所示。

图12最后需要对做的配置信息保存。

switch1#write保存配置,在没输入该命令,Cisco设备是不保存配置的,如果设备重启,期间所做的配置将不会生效。

如图13。

图13至此对vlan的设置已经完成。

如果配置过程中,由于某种原因需要删除,以重新配置请参阅4.5。

如果遇到:server可以拼通自己的网关(如只能拼通自己192.168.1.1,其余子站拼不通),而其余子站VLAN也不可用(拼不通自己网关),说明ACL 设置有问题,删除之前的ACL,重新设置。

2.3 显示设置的效果2.3.1 显示vlanswitch1#show vlan brief如图14示。

图142.3.2 显示路由switch1#show ip route如图15所示。

(交换机端口接设备后,才会显示对应VLAN的路由)图152.3.3 显示访问控制列表switch1#show access-list如图16所示。

图162.3.4显示全局配置show run可查看所有配置,包括trunk.三测试准备一台三层交换机,两个傻瓜交换机(即不可配置的两层交换机),3台计算机,网线7根。

在交换机上,服务器组(vlan 30)的端口有13、14,选择一根网线、一台计算机。

网线一端插入交换机的13(或14)端口,一端插入一台计算机A(计算机的ip:192.168.1.2,子网掩码255.255.255.0,网关192.168.1.1)。

主环形通道(即vlan 10)的端口有1、2,选择3根网线、一个傻瓜交换机、一台计算机。

两根网线的一端分别插入交换机的端口1、端口2,另外一端分别插到傻瓜交换机上。

选择一根网线,一端插入傻瓜交换机,另一端插入计算机B(计算机的ip:10.202.31.2,子网掩码:255.255.255.0,网关:10.202.31.1)。

备环形通道(即vlan 20)的端口有23、24,选择3根网线、一个傻瓜交换机、一台计算机。

两根网线的一端分别插入端口23、端口24,另外一端插到傻瓜交换机上。

另一根网线一端插入傻瓜交换机,其余一端插入计算机C(计算机ip:10.202.32.1,子网掩码:255.255.255.0,网关:10.202.32.1)。

3.1 在服务器上ping子站ping计算机B,如图17所示。

相关文档
最新文档