华为三层交换机配置方法.命令及实例

华为三层交换机配置方法(1) (2008-07-21 11:27:34)

转载

标签: 分类: 工作汇报

杂谈

本文以河南平临高速所使用的华为华三通信的H3C S3600-28P-SI为例,配置前首先要确定型号后缀是SI还是EI,EI的支持所有协议,SI的不支持OSPS动态协议,因此SI配置路由时可以使用静态协议和RIP协议,具体配置如下: 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.192

//第三步:给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)配静态路由(只用对远

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

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 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

华为三层交换机配置实例一例

网络技术 2008-07-25 06:08:28 阅读243 评论0 字号:大中小 订阅

华为三层交换机配置实例一例

服务器1双网卡,内网IP:192.168.0.1,其它计算机通过其代理上网

PORT1属于VLAN1

PORT2属于VLAN2

PORT3属于VLAN3

VLAN1的机器可以正常上网

配置VLAN2的计算机的网关为:192.168.1.254

配置VLAN3的计算机的网关为:192.168.2.254

即可实现VLAN间互联

如果VLAN2和VLAN3的计算机要通过服务器1上网

则需在三层交换机上配置默认路由

系统视图下:ip route-static 0.0.0.0 0.0.0.0 192.168.0.1

然后再在服务器1上配置回程路由

进入命令提示符

route add 192.168.1.0 255.255.255.0 192.168.0.254

route add 192.168.2.0 255.255.255.0 192.168.0.254

这个时候vlan2和vlan3中的计算机就可以通过服务器1访问internet了~~

华为路由器与CISCO路由器在配置上的差别

华为路由器与同档次的CISCO路由器在功能特性与配置界面上完全一致,有些方面还根据国内用户的需求作了很好的改进。例如中英文可切换的配置与调试界面,使中文用户再也不用面对着一大堆的英文专业单词而无从下手了。另外它的软件升级,远程配置,备份中心,PPP回拨,

路由器热备份等,对用户来说均是极有用的功能特性。

在配置方面,华为路由器以前的软件版本(VRP1.0-相当于CISCO的IOS)与CISCO有细微的差别,但目前的版本(VRP1.1)已和CISCO兼容,下面首先介绍VRP软件的升级方法,然

后给出配置上的说明。

一、 VRP软件升级操作

升级前用户应了解自己路由器的硬件配置以及相应的引导软件bootrom的版本,因为这关系到是否可以升级以及升级的方法,否则升级失败会导致路由器不能运行。在此我们以从

VRP1.0升级到VRP1.1为例说明升级的方法。

1.路由器配置电缆一端与PC机的串口一端与路由器的console口连接

2.在win95/98下建立使用直连线的超级终端,参数如下:

波特率9600,数据位8,停止位1,无效验,无流控 ,VT100终端类型

3.超级终端连机后打开路由器电源,屏幕上会出现引导信息,在出现:

Press Ctrl-B to enter Boot Menu.

时三秒内按下Ctrl+b,会提示输入密码

Please input Bootrom password:

默认密码为空,直接回车进入引导菜单Boot Menu,在该菜单下选1,即Download application program升级VRP软件,之后屏幕提示选择下载波特率,我们一般选择38400 bps,随即出现

提示信息:

Download speed is 38400 bps.Please change the terminal's speed to 38400 bps, and

select XMODEM protocol.Press ENTER key when ready.

此时进入超级终端“属性”,修改波特率为38400,修改后应断开超级终端的连接,再进入连

接状态,以使新属性起效,之后屏幕提示:

Downloading…CCC

这表示路由器已进入等待接收文件的状态,我们可以选择超级终端的文件“发送”功能,选定相应的VRP软件文件名,通讯协议选Xmodem,之后超级终端自动发送文件到路由器中,整个传送过程大约耗时8分半钟。完成后有提示信息出现,系统会将收到的VRP软件写入Flash Memory覆盖原来的系统,此时整个升级过程完成,系统提示改回超级终端的波特率:

Restore the terminal's speed to 9600 bps.

Press ENTER key when ready.

修改完后记住进行超级终端的断开和连接操作使新属性起效,之后路由器软件开始启动,用

show ver命令将看见相应的版本信息。

下面是与CISCO互通时应注意的地方:

二、 在默认链路层封装上的区别(主要用于DDN的配置)

1.华为VRP1.0及其以前的版本,在配置时,由于CISCO的默认链路层封装格式为HDLC,而华为路由器的默认链路层封装格式为PPP,因此为了能互通,需要将CISCO路由器的封装格

式改为PPP格式,即使用命令:

encapsulation PPP

