2022年2022年华为三层交换机配置方法及命令

上传人:公**** 文档编号:567325181 上传时间:2024-07-19 格式:PDF 页数:6 大小:50.07KB
返回 下载 相关 举报
2022年2022年华为三层交换机配置方法及命令_第1页
第1页 / 共6页
2022年2022年华为三层交换机配置方法及命令_第2页
第2页 / 共6页
2022年2022年华为三层交换机配置方法及命令_第3页
第3页 / 共6页
2022年2022年华为三层交换机配置方法及命令_第4页
第4页 / 共6页
2022年2022年华为三层交换机配置方法及命令_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《2022年2022年华为三层交换机配置方法及命令》由会员分享,可在线阅读,更多相关《2022年2022年华为三层交换机配置方法及命令(6页珍藏版)》请在金锄头文库上搜索。

1、华为三层交换机配置命令分类 : 默认栏目2007.6.2 07:28 作者: weiwei2501 | 评论: 1 | 阅读: 0 Enable /进入私有模式Configure terminal /进入全局模式service password-encryption /对密码进行加密hostname Catalyst 3550-12T1 /给三层交换机定义名称enable password 123456. /enable密码Enable secret 654321 /enable的加密密码(应该是乱码而不是654321 这样)Ip subnet-zero /允许使用全 0 子网(默认都是打开的

2、)Ip name-server 172.16.8.1 172.16.8.2 /三层交换机名字Catalyst 3550-12T1对应的 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 取名(如果不取名的话,vlan2 的名字应该是 vlan002 )Vlan 3 name

3、vlan3 Vlan 4 name vlan4 Vlan 5 name vlan5 Vlan 6 name vlan6 Vlan 7 name vlan7 Vlan 8 name vlan8 Vlan 9 name vlan9 Exit interface Port-channel 1 /进入虚拟的以太通道组1 Interface gigabitethernet 0/1 /进入模块 0 上的吉比特以太口1 channel-group 1 mode on /把这个接口放到快速以太通道组1 中Interface gigabitethernet 0/2 /同上 channel-group 1 mod

4、e on port-channel load-balance src-dst-ip / 定义快速以太通道组的负载均衡方式(依靠源和目的IP 的方式)名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 6 页 - - - - - - - - - interface gigabitethernet 0/3 /进入模块 0 上的吉比特以太口3 interface gigabitethernet 0/4 /同上interface gigbitethernet 0/5 / 同上inte

5、rface gigbitethernet 0/6 / 同上interface gigbitethernet 0/7 /进入模块 0 上的吉比特以太口7 no shutdown spanning-tree vlan 6-9 cost 1000 / 在生成树中, vlan6-9的开销定义为10000 interface range gigabitethernet 0/8 10 /进入模块 0 上的吉比特以太口8,9,10 no shutdown spanning-tree portfast / 在这些接口上使用portfast(使用 portfast以后,在生成树的时候不参加运算,直接成为转发状态

6、)interface gigabitethernet 0/11 /进入模块 0 上的吉比特以太口11 interface gigabitethernet 0/12 /同上interface vlan 1 /进入 vlan1 的逻辑接口(不是物理接口,用来给vlan 做路由用)ip address 172.16.1.7 255.255.255.0 /配置 IP 地址和子网掩码no shutdown standby 1 ip 172.16.1.9 /开启了冗余热备份(HSRP ),冗余热备份组1,虚拟路由器的 IP 地址为 172.16.1.9 standby 1 priority 110 pre

7、empt /定义这个三层交换机在冗余热备份组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.255.255.0 no shutdown standby

8、3 ip 172.16.3.254 standby 3 priority 110 preempt ip access-group 101 in interface vlan 4 / 同上名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 6 页 - - - - - - - - - ip address 172.16.4.252 255.255.255.0 no shutdown standby 4 ip 172.16.4.254 standby 4 priority 110

9、preempt ip access-group 101 in interface vlan 5 ip address 172.16.5.252 255.255.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 preemp

10、t interface 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 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.2

11、55.0 no shutdown standby 9 ip 172.16.9.254 standby 9 priority 100 preempt access-list 101 deny ip any 172.16.7.0 0.0.0.255 / 扩展的访问控制列表101 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 6 页 - - - - - - - - - access-list 101 permit ip any any Interface vlan 1 / 进

12、入 vlan1 这个逻辑接口Ip helper-address 172.16.8.1 /可以转发广播( 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 interface vlan 5 ip helper-address 172.16.8.1 interface vlan 6 ip

13、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这个路由器

14、line con 0 line aux 0 line vty 0 15 /telnet线路(路由器只有5 个,是 0-4 )password 12345678 /login密码login end copy running-config startup-config 保存配置cisco 3550 Switch# configure terminal 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 6 页 - - - - - - - - - Switch(config)#vt

15、p mode transparent Switch(config)#vlan 10 Switch(config-vlan)# name vlan10 Switch(config)#exit Switch(config)#vlan 11 Switch(config-vlan)name vlan11 Switch(config-vlan)end Switch#configure terminal Switch(config)#interface fastethernet0/9 Switch(config-if)#switchport mode access Switch(config-if)#sw

16、itchport access vlan 10 Switch(config-if)#exit Switch(config)#interface fastethernet0/10 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)#exit Switch(config)#interface fastethernet0/11 Switch(config-if)#switchport mode access Switch(config-if)#sw

17、itchport access vlan 11 Switch(config-if)#exit Switch(config)#interface fastethernet0/12 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 11 Switch(config-if)#exit Switch(config)#interface vlan10 Switch(config-if)#ip address 192.168.0.1 255.255.255.0 Switch(config-if

18、)#no shutdown Switch(config-if)#exit Switch(config)#interface vlan11 Switch(config-if)#ip address 192.168.1.1 255.255.255.0 Switch(config-if)#no shutdown Switch(config-if)#exit Switch(config)#ip routing Switch(config)#ip forward-protocol udp Switch(config)#inter vlan 10 ip helper 172.16.11.255 /这个命令

19、又是什么意思?是不是转发整个网段的UDP协议?为什么用到了172.16.11.255这个地址?Switch(config)#exit Switch(config)#inter vlan 11 Switch(config-if)#ip helper 172.16.10.255 /同上?Switch(config-if)#exit 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 6 页 - - - - - - - - - Switch(config)#ip route 0.0

20、.0.0 0.0.0.0 Vlan10 Switch(config)#ip route 0.0.0.0 0.0.0.0 Vlan11 Switch(config)#conf t Switch(config)#access-list 103 permit ip 172.16.11.0 0.0.0.255 172.16.10.0 0.0.0.255 Switch(config)#access-list 103 permit udp any any eq bootpc Switch(config)#access-list 103 permit udp any any eq tftp Switch(c

21、onfig)#access-list 103 permit udp any eq bootpc any Switch(config)#access-list 103 permit udp any eq tftp any Switch(config)#inter vlan 10 Switch(config-if)#ip directed-broadcast 103 /请解释一下这个的具体含义,本人不是太明白,懂一点意思(直接广播这个列表?是不是)Switch(config-if)#exit Switch(config)#access-list 104 permit ip 172.16.10.0

22、0.0.0.255 172.16.11.0 0.0.0.255 Switch(config)#access-list 104 permit udp any any eq bootpc Switch(config)#access-list 104 permit udp any any eq tftp Switch(config)#access-list 104 permit udp any eq bootpc any Switch(config)#access-list 104 permit udp any eq tftp any Switch(config)#inter vlan 11 Switch(config-if)#ip directed-broadcast 104 /同上Switch(config)#end Switch#copy run star 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 6 页 - - - - - - - - -

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号