思科三层交换机配置实例_第1页
思科三层交换机配置实例_第2页
思科三层交换机配置实例_第3页
思科三层交换机配置实例_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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

2、字 Catalyst 3550-12T1 对应的 IP 地址 是 172.16.8.1Service dhcp / 提供 DHCP 服务 ip routing / 启用三层交换机上的路由模块ExitVtp mode server / 定义 VTP 工作模式为 sever 模式Vtp domain centervtp / 定义 VTP 域的名称为 centervtpVlan 2 name vlan2 /定义 vlan 并给 vlan 取名(如果不取名的话, vlan2 的名字应该是 vlan002)Vlan 3 name vlan3Vlan 4 name vlan4Vlan 5 name vla

3、n5Vlan 6 name vlan6Vlan 7 name vlan7Vlan 8 name vlan8Vlan 9 name vlan9Exitinterface Port-channel 1 / 进入虚拟的以太通道组 1switchport trunk encapsulation dot1q / 给这个接口的 trunk 封装为 802.1Q 的帧格式 switchport mode trunk / 定义这个接口的工作模式为 trunkswitchport trunk allowed vlan all / 在这个 trunk 上允许所有的 vlan 通过 Interface gigabi

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

5、 encapsulation dotlq switchport mode trunk switchport trunk allowed vlan all channel-group 1 mode onport-channel load-balance src-dst-ip / 定义快速以太通道组的负载均衡方式 (依 * 源和目的 IP 的方式)interface gigabitethernet 0/3 / 进入模块 0 上的吉比特以太口 3 switchport trunk encapsulation dotlq / 给 trunk 封装为 802.1Q switchport mode tru

6、nk / 定义这个接口的工作模式为 trunkswitchport trunk allowed vlan all / 允许所有 vlan 信息通过interface gigabitethernet 0/4 / 同上 switchport trunk encapsulation dotlq switchport mode trunk switchport trunk allowed vlan allinterface gigbitethernet 0/5 / 同上 switchport trunk encapsulation dotlq switchport mode trunk switchp

7、ort trunk allowed vlan allinterface gigbitethernet 0/6 / 同上 switchport trunk encapsulation dotlq switchport mode trunk switchprot trunk allowed vlan allinterface gigbitethernet 0/7 / 进入模块 0 上的吉比特以太口 7Switchport mode access / 定义这个接口的工作模式为访问模式switchport access vlan 9 /定义这个接口可以访问哪个vlan (实际就是分配这个接口到vlan

8、)no shutdownspanning-tree vlan 6-9 cost 1000 / 在生成树中, vlan6-9 的开销定义为 10000in terface range gigabitethernet 0/8 - 10 进入模块 0 上的吉比特以太口8,9,10switchport mode access /定义这些接口的工作模式为访问模式 switchport access vlan 8 / 把这些接口都分配到 vlan8 中no shutdownspanning-tree portfast /在这些接口上使用 portfast (使用portfast以后,在生成树的时候 不参加

9、运算,直接成为转发状态)interface gigabitethernet 0/11 /进入模块 0 上的吉比特以太口 11 switchport trunk encapsulation dotlq / 给这个接口封装为 802.1Q switchport mode trunk / 定义这个接口的工作模式为 trunk switchport trunk allowed vlan all / 允许所有 vlan 信息通过interface gigabitethernet 0/12 / 同上switchport trunk encapsulation dotlq switchport mode t

10、runk switchport trunk allowed vlan allinterface vlan 1 / 进入 vlan1 的逻辑接口(不是物理接口,用来给 vlan 做路由用) ip address 172.16.1.7 255.255.255.0 /配置 IP 地址和子网掩码no shutdownstandby 1 ip 172.16.1.9 /开启了冗余热备份(HSRP),冗余热备份组1,虚拟路由器的IP地址为 172.16.1.9standby 1 priority 110 preempt /定义这个三层交换机在冗余热备份组 1 中的优先级为 110, preempt 是用来开

11、启抢占模式interface vlan 2 / 同上ip address 172.16.2.252 255.255.255.0no shutdownstandby 2 ip 172.16.2.254standby 2 priority 110 preemptip access-group 101 in /在入方向上使用扩展的访问控制列表 101interface vlan 3 / 同上ip address 172.16.3.252 255.255.255.0no shutdownstandby 3 ip 172.16.3.254standby 3 priority 110 preemptip

12、access-group 101 ininterface vlan 4 / 同上ip address 172.16.4.252 255.255.255.0no shutdownstandby 4 ip 172.16.4.254standby 4 priority 110 preemptip access-group 101 ininterface vlan 5ip address 172.16.5.252 255.255.255.0no shutdownstandby 5 ip 172.16.5.254standby 5 priority 110 preemptip access-group

13、101 ininterface vlan 6ip address 172.16.6.252 255.255.255.0no shutdownstandby 6 ip 172.16.6.254standby 6 priority 100 preemptinterface vlan 7 ip address 172.16.7.252 255.255.255.0 no shutdown standby 7 ip 172.16.7.254 standby 7 priority 100 preemptinterface vlan 8ip address 172.16.8.252 255.255.255.

14、0 no shutdownstandby 8 ip 172.16.8.254standby 8 priority 100 preemptinterface vlan 9ip address 172.16.9.252 255.255.255.0 no shutdown standby 9 ip 172.16.9.254 standby 9 priority 100 preemptaccess-list 101 deny ip any 172.16.7.0 0.0.0.255 / 扩展的访问控制列表 101 access-list 101 permit ip any anyInterface vl

15、an 1 / 进入 vlan1 这个逻辑接口Ip helper-address 172.16.8.1 /可以转发广播(helper address的作用就是把广播转化为单 播,然后发向 172.16.8.1)Interface vlan 2Ip helper-address 172.16.8.1Interface vlan 3ip helper-address 172.16.8.1interface vlan 4ip helper-address 172.16.8.1interface vlan 5ip helper-address 172.16.8.1 interface vlan 6ip helper-address 172.16.8.1 interface vlan 7ip helper-address 172.16.8.1interface vlan 9ip helper-address 172.16.8.1router rip / 启用路由协议 RIPversion 2 /使用的是 RIPv2,如果没有这句,则是使用RIPvlnetwork 172.16.0

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论