2.华为VRP1.1及其以后的版本,增加了HDLC封装格式。这样,不需要改动CISCO的封

装格式,而将华为路由器的封装格式改为HDLC封装格式即可,即使用命令:

encapsulation hdlc

三、 在配置X.25上的区别

1.华为VRP1.0及其以前的版本在配置时,由于CISCO的 X25 默认封装格式为它自己的标准。而华为路由器的封装格式为国际标准IETF,因此为了能互通,需要将CISCO路由器的

封装格式改为ietf格式,即使用命令:

encapsulation x25 ietf

2.华为VRP1.1及其以后的版本,特地增加了与CISCO兼容的封装格式。这样,不需要改动 CISCO 的封装格式,而将华为路由器的 X25 封装格式改为 CISCO兼容封装格式即可,即使

用命令:

encapsulation x25 cisco

四、 在配置帧中继(Frame-Relay)上的区别

1.华为VRP1.0及其以前的版本,由于CISCO的默认 FR 封装格式为CISCO公司自己的标准;而华为路由器的封装格式为国际标准IETF。另外,由于在LMI(帧中继本地管理信息)类型的配置上,CISCO默认也是使用它自己的格式,而华为路由器使用的是国际标准的 Q.933a 格式,因此为了能互通,需要将 CISCO路由器的 FR 封装格式改为IETF,将LMI 改为 Q.933a

格式才能互通,即使用命令:

encapsulation frame-realy ietf

frame-realy lmi-type q933a

2.华为VRP1.1及其以后的版本,特地增加了与CISCO兼容的FR封装格式,以及LMI的格式。这样,不需要改动CISCO的封装,而只需将华为路由器的FR封装格式和LMI类型改为

CISCO兼容格式即可,即使用命令:

encapsulation frame-relay cisco

frame-relay lmi-type cisco

以上各点,是在华为与 CISCO 互连时应着重注意的,如果 CISCO 用户的链路封装不是国际标准而是它自己的格式,而且 CISCO 用户又不愿修改配置,则在华为一端一定要作相应

的改变。

华为MPLS配置

1.mpls lsr-id x.x.x.x

指定LSR的ID

2.mpls ldp

激活LDP协议并进入LDP视图

3.remote-peer local-ip x.x.x.x(local-ip) remote-ip (x.x.x.x)remote-ip

配置LDP Remote-peer,配置LDP remote-peer必须配置local-ip

4.loop-detect

允许进行环路检测

5.hops-count (hop-numbe)

设置环路检测最大跳数,设置环路检测的最大跳数,缺省情况下没有配置环路检测最大跳数

6.path-vectors (pv-number)

设置路径向量的最大值,当环路检测采用路径向量方式时,也需要规定LSP的最大值。这样,在

以下条件之一时即认为出现了环路,LSP建立失败:

(1) 路径向量记录表中已有本LSR的记录。

(2) 路径的跳数超过这里设定的最大值。

7. mpls ldp enable

在接口使能LDP

8.mpls ldp timer { keepalive keepalive-holdtime | hello hello-holdtime }

设置接口LDP会话保持参数,Keepalive报文的缺省定时时间为60秒,Hello报文的缺省定时时

间为15秒

在不支持广播报文的链路层协议(如帧中继、ATM)上,必须要使用命令map ip { ip-address

[ ip-mask ] | default | inarp [ minutes ] } [ broadcast ]配置broadcast属性,以支持广播和组播报

文的传递

*******************************************************************

要实现BGP/MPLS VPN的功能一般需要完成以下步骤:

在PE、CE、P上配置基本信息;

建立PE到PE的具有IP能力的逻辑或物理的链路;

发布、更新VPN信息。

BGP/MPLS VPN的配置包括:

定义BGP/MPLS VPN

进入协议地址族视图

PE-CE间路由交换的配置

PE-PE间路由交换的配置

1. 创建并进入VPN实例视图

ip vpn-instance (vpn-instance-name)

2. 为vpn-instance创建路由和转发表

route-distinguisher (route-distinguisher)

RD在与自治系统号(ASN)相关时,RD是由一个自治系统号和一个任意的数组成。RD在与

IP地址相关时,RD是由一个IP地址和一个任意的数组成。

RD有以下格式:

(16位ASN:32位用户自定义数),例如:100:1

(32位IP地址:16位用户自定义数),例如:172.1.1.1:1

3. 为vpn-instance创建VPN Target扩展团体

vpn-target (vpn-target-ext-community) [ import-extcommunity | export-extcommunity | both ]

4. 限制一个vpn-instance中最大路由数

routing-table limit (limit) { warn threshold | simply-alert }

5. 将接口与vpn-instance关联

