思科三层交换机配置实例.docx

上传人:牧羊曲112 文档编号:3520429 上传时间:2023-03-13 格式:DOCX 页数:7 大小:37.97KB
返回 下载 相关 举报
思科三层交换机配置实例.docx_第1页
第1页 / 共7页
思科三层交换机配置实例.docx_第2页
第2页 / 共7页
思科三层交换机配置实例.docx_第3页
第3页 / 共7页
思科三层交换机配置实例.docx_第4页
第4页 / 共7页
思科三层交换机配置实例.docx_第5页
第5页 / 共7页
亲,该文档总共7页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《思科三层交换机配置实例.docx》由会员分享,可在线阅读,更多相关《思科三层交换机配置实例.docx(7页珍藏版)》请在三一办公上搜索。

1、思科三层交换机配置实例思科三层交换机配置实例 Enable /进入特权模式 Configure terminal /进入全局模式 service password-encryption /对密码进行加密 hostname Catalyst 3550-12T1 /给三层交换机定义名称 enable password 123456. /enable密码 Enable secret 654321 /enable的加密密码 Ip subnet-zero /允许使用全0子网 Ip name-server 172.16.8.1 172.16.8.2 /三层交换机名字Catalyst 3550-12T1对应

2、的IP地址是172.16.8.1 Service dhcp /提供DHCP服务 ip routing /启用三层交换机上的路由模块 Exit Vtp mode server /定义VTP工作模式为sever模式 Vtp domain centervtp /定义VTP域的名称为centervtp Vlan 2 name vlan2 /定义vlan并给vlan取名 Vlan 3 name vlan3 Vlan 4 name vlan4 Vlan 5 name vlan5 Vlan 6 name vlan6 Vlan 7 name vlan7 Vlan 8 name vlan8 Vlan 9 nam

3、e vlan9 Exit interface Port-channel 1 /进入虚拟的以太通道组1 switchport trunk encapsulation dot1q /给这个接口的trunk封装为802.1Q的帧格式 switchport mode trunk /定义这个接口的工作模式为trunk switchport trunk allowed vlan all /在这个trunk上允许所有的vlan通过 Interface gigabitethernet 0/1 /进入模块0上的吉比特以太口1 switchport trunk encapsulation dotlq /给这个接口

4、的trunk封装为802.1Q的帧格式 switchport mode trunk /定义这个接口的工作模式为trunk switchport trunk allowed vlan all /在这个trunk上允许所有的vlan通过 channel-group 1 mode on /把这个接口放到快速以太通道组1中 Interface gigabitethernet 0/2 /同上 switchport trunk encapsulation dotlq switchport mode trunk switchport trunk allowed vlan all channel-group

5、1 mode on port-channel load-balance src-dst-ip /定义快速以太通道组的负载均衡方式 interface gigabitethernet 0/3 /进入模块0上的吉比特以太口3 switchport trunk encapsulation dotlq /给trunk封装为802.1Q switchport mode trunk /定义这个接口的工作模式为trunk switchport trunk allowed vlan all /允许所有vlan信息通过 interface gigabitethernet 0/4 /同上 switchport t

6、runk encapsulation dotlq switchport mode trunk switchport trunk allowed vlan all interface gigbitethernet 0/5 /同上 switchport trunk encapsulation dotlq switchport mode trunk switchport trunk allowed vlan all interface gigbitethernet 0/6 /同上 switchport trunk encapsulation dotlq switchport mode trunk s

7、witchprot trunk allowed vlan all interface gigbitethernet 0/7 /进入模块0上的吉比特以太口7 Switchport mode access /定义这个接口的工作模式为访问模式 switchport access vlan 9 /定义这个接口可以访问哪个vlan no shutdown spanning-tree vlan 6-9 cost 1000 /在生成树中,vlan6-9的开销定义为10000 interface range gigabitethernet 0/8 10 /进入模块0上的吉比特以太口8,9,10 switchp

8、ort mode access /定义这些接口的工作模式为访问模式 switchport access vlan 8 /把这些接口都分配到vlan8中 no shutdown spanning-tree portfast /在这些接口上使用portfast interface gigabitethernet 0/11 /进入模块0上的吉比特以太口11 switchport trunk encapsulation dotlq /给这个接口封装为802.1Q switchport mode trunk /定义这个接口的工作模式为trunk switchport trunk allowed vlan

9、 all /允许所有vlan信息通过 interface gigabitethernet 0/12 /同上 switchport trunk encapsulation dotlq switchport mode trunk switchport trunk allowed vlan all interface vlan 1 /进入vlan1的逻辑接口 ip address 172.16.1.7 255.255.255.0 /配置IP地址和子网掩码 no shutdown standby 1 ip 172.16.1.9 /开启了冗余热备份,冗余热备份组1,虚拟路由器的IP地址为172.16.1

10、.9 standby 1 priority 110 preempt /定义这个三层交换机在冗余热备份组1中的优先级为110,preempt是用来开启抢占模式 interface vlan 2 /同上 ip address 172.16.2.252 255.255.255.0 no shutdown standby 2 ip 172.16.2.254 standby 2 priority 110 preempt ip access-group 101 in /在入方向上使用扩展的访问控制列表101 interface vlan 3 /同上 ip address 172.16.3.252 255.

11、255.255.0 no shutdown standby 3 ip 172.16.3.254 standby 3 priority 110 preempt ip access-group 101 in interface vlan 4 /同上 ip address 172.16.4.252 255.255.255.0 no shutdown standby 4 ip 172.16.4.254 standby 4 priority 110 preempt ip access-group 101 in interface vlan 5 ip address 172.16.5.252 255.25

12、5.255.0 no shutdown standby 5 ip 172.16.5.254 standby 5 priority 110 preempt ip access-group 101 in interface vlan 6 ip address 172.16.6.252 255.255.255.0 no shutdown standby 6 ip 172.16.6.254 standby 6 priority 100 preempt interface vlan 7 ip address 172.16.7.252 255.255.255.0 no shutdown standby 7

13、 ip 172.16.7.254 standby 7 priority 100 preempt interface vlan 8 ip address 172.16.8.252 255.255.255.0 no shutdown standby 8 ip 172.16.8.254 standby 8 priority 100 preempt interface vlan 9 ip address 172.16.9.252 255.255.255.0 no shutdown standby 9 ip 172.16.9.254 standby 9 priority 100 preempt acce

14、ss-list 101 deny ip any 172.16.7.0 0.0.0.255 /扩展的访问控制列表101 access-list 101 permit ip any any Interface vlan 1 /进入vlan1这个逻辑接口 Ip helper-address 172.16.8.1 /可以转发广播 Interface vlan 2 Ip helper-address 172.16.8.1 Interface vlan 3 ip helper-address 172.16.8.1 interface vlan 4 ip helper-address 172.16.8.1

15、interface vlan 5 ip helper-address 172.16.8.1 interface vlan 6 ip helper-address 172.16.8.1 interface vlan 7 ip helper-address 172.16.8.1 interface vlan 9 ip helper-address 172.16.8.1 router rip /启用路由协议RIP version 2 /使用的是RIPv2,如果没有这句,则是使用RIPv1 network 172.16.0.0 /宣告直连的网段 exit ip route 0.0.0.0 0.0.0.0 172.16.9.250 /缺省路由,所有在路由表中没有办法匹配的数据包,都发向下一跳地址为172.16.9.250这个路由器 line con 0 line aux 0 line vty 0 15 /telnet线路 password 12345678 /login密码 login end copy running-config startup-config 保存配置

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号