华为三层交换机配置方法(1)
(2008-07-21 11:27:34)
转载
标签: 杂谈 | 分类: 工作汇报 |
本文以河南平临高速所使用的华为华三通信的H3C S3600-28P-SI为例,配置前首先要确定型号后缀是SI还是EI,EI的支持所有协议,SI的不支持OSPS动态协议,因此SI配置路由时可以使用静态协议和RIP协议,具体配置如下:
<H3C>system-view //进入系统视图
[H3C]display current-configuration //显示当前配置
//以下开始配置
/
/第一步:划分VLAN,并描述
vlan 1
description local-S3600
vlan 2
description link-to-wenquan
vlan 3
description link-to-ruzhou
vlan 4
description link-to-xiaotun
vlan 5
description link-to-baofeng
vlan 6
description link-to-pingxi
vlan 7
description link-to-pingnan
vlan 8
description Uplink-to-Putian
vlan 9
description link-to-pingxicentre
//第二步:给VLAN 划网关
interface Vlan-interface2
description link to wenquan
ip address 10.41.77.41 255.255.255.192
interface Vlan-interface3
description link to ruzhou
ip address 10.41.77.105 255.255.255.192
interface Vlan-interface4
description link to xiaotun
ip address 10.41.77.169 255.255.255.192
interface Vlan-interface5
description link to baofeng
ip address 10.41.77.233 255.255.255.192
interface Vlan-interface6
description link to pingxi
ip address 10.41.78.41 255.255.255.192
interface Vlan-interface7
description link to pingnan
ip address 10.41.78.105 255.255.255.192
interface Vlan-interface8
description uplink to putian
ip address 10.41.244.102 255.255.255.252
interface Vlan-interface9
description link to pingxicentre
ip address 10.41.80.233 255.255.255.192route add命令实例
//第三步:给VLAN 指定端口
interface Ethernet1/0/2
description link to wenquan
port access vlan 2
interface Ethernet1/0/3
description link to ruzhou
port access vlan 3
interface Ethernet1/0/4
description link to xiaotun
port access vlan 4
interface Ethernet1/0/5
description link to baofeng
port access vlan 5
interface Ethernet1/0/6
description link to pingxi
port access vlan 6
interface Ethernet1/0/7
description link to pingnan
port access vlan 7
interface Ethernet1/0/8
description uplink to putian
port access vlan 8
interface Ethernet1/0/9 to Ethernet1/0/24
description link to pingxicentre
port access vlan 9
//第四步:配置路由协议
//(1)用RIP配动态路由
rip
network 10.41.77.41
network 10.41.77.105
network 10.41.77.169
network 10.41.77.233
network 10.41.78.41
network 10.41.78.105
network 10.41.80.233
network 10.41.244.102
//(2)配静态路由(只用对远
华为三层交换机配置命令
分类:默认栏目
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子网(默认都是打开的) 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 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 mode on port-channel load-balance src-dst-ip //定义快速以太通道组的负载均衡方式(依靠源和目的IP的方式) interface gigabitethernet 0/3 //进入模块0上的吉比特以太口3 interface gigabitethernet 0/4 //同上 interface gigbitethernet 0/5 //同上 interface 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以后,在生成树的时候不参加运算,直接成为转发状态) 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 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.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.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 preempt 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.255.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 access-list 101 permit ip any any Interface vlan 1 //进入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 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线路(路由器只有5个,是0-4) password 12345678 //login密码 login end copy running-config startup-config 保存配置 cisco 3550 Switch# configure terminal Switch(config)#vtp 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)#switchport 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)#switchport 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)#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 //这个命令又是什么意思?是不是转发整个网段的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 Switch(config)#ip route 0.0.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(config)#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 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 |
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论