ip binding vpn-instance (vpn-instance-name)

在实施接口与vpn-instance的绑定时,需要在接口上先执行ip binding vpn-instance命令,再配

置IP地址,否则已经配置的IP地址会因为执行ip binding vpn-instance命令而被删除

请在BGP视图下进行下列配置

ipv4-family vpn-instance (vpn-instance-name)

ipv4-family vpnv4 [ unicast ]

PE-CE间路由交换的配置

1. PE和CE间通过静态路由链接的配置

ip route-static vpn-instance (vpn-instance-name) prefix mask [ next-hop-address ] [ interface

{ interface-number } ] [ public | preference preference | blackhole | reject ]

2. PE和CE间通过EBGP交换路由信息的配置

peer (peer-address) as-number (as-number)

PE-PE间路由交换的配置

1. 配置自治系统号

peer { peer-address | group-name } as-number (as-number)

2. 配置允许内部BGP会话使用任何可操作的TCP连接接口

peer { peer-address | group-name } connect-interface interface-type interface-name

3. 配置是否激活对等体(组)

peer { group-name | peer-address } enable

4. 配置向对等体(组)发送缺省路由

peer { peer-address | group-name } default-route-advertise

5. 配置在发布路由时将自身地址作为下一跳

peer { peer-address | group-name } next-hop-local

6. 配置传送BGP更新报文时不携带私有自治系统号

peer { peer-address | group-name } public-as-only

配置管理IP

console口登录配置

sys

vlan 100

sys

interface Vlanif 100

ip address 192.168.100.20 255.255.248.0

配置telnet 登陆

[quidway]user-interface vty 0 4

[quidway-aux0]authentication-mode {none|password|scheme} //设置登录的验证方法。none是不要验证,password是密码验证,scheme是服务器验证。

[quidway-aux0]set authentication password {cipher|simple} 123456 //当上面的模式为 paaword时,设置验证的密码。simple是明文密码。

[quidway-aux0]user privilege level 2 //设置从AUX登录后可以访问的命令级别为2级,默认是1级。

[quidway-aux0]protocol inbund {all |ssh|telnet} //设置交换机支持的协议

[quidway-aux0]screen-length 30 //设置一屏显示30行命令

[quidway-aux0]history-command max-size 20 //设置历史命令缓冲区最多存放20条命令

[quidway-aux0]idle-timeout 6 //设置超时时间为6分钟

super 3 //将普通用户通过TELNET登录到交换机,将用户级别切换到3级。

(3)超级用户密码(用户级别)

[quidway]super password level 3 {cipher|simper} 123456 //设置低级别用户到高级别用户切换的密码

super 3

注意:命令行级别分为:0,1,2,3 共四级。

访问级(0级):用于网络诊断等功能的命令。包括ping ,tracert,telnet等。

监控级(1级):用于系统维护、业务故障诊断等功能命令。包括debugging\terminal等命令。执和地该级别的命令结果不能被保存到配置文件中。

系统级(2级):用于业务配置的命令。包括路由等网络层次的命令,用于向用户提供网络服务。

管理级(3级):关系到系统的基本运行、系统支撑模块功能的命令,这些命令对业务的支持,最后级别。

默认:console口的命令登录级别为3, telnet 方式的级别为0。

配置端口为access模式

interface GigabitEthernet 0/0/1

port link-type access

quit

interface GigabitEthernet 0/0/2

port link-type access

quit

interface GigabitEthernet 0/0/3

port link-type access

quit

interface GigabitEthernet 0/0/4

port link-type access

quit

interface GigabitEthernet 0/0/5

port link-type access

quit

interface GigabitEthernet 0/0/6

port link-type access

quit

interface GigabitEthernet 0/0/7

port link-type access

quit

interface GigabitEthernet 0/0/8

port link-type access

quit

interface GigabitEthernet 0/0/9

port link-type access

quit

interface GigabitEthernet 0/0/10

port link-type access

quit

interface GigabitEthernet 0/0/11

port link-type access

quit

interface GigabitEthernet 0/0/12

port link-type access

quit

interface GigabitEthernet 0/0/13

port link-type access

quit

interface GigabitEthernet 0/0/14

port link-type access

quit

interface GigabitEthernet 0/0/15

port link-type access

quit

interface GigabitEthernet 0/0/16

port link-type access

quit

interface GigabitEthernet 0/0/17

port link-type access

quit

interface GigabitEthernet 0/0/18

port link-type access

quit

interface GigabitEthernet 0/0/19

port link-type access

quit

interface GigabitEthernet 0/0/20

port link-type access

interface GigabitEthernet 0/0/21

port link-type access

quit

interface GigabitEthernet 0/0/22

port link-type access

quit

interface GigabitEthernet 0/0/23

port link-type access

quit

interface GigabitEthernet 0/0/24

port link-type access

quit

将端口加入到vlan中

vlan 1

port GigabitEthernet 0/0/1

quit

vlan 1

port GigabitEthernet 0/0/2

quit

vlan 1

port GigabitEthernet 0/0/3

quit

vlan 1

port GigabitEthernet 0/0/4

quit

vlan 2

port GigabitEthernet 0/0/5

quit

vlan 3

port GigabitEthernet 0/0/6

quit

vlan 4

port GigabitEthernet 0/0/7

quit

vlan 5

port GigabitEthernet 0/0/8

quit

vlan 6

port GigabitEthernet 0/0/9

quit

vlan 7

port GigabitEthernet 0/0/10

quit

port GigabitEthernet 0/0/11

quit

vlan 9

port GigabitEthernet 0/0/12

quit

vlan 10

port GigabitEthernet 0/0/13

quit

vlan 11

port GigabitEthernet 0/0/14

quit

vlan 12

port GigabitEthernet 0/0/15

quit

vlan 13

port GigabitEthernet 0/0/16

quit

vlan 14

port GigabitEthernet 0/0/17

quit

vlan 15

port GigabitEthernet 0/0/18

quit

vlan 16

port GigabitEthernet 0/0/19

port GigabitEthernet 0/0/20

port GigabitEthernet 0/0/21

port GigabitEthernet 0/0/22

port GigabitEthernet 0/0/23

port GigabitEthernet 0/0/24

quit

mux-vlan

启用SUB-VLNA

system-view

vlan 100

aggregate-vlan

access-vlan 1 to 16

使能super-VLAN的接口VLANIF100上的VLAN间Proxy ARP功能。(这条不配不能互访) system-view

interface vlanif100

arp-proxy inter-sub-vlan-proxy enable

配置单播静态路由(这条配完后才能上外网)

system-view

ip route-static 183.62.196.0 255.255.255.224 192.168.100.100

ip route-static 0.0.0.0 0.0.0.0 10.10.10.1

配置接口的环路检测功能,并且在环路消失后5秒钟内恢复网络 示例:

stp loop-protection 启动当前接口的环路保护功能 loopback-detect enable 用来使能接口的环路检测功能

loopback-detect action shutdown 用来配置接口的环路检测处理动作 loopback-detect recovery-time 5 用来配置环路消失后接口的恢复时间

sy

int g0/0/1

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/2

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/3

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/4

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/5

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/6

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/7

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 qui

int g0/0/8

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/9

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/5

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/11

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/12

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/13

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5

quit

int g0/0/14

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/15

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/16

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/17

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/18

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/19

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/20

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/21

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/22

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/23

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/24

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

配置所有接口环路检测周期为2秒

sy

loopback-detect packet-interval 2

quit

配置三层的SNMP让深信服跨VLAN识别MAC地址。

snmp-agent sys-info version all

snmp-agent community read comaccess 设置外部设备取SNMP为只读权限 保存配置

save

华为三层交换机配置方法(1) (2008-07-21 11:27:34)

转载

标签: 分类: 工作汇报

杂谈

本文以河南平临高速所使用的华为华三通信的H3C S3600-28P-SI为例,配置前首先要确定型号后缀是SI还是EI,EI的支持所有协议,SI的不支持OSPS动态协议,因此SI配置路由时可以使用静态协议和RIP协议,具体配置如下: 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.192

//第三步:给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)配静态路由(只用对远

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

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 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

华为三层交换机配置实例一例

网络技术 2008-07-25 06:08:28 阅读243 评论0 字号:大中小 订阅

华为三层交换机配置实例一例

服务器1双网卡,内网IP:192.168.0.1,其它计算机通过其代理上网

PORT1属于VLAN1

PORT2属于VLAN2

PORT3属于VLAN3

VLAN1的机器可以正常上网

配置VLAN2的计算机的网关为:192.168.1.254

配置VLAN3的计算机的网关为:192.168.2.254

即可实现VLAN间互联

如果VLAN2和VLAN3的计算机要通过服务器1上网

则需在三层交换机上配置默认路由

系统视图下:ip route-static 0.0.0.0 0.0.0.0 192.168.0.1

然后再在服务器1上配置回程路由

进入命令提示符

route add 192.168.1.0 255.255.255.0 192.168.0.254

route add 192.168.2.0 255.255.255.0 192.168.0.254

这个时候vlan2和vlan3中的计算机就可以通过服务器1访问internet了~~

华为路由器与CISCO路由器在配置上的差别

华为路由器与同档次的CISCO路由器在功能特性与配置界面上完全一致,有些方面还根据国内用户的需求作了很好的改进。例如中英文可切换的配置与调试界面,使中文用户再也不用面对着一大堆的英文专业单词而无从下手了。另外它的软件升级,远程配置,备份中心,PPP回拨,

路由器热备份等,对用户来说均是极有用的功能特性。

在配置方面,华为路由器以前的软件版本(VRP1.0-相当于CISCO的IOS)与CISCO有细微的差别,但目前的版本(VRP1.1)已和CISCO兼容,下面首先介绍VRP软件的升级方法,然

后给出配置上的说明。

一、 VRP软件升级操作

升级前用户应了解自己路由器的硬件配置以及相应的引导软件bootrom的版本,因为这关系到是否可以升级以及升级的方法,否则升级失败会导致路由器不能运行。在此我们以从

VRP1.0升级到VRP1.1为例说明升级的方法。

1.路由器配置电缆一端与PC机的串口一端与路由器的console口连接

2.在win95/98下建立使用直连线的超级终端,参数如下:

波特率9600,数据位8,停止位1,无效验,无流控 ,VT100终端类型

3.超级终端连机后打开路由器电源,屏幕上会出现引导信息,在出现:

Press Ctrl-B to enter Boot Menu.

时三秒内按下Ctrl+b,会提示输入密码

Please input Bootrom password:

默认密码为空,直接回车进入引导菜单Boot Menu,在该菜单下选1,即Download application program升级VRP软件,之后屏幕提示选择下载波特率,我们一般选择38400 bps,随即出现

提示信息:

Download speed is 38400 bps.Please change the terminal's speed to 38400 bps, and

select XMODEM protocol.Press ENTER key when ready.

此时进入超级终端“属性”,修改波特率为38400,修改后应断开超级终端的连接,再进入连

接状态,以使新属性起效,之后屏幕提示:

Downloading…CCC

这表示路由器已进入等待接收文件的状态,我们可以选择超级终端的文件“发送”功能,选定相应的VRP软件文件名,通讯协议选Xmodem,之后超级终端自动发送文件到路由器中,整个传送过程大约耗时8分半钟。完成后有提示信息出现,系统会将收到的VRP软件写入Flash Memory覆盖原来的系统,此时整个升级过程完成,系统提示改回超级终端的波特率:

Restore the terminal's speed to 9600 bps.

Press ENTER key when ready.

修改完后记住进行超级终端的断开和连接操作使新属性起效,之后路由器软件开始启动,用

show ver命令将看见相应的版本信息。

下面是与CISCO互通时应注意的地方:

二、 在默认链路层封装上的区别(主要用于DDN的配置)

1.华为VRP1.0及其以前的版本,在配置时,由于CISCO的默认链路层封装格式为HDLC,而华为路由器的默认链路层封装格式为PPP,因此为了能互通,需要将CISCO路由器的封装格

式改为PPP格式,即使用命令:

encapsulation PPP

2.华为VRP1.1及其以后的版本,增加了HDLC封装格式。这样,不需要改动CISCO的封

装格式,而将华为路由器的封装格式改为HDLC封装格式即可,即使用命令:

encapsulation hdlc

三、 在配置X.25上的区别

1.华为VRP1.0及其以前的版本在配置时,由于CISCO的 X25 默认封装格式为它自己的标准。而华为路由器的封装格式为国际标准IETF,因此为了能互通,需要将CISCO路由器的

封装格式改为ietf格式,即使用命令:

encapsulation x25 ietf

2.华为VRP1.1及其以后的版本,特地增加了与CISCO兼容的封装格式。这样,不需要改动 CISCO 的封装格式,而将华为路由器的 X25 封装格式改为 CISCO兼容封装格式即可,即使

用命令:

encapsulation x25 cisco

四、 在配置帧中继(Frame-Relay)上的区别

1.华为VRP1.0及其以前的版本,由于CISCO的默认 FR 封装格式为CISCO公司自己的标准;而华为路由器的封装格式为国际标准IETF。另外,由于在LMI(帧中继本地管理信息)类型的配置上,CISCO默认也是使用它自己的格式,而华为路由器使用的是国际标准的 Q.933a 格式,因此为了能互通,需要将 CISCO路由器的 FR 封装格式改为IETF,将LMI 改为 Q.933a

格式才能互通,即使用命令:

encapsulation frame-realy ietf

frame-realy lmi-type q933a

2.华为VRP1.1及其以后的版本,特地增加了与CISCO兼容的FR封装格式,以及LMI的格式。这样,不需要改动CISCO的封装,而只需将华为路由器的FR封装格式和LMI类型改为

CISCO兼容格式即可,即使用命令:

encapsulation frame-relay cisco

frame-relay lmi-type cisco

以上各点,是在华为与 CISCO 互连时应着重注意的,如果 CISCO 用户的链路封装不是国际标准而是它自己的格式,而且 CISCO 用户又不愿修改配置,则在华为一端一定要作相应

的改变。

华为MPLS配置

1.mpls lsr-id x.x.x.x

指定LSR的ID

2.mpls ldp

激活LDP协议并进入LDP视图

3.remote-peer local-ip x.x.x.x(local-ip) remote-ip (x.x.x.x)remote-ip

配置LDP Remote-peer,配置LDP remote-peer必须配置local-ip

4.loop-detect

允许进行环路检测

5.hops-count (hop-numbe)

设置环路检测最大跳数,设置环路检测的最大跳数,缺省情况下没有配置环路检测最大跳数

6.path-vectors (pv-number)

设置路径向量的最大值,当环路检测采用路径向量方式时,也需要规定LSP的最大值。这样,在

以下条件之一时即认为出现了环路,LSP建立失败:

(1) 路径向量记录表中已有本LSR的记录。

(2) 路径的跳数超过这里设定的最大值。

7. mpls ldp enable

在接口使能LDP

8.mpls ldp timer { keepalive keepalive-holdtime | hello hello-holdtime }

设置接口LDP会话保持参数,Keepalive报文的缺省定时时间为60秒,Hello报文的缺省定时时

间为15秒

在不支持广播报文的链路层协议(如帧中继、ATM)上,必须要使用命令map ip { ip-address

[ ip-mask ] | default | inarp [ minutes ] } [ broadcast ]配置broadcast属性,以支持广播和组播报

文的传递

*******************************************************************

要实现BGP/MPLS VPN的功能一般需要完成以下步骤:

在PE、CE、P上配置基本信息;

建立PE到PE的具有IP能力的逻辑或物理的链路;

发布、更新VPN信息。

BGP/MPLS VPN的配置包括:

定义BGP/MPLS VPN

进入协议地址族视图

PE-CE间路由交换的配置

PE-PE间路由交换的配置

1. 创建并进入VPN实例视图

ip vpn-instance (vpn-instance-name)

2. 为vpn-instance创建路由和转发表

route-distinguisher (route-distinguisher)

RD在与自治系统号(ASN)相关时,RD是由一个自治系统号和一个任意的数组成。RD在与

IP地址相关时,RD是由一个IP地址和一个任意的数组成。

RD有以下格式:

(16位ASN:32位用户自定义数),例如:100:1

(32位IP地址:16位用户自定义数),例如:172.1.1.1:1

3. 为vpn-instance创建VPN Target扩展团体

vpn-target (vpn-target-ext-community) [ import-extcommunity | export-extcommunity | both ]

4. 限制一个vpn-instance中最大路由数

routing-table limit (limit) { warn threshold | simply-alert }

5. 将接口与vpn-instance关联

ip binding vpn-instance (vpn-instance-name)

在实施接口与vpn-instance的绑定时,需要在接口上先执行ip binding vpn-instance命令,再配

置IP地址,否则已经配置的IP地址会因为执行ip binding vpn-instance命令而被删除

请在BGP视图下进行下列配置

ipv4-family vpn-instance (vpn-instance-name)

ipv4-family vpnv4 [ unicast ]

PE-CE间路由交换的配置

1. PE和CE间通过静态路由链接的配置

ip route-static vpn-instance (vpn-instance-name) prefix mask [ next-hop-address ] [ interface

{ interface-number } ] [ public | preference preference | blackhole | reject ]

2. PE和CE间通过EBGP交换路由信息的配置

peer (peer-address) as-number (as-number)

PE-PE间路由交换的配置

1. 配置自治系统号

peer { peer-address | group-name } as-number (as-number)

2. 配置允许内部BGP会话使用任何可操作的TCP连接接口

peer { peer-address | group-name } connect-interface interface-type interface-name

3. 配置是否激活对等体(组)

peer { group-name | peer-address } enable

4. 配置向对等体(组)发送缺省路由

peer { peer-address | group-name } default-route-advertise

5. 配置在发布路由时将自身地址作为下一跳

peer { peer-address | group-name } next-hop-local

6. 配置传送BGP更新报文时不携带私有自治系统号

peer { peer-address | group-name } public-as-only

配置管理IP

console口登录配置

sys

vlan 100

sys

interface Vlanif 100

ip address 192.168.100.20 255.255.248.0

配置telnet 登陆

[quidway]user-interface vty 0 4

[quidway-aux0]authentication-mode {none|password|scheme} //设置登录的验证方法。none是不要验证,password是密码验证,scheme是服务器验证。

[quidway-aux0]set authentication password {cipher|simple} 123456 //当上面的模式为 paaword时,设置验证的密码。simple是明文密码。

[quidway-aux0]user privilege level 2 //设置从AUX登录后可以访问的命令级别为2级,默认是1级。

[quidway-aux0]protocol inbund {all |ssh|telnet} //设置交换机支持的协议

[quidway-aux0]screen-length 30 //设置一屏显示30行命令

[quidway-aux0]history-command max-size 20 //设置历史命令缓冲区最多存放20条命令

[quidway-aux0]idle-timeout 6 //设置超时时间为6分钟

super 3 //将普通用户通过TELNET登录到交换机,将用户级别切换到3级。

(3)超级用户密码(用户级别)

[quidway]super password level 3 {cipher|simper} 123456 //设置低级别用户到高级别用户切换的密码

super 3

注意:命令行级别分为:0,1,2,3 共四级。

访问级(0级):用于网络诊断等功能的命令。包括ping ,tracert,telnet等。

监控级(1级):用于系统维护、业务故障诊断等功能命令。包括debugging\terminal等命令。执和地该级别的命令结果不能被保存到配置文件中。

系统级(2级):用于业务配置的命令。包括路由等网络层次的命令,用于向用户提供网络服务。

管理级(3级):关系到系统的基本运行、系统支撑模块功能的命令,这些命令对业务的支持,最后级别。

默认:console口的命令登录级别为3, telnet 方式的级别为0。

配置端口为access模式

interface GigabitEthernet 0/0/1

port link-type access

quit

interface GigabitEthernet 0/0/2

port link-type access

quit

interface GigabitEthernet 0/0/3

port link-type access

quit

interface GigabitEthernet 0/0/4

port link-type access

quit

interface GigabitEthernet 0/0/5

port link-type access

quit

interface GigabitEthernet 0/0/6

port link-type access

quit

interface GigabitEthernet 0/0/7

port link-type access

quit

interface GigabitEthernet 0/0/8

port link-type access

quit

interface GigabitEthernet 0/0/9

port link-type access

quit

interface GigabitEthernet 0/0/10

port link-type access

quit

interface GigabitEthernet 0/0/11

port link-type access

quit

interface GigabitEthernet 0/0/12

port link-type access

quit

interface GigabitEthernet 0/0/13

port link-type access

quit

interface GigabitEthernet 0/0/14

port link-type access

quit

interface GigabitEthernet 0/0/15

port link-type access

quit

interface GigabitEthernet 0/0/16

port link-type access

quit

interface GigabitEthernet 0/0/17

port link-type access

quit

interface GigabitEthernet 0/0/18

port link-type access

quit

interface GigabitEthernet 0/0/19

port link-type access

quit

interface GigabitEthernet 0/0/20

port link-type access

interface GigabitEthernet 0/0/21

port link-type access

quit

interface GigabitEthernet 0/0/22

port link-type access

quit

interface GigabitEthernet 0/0/23

port link-type access

quit

interface GigabitEthernet 0/0/24

port link-type access

quit

将端口加入到vlan中

vlan 1

port GigabitEthernet 0/0/1

quit

vlan 1

port GigabitEthernet 0/0/2

quit

vlan 1

port GigabitEthernet 0/0/3

quit

vlan 1

port GigabitEthernet 0/0/4

quit

vlan 2

port GigabitEthernet 0/0/5

quit

vlan 3

port GigabitEthernet 0/0/6

quit

vlan 4

port GigabitEthernet 0/0/7

quit

vlan 5

port GigabitEthernet 0/0/8

quit

vlan 6

port GigabitEthernet 0/0/9

quit

vlan 7

port GigabitEthernet 0/0/10

quit

port GigabitEthernet 0/0/11

quit

vlan 9

port GigabitEthernet 0/0/12

quit

vlan 10

port GigabitEthernet 0/0/13

quit

vlan 11

port GigabitEthernet 0/0/14

quit

vlan 12

port GigabitEthernet 0/0/15

quit

vlan 13

port GigabitEthernet 0/0/16

quit

vlan 14

port GigabitEthernet 0/0/17

quit

vlan 15

port GigabitEthernet 0/0/18

quit

vlan 16

port GigabitEthernet 0/0/19

port GigabitEthernet 0/0/20

port GigabitEthernet 0/0/21

port GigabitEthernet 0/0/22

port GigabitEthernet 0/0/23

port GigabitEthernet 0/0/24

quit

mux-vlan

启用SUB-VLNA

system-view

vlan 100

aggregate-vlan

access-vlan 1 to 16

使能super-VLAN的接口VLANIF100上的VLAN间Proxy ARP功能。(这条不配不能互访) system-view

interface vlanif100

arp-proxy inter-sub-vlan-proxy enable

配置单播静态路由(这条配完后才能上外网)

system-view

ip route-static 183.62.196.0 255.255.255.224 192.168.100.100

ip route-static 0.0.0.0 0.0.0.0 10.10.10.1

配置接口的环路检测功能,并且在环路消失后5秒钟内恢复网络 示例:

stp loop-protection 启动当前接口的环路保护功能 loopback-detect enable 用来使能接口的环路检测功能

loopback-detect action shutdown 用来配置接口的环路检测处理动作 loopback-detect recovery-time 5 用来配置环路消失后接口的恢复时间

sy

int g0/0/1

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/2

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/3

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/4

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/5

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/6

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/7

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 qui

int g0/0/8

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/9

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/5

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/11

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/12

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5 quit

int g0/0/13

stp loop-protection

loopback-detect enable

loopback-detect action shutdown loopback-detect recovery-time 5

quit

int g0/0/14

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/15

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/16

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/17

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/18

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/19

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/20

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/21

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/22

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/23

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

int g0/0/24

stp loop-protection

loopback-detect enable

loopback-detect action shutdown

loopback-detect recovery-time 5

quit

配置所有接口环路检测周期为2秒

sy

loopback-detect packet-interval 2

quit

配置三层的SNMP让深信服跨VLAN识别MAC地址。

snmp-agent sys-info version all

snmp-agent community read comaccess 设置外部设备取SNMP为只读权限 保存配置

save


相关文章

  • 华为交换机配置实例手册telnet密码配置方法
  • 华为交换机配置实例手册 telnet密码配置方法 sys 进入到系统视图 Enter system view, return to user view with Ctrl+Z. [Quidway]user-interface aux 0 [ ...查看


  • 华为S5700三交换机常用命令
  • 进入接口视图 操作步骤 1. 2. 3. 4. 5. 执行命令,进入系统视图. 执行命令 interface-type interface-number,进入指定接口的接口视图. 执行命令 description,配置接口描述. 执行命令, ...查看


  • 华为与CISCO路由器单臂路由实例
  • 需求:在局域网中,通过交换机上配置VLAN可以减少主机通信广播域的范围,当VLAN之间有部分主机需要通信,但交换机不支持三层交换时,可以采用一台支持802.1Q的路由器实现VLAN的互通.这需要在以太口上建立子接口,分配IP地址作为该VLA ...查看


  • 华为交换机两种端口聚合模式使用实例
  • 2.5 配置举例 介绍了两种模式下的典型应用场景举例. 2.5.1 配置手工负载分担模式链路聚合示例 2.5.2 配置静态LACP 模式链路聚合示例 2.5.1 配置手工负载分担模式链路聚合示例 2 LACP 配置 组网需求 如图2-4 所 ...查看


  • 华为STP配置案例
  • STP配置案例 1简介 在二层交换网络中,一旦存在环路就会造成报文在环路内不断循环和增生,产生广播风暴,从而占用所有的有效带宽,使网络变得无法正常通信. 在这种环境下生成树协议应运而生,生成树协议是一种二层管理协议,它通过有选择性地阻塞网络 ...查看


  • 华为路由器命令
  • 华为华为路由器交换机配置命令大全 一.计算机命令 PCAlogin:root 使用root用户 password:linux 口令是linux #shutdown-hnow 关机 #init 0 关机 #logout 用户注销 #login ...查看


  • 华为三层交换机配置步骤(最新修改版20130517)
  • 华为三层交换机配置步骤 一. VLAN配置 1.建立VLAN sys /进入特权模式 [Quidway]vlan 1 /建立vlan 1 [Quidway]ctrl+z /退出vlan1 到普通模式 [Quidway]vlan 2 /建立v ...查看


  • 华为认证网络工程师考试复习资料大全
  • <华为认证网络工程师>自测题一 1.在一个以太网中,30台PC通过QUTDWAY R2501路由器S0口连接INTERNET,QUIDWAY R2501路由器配置如下: Qutidway(config-if-e0)#ip add ...查看


  • 华为交换机配置命令手册及实验
  • Huawei交换机配置命令手册: 1.开始 建立本地配置环境,将主机的串口通过配置电缆与以太网交换机的Console口连接.在主机上运行终端仿真程序(如Windows的超级终端等),设置终端通信参数为:波特率为9600bit/s.8位数据位 ...查看


热门内容