H3C交换机路由器配置总结

2024-09-11 版权声明 我要投稿

H3C交换机路由器配置总结(推荐5篇)

H3C交换机路由器配置总结 篇1

H3C交换机配置代码

*中文切换

language-modeChinese|English

1.进入特权用户

system

//

2.命名交换机

sysname [名称]

3.查看配置情况

undo shutdown

//打开端口

display currect-config

//查看所有配置

dis vlan

//查看vlan

Quit

//返回上一级

Save

//保存

4.划分vlan

vlan [号]

//vlan 10

5.在划分vlan后分配端口

port ethernet0/2

//

port ethernet0/3 to ethernet0/5

//从3端口到5端口

6.进入端口分配vlan

int e0/3

//进入3号端口

port access vlan 2

//划分进vlan2

7.进入vlan划分IP

[S3026]interfacevlan 1

[S3026-Vlan-interface1]ip address 192.168.0.1 255.255.255.0

8.静态路由

ip route-static 0.0.0.0 0.0.0.0 10.65.1.2

9.设置默认网管

ip default-gateway 10.65.1.2

H3C交换机

######

1、system-view

进入系统视图模式

2、sysname为设备命名

3、display current-configuration 当前配置情况

4、language-mode Chinese|English中英文切换

5、interface Ethernet 1/0/1 进入以太网端口视图

6、port link-type Access|Trunk|Hybrid设置端口访问模式

7、undo shutdown

打开以太网端口

8、shutdown

关闭以太网端口

9、quit

退出当前视图模式

10、vlan 10

创建VLAN 10并进入VLAN 10的视图模式

11、port access vlan 10

在端口模式下将当前端口加入到vlan 10中

12、port E1/0/2 to E1/0/5

在VLAN模式下将指定端口加入到当前vlan中

13、port trunk permit vlan all

允许所有的vlan通过

H3C路由器

##

1、system-view

进入系统视图模式

2、sysname R1

为设备命名为R1

3、display ip routing-table 显示当前路由表

4、language-mode Chinese|English中英文切换

5、interface Ethernet 0/0 进入以太网端口视图

6、ip address 192.168.1.1 255.255.255.0

配置IP地址和子网掩码

7、undo shutdown

打开以太网端口

8、shutdown

关闭以太网端口

9、quit

退出当前视图模式

10、ip route-static 192.168.2.0 255.255.255.0 192.168.12.2 description To.R2 配置静态路由

11、ip route-static 0.0.0.0 0.0.0.0 192.168.12.2 description To.R2 配置默认的路由

H3C S3100 Switch

H3C S3600 Switch

H3C MSR 20-20 Router

######

1、调整超级终端的显示字号;

2、捕获超级终端操作命令行,以备日后查对;

3、language-mode Chinese|English中英文切换;

4、复制命令到超级终端命令行,粘贴到主机;

5、交换机清除配置 :reset save ;reboot ;

6、路由器、交换机配置时不能掉电,连通测试前一定要

检查网络的连通性,不要犯最低级的错误。7、192.168.1.1/24

等同

192.168.1.1 255.255.255.0;在配置交换机和路由器时,192.168.1.1 255.255.255.0 可以写成:

192.168.1.1 24

8、设备命名规则:地名-设备名-系列号例:PingGu-R-S3600

#

H3C华为交换机端口绑定基本配置2008-01-22 13:40

1,端口 MAC

a)AM命令

使用特殊的AM User-bind命令,来完成MAC地址与端口之间的绑定。例如:

[SwitchA]am user-bind mac-address 00e0-fc22-f8d3 interface Ethernet 0/1

配置说明:由于使用了端口参数,则会以端口为参照物,即此时端口E0/1只允许PC1上网,而使用其他未绑定的MAC地址的PC机则无法上网。但

是PC1使用该MAC地址可以在其他端口上网。

b)mac-address命令

使用mac-address static命令,来完成MAC地址与端口之间的绑定。例如:

[SwitchA]mac-address static 00e0-fc22-f8d3 interface Ethernet 0/1 vlan 1

[SwitchA]mac-address max-mac-count 0

配置说明:由于使用了端口学习功能,故静态绑定mac后,需再设置该端口mac学习数为0,使其他PC接入此端口后其mac地址无法被学习。

2,IP MAC

a)AM命令

使用特殊的AM User-bind命令,来完成IP地址与MAC地址之间的绑定。例如:

[SwitchA]am user-bind ip-address 10.1.1.2 mac-address 00e0-fc22-f8d3

配置说明:以上配置完成对PC机的IP地址和MAC地址的全局绑定,即与绑定的IP地址或者MAC地址不同的PC机,在任何端口都无法上网。

支持型号:S3026E/EF/C/G/T、S3026C-PWR、E026/E026T、S3050C、E050、S3526E/C/EF、S5012T/G、S5024G

b)arp命令

使用特殊的arp static命令,来完成IP地址与MAC地址之间的绑定。例如:

[SwitchA]arp static 10.1.1.2 00e0-fc22-f8d3

配置说明:以上配置完成对PC机的IP地址和MAC地址的全局绑定。

3,端口 IP MAC

使用特殊的AM User-bind命令,来完成IP、MAC地址与端口之间的绑定。例如:

[SwitchA]am user-bind ip-address 10.1.1.2 mac-address 00e0-fc22-f8d3 interface Ethernet 0/1

配置说明:可以完成将PC1的IP地址、MAC地址与端口E0/1之间的绑定功能。由于使用了端口参数,则会以端口为参照物,即此时端口E0/1只允

许 PC1上网,而使用其他未绑定的IP地址、MAC地址的PC机则无法上网。但是PC1使用该IP地址和MAC地址可以在其他端口上网。

####

[S2016-E1-Ethernet0/1]mac-address max-mac-count 0;

进入到端口,用命令mac max-mac-count 0(端口mac学习数设为0)

[S2016-E1]mac static 0000-9999-8888 int e0/1 vlan 10;

将0000-9999-8888绑定到e0/1端口上,此时只有绑定mac的pc可以通过此口上网,同时E0/1属于vlan 10

就这样,ok了,不过上面两个命令顺序不能弄反,除非端口下没有接pc

####

dis vlan显示vlan

name text 指定当前vlan的名称

undo name 取消

[h3c] vlan 2

[h3c-vlan2]name test vlan

dis users 显示用户

dis startup 显示启动配置文件的信息

dis user-interface 显示用户界面的相关信息

dis web users 显示web用户的相关信息。

header login 配置登陆验证是显示信息

header shell

undo header

lock 锁住当前用户界面

acl访问控制列表acl number inbound/outbound

[h3c]user-interface vty 0 4

[h3c-vty0-4] acl 2000 inbound

shutdown:关闭vlan接口

undo shutdown 打开vlan接口

关闭vlan1 接口

[h3c] interface vlan-interface 1

[h3c-vlan-interface] shutdown

vlanvlan-id 定义vlan

undovalnvlan-id

displayip routing-table

displayip routing-table protocol static

displayip routing-table statistics

display ip routing-table verbose 查看路由表的全部详细信息

interface vlan-interface vlan-id 进入valn

management-vlanvlan-id 定义管理vlan号

reset ip routing-table statistics protocol all 清除所有路由协议的路由信息.display garp statistics interface GigabitEthernet 1/0/1 显示以太网端口上的garp统计信息

display voice vlan status 查看语音vlan状态

[h3c-GigabitEthernet1/0/1] broadcast-suppression 20 允许接受的最大广播流量为该端口传输能力的20%.超出部分丢弃.[h3c-GigabitEthernet1/0/1] broadcast-suppression pps 1000 每秒允许接受的最大广播数据包为1000传输能力的20%.超出部分丢弃.display interface GigabitEthernet1/0/1 查看端口信息

display brief interface GigabitEthernet1/0/1 查看端口简要配置信息

display loopback-detection 用来测试环路测试是否开启

display transceiver-information interface GigabitEthernet1/0/50 显示光口相关信息

duplex auto/full/half

[h3c]interface GigabitEthernet1/0/1

[h3c-GigabitEthernet1/0/1]duplux auto 设置端口双工属性为自协商

port link-type access/hybrid/trunk 默认为access

port trunk permit vlan all 将trunk扣加入所有vlan中

reset counters interface GigabitEthernet1/0/1 清楚端口的统计信息

speed auto 10/100/1000

display port-security 查看端口安全配置信息

am user-bind mac-addr 00e0-fc00-5101 ip-addr 10.153.1.2 interface GigabitEthernet1/0/1 端口ip绑定

display arp显示arp

display am user-bind 显示端口绑定的配置信息

display mac-address 显示交换机学习到的mac地址

display stp显示生成树状态与统计信息

[h3c-GigabitEthernet1/0/1]stp instance 0 cost 200 设置生成树实例0上路径开销为200

stp cost 设置当前端口在指定生成树实例上路径开销。instance-id 为0-16 0表cist 取值范围1-200000

display system-guard ip-record 显示防攻击记录信息.system-guard enable 启用系统防攻击功能

display icmp statistics icmp流量统计

displayip socket

displayip statistics

displayacl all

acl number acl-number match-order auto/config

acl-number(2000-2999 是基本acl 3000-3999是高级acl为管理员预留的编号)

rule deny/permit protocal

访问控制

[h3c] acl number 3000

[h3c-acl-adv-3000]rule permit tcp source 129.9.0.0 0.0.255.255 destiNation 202.38.160.0 0.0.255.255 destiNation-port eq 80(定义高级acl 3000,允许129.0.0/16网段的主机向202.38.160/24网段主机访问端口80)

rule permit source 211.100.255.0 0.255.255.255

rule deny cos 3 souce 00de-bbef-adse ffff-ffff-fffdest 0011-4301-9912 ffff-ffff-ffff

(禁止mac地址00de-bbef-adse发送到mac地址0011-4301-9912且802.1p优先级为3的报文通过)

display qos-interface GigabitEthernet1/0/1 traffic-limit 查看端口上流量

端口速率限制

line-rate inbound/outbound target-rate

inbound:对端口接收报文进行速率限制

outbound: 对端口发送报文进行速率限制

target-rate 对报文限制速率,单位kbps 千兆口 inbound范围1-1000000 outbound范围20-1000000

undo line-rate取消限速.[h3c]interface GigabitEthernet1/0/1

[h3c-GigabitEthernet1/0/1]line-rate outbound 128 限制出去速率为128kbps

displayarp | include 77

display arp count 计算arp表的记录数

display ndp显示交换机端口的详细配置信息。

display ntdp device-list verbose 收集设备详细信息

实验八单臂路由

设置Pca ip:10.65.1.1 gateway:10.65.1.2

设置PCB ip:10.66.1.1 gateway:10.66.1.2

1.一个接口两个IP的情况

system

password:

[Quidway]interface ethernet0

[Quidway-Ethernet0]ipaddr 10.65.1.2 255.255.255.0

[Quidway-Ethernet1]ipaddr 10.66.1.2 255.255.255.0 secondary

[Quidway-Ethernet1]undo shutdown

[root@Pca root]#ping 10.66.1.1 通

2.划分两个子接口,对两个vlan的路由

[SwitchA]vlan 2

[SwitchA-vlan2]port e0/3

[SwitchA]vlan 3

[SwitchA-vlan3]port e0/6

[SwitchA]ine e0/1

[SwitchA-Ethernet0/1]port link-type trunk

[SwitchA-Ethernet0/1]port trunk permit vlan all

[SwitchA-Ethernet0/1]port trunk encap dot1q

[SwitchA]discurr

[Quidway]int e0

[SwitchA-Ethernet0]int e0.1

[SwitchA-Ethernet0.1]encapsulation dot1q 2

[SwitchA-Ethernet0.1]ipaddr 10.65.1.2 255.255.255.0

[SwitchA-Ethernet0.1]nudo shut

[SwitchA-Ethernet0.1]int e0.2

[SwitchA-Ethernet0.2]encapsulation dot1q 2

[SwitchA-Ethernet0.2]ipaddr 10.66.1.2 255.255.255.0

[SwitchA-Ethernet0.2]nudo shut

[SwitchA]discurr

H3C交换机路由器配置总结 篇2

1.1 路由器组网[1][2]

路由器(Router)是一种负责寻径的网络路由设备,根据互连网络之间不同信道的实时状态自动选择和设定路由,以最佳路径,按前后顺序转发数据包,发挥了交通枢纽的作用。

路由器的选型是根据网络互连的方式与规模、用户应用需求和网络性能标准而定。以校园局域网为例,参与互连通信的逻辑子网数量多,数据交换量大,应考虑选择企业级路由器,因为接入级路由器虽然安装方便且有价格优势,但传输率低、转发速度慢,很容易产生网络之间的路由瓶颈;而且接入级路由器一般只配2个局域网接口(只能与1个子网物理互连),当用户需要上网则要另配宽带路由器。

路由器组网的参考案例如图1所示。

分析:图1是一个由接入路由器和宽带路由器混搭而组建的小型路由网络。这个参考案例的性价比较高,充分利用了宽带路由器的固有特性,与之组成一个模拟的多端口输入、能访问外网的路由设备,不仅解决了4个VLAN之间都能互连,又能访问服务器和互联网。

1.2 三层交换机组网[3]

三层交换机是二层交换机与路由器软硬件有机结合的路由设备。对于数据包转发等规律性的工作过程,通过硬件高速实现;而路由信息更新、路由表维护、路由计算、路由确定等功能,则由内置软件实现。由于三层交换机一次路由就可以多次转发,非常适用于数据交换频繁的局域网中。

三层交换机组网的参考案例如图2所示。

分析:图2这个参考案例的特点是用户虽多但数据传输量不是太大,采用单台中高档的三层交换机就能够处理60个VLAN之间的路由转发,因此性价比极高。

1.3 三层交换机的优势[2]

路由器只有路由转发功能,三层交换机除了具有路由转发功能,还增加了数据交换功能,能够将已完成路由的数据高速地交换,满足了局域网数据交换频繁的应用需求,有效消除了网络的瓶颈。

三层交换机在局域网互连中的优势主要有:(1)互连带宽任意分配。(2)信息资源配置合理。(3)网络互连成本降低。(4)路由交换操作灵活。

2 三层交换机的配置方案

三层交换机的配置方案包括基础配置和高级配置,前者保障网络能够正常运作,后者配合日常维护与管理策略。

2.1 基础配置[7,8,9]

基础配置包括有划分全网VLAN、指定VLAN网关、指定VLAN端口、配置静态路由等内容。

划分全网VLAN:

在三层交换机内划分的是全网络的VLAN,在划分VLAN之前应做好相应的IP规划,确认VLAN互连及用户应用需求。

指定VLAN网关:

给每一个VLAN指定一个网关(IP地址)。VLAN之间的路由策略及指向,一般由企业管理者代表制定,网络管理员负责实施。

指定VLAN端口:

这个步骤有两个任务,一是指定核心层VLAN所属用户的各个端口;二是指定迎接从汇聚层或接入层上来的VLAN群的各个汇聚端口(VLAN trunk)。

配置静态路由:

静态路由是指手工配置的路由信息(指令),优点是安全保密性高。

配置案例示范

小型的路由交换网参考原型如图3所示,用户分布在接入层的3个VLAN中(Vlan01、02、03);服务器与宽带路由器划在Vlan04;三层交换机的⑥、⑦端口分别是指定的VLAN trunk端口。网络的应用需求是:3个VLAN的用户都能访问服务器,除了Vlan02外,Vlan01、03还可以访问Internet。

二层交换机S2A和S2B的配置省略,三层交换机S3(H3C)的具体配置:(略)。

路由设置命令如下所示:

[s3]ip route-static 0.0.0.0 0 192.168.1.2 (vlan01,02,03访问服务器的路径)

[s3]ip route-static 192.168.1.1 255.255.255.0 192.168.10.0(vlan01访问Internet的路径)

[s3]ip route-static 192.168.1.1 255.255.255.0 192.168.30.0(vlan03访问Internet的路径)

2.2 高级配置[7,8,10]

三层交换机的高级配置项目一般有如下几种:

(1)流量控制设置——流量控制设置把流经端口的异常流量限制在一定的范围内,避免交换机的带宽被无限制滥用,从而避免网络堵塞。

(2)广播风暴控制设置——启用该设置能够有效抑制网络广播风暴,避免网络瘫痪。

(3)端口保护设置——三层交换机有些重要的端口定义不能与其他端口通信的,这些重要端口必须通过该设置保护起来。

(4)端口安全设置——该设置能有效阻止泛洪攻击和黑客入侵。

(5)端口汇聚设置——通过该设置可以增加网络节点输入带宽,允许网络连接设备之间并行联接,提高整个网络的速率和带宽。

(6)远程设置——网络管理员能够在远距离地管理三层交换机。第一种方式是通过Telnet协议实现。第二种方式是利用Web浏览器远程访问实现。

3 三层交换机的管理策略

三层交换机当前最重要的几个管理策略如下:

(1)提供良好工作环境[5,6,7]。三层交换机重要的是工作环境必须满足以下要求:

1)设备安装应符合国家建设标准。

2)设备所处的工作环境应有保障。

3)设备线缆的铺设应符合现行的国家综合布线标准及规范。

4)设备应独立配置不间断电源。

5)杜绝人为的不良倾向及现象。

(2)杜绝人为配置错误[8,9]。为了保障三层交换机最佳工作状态,必须杜绝以下常见的配置错误。

1)基础设置失当。

2)重分配路由忽略过滤。

3)重分配路由忘记设置子网关键字。

4)随意改动路由表配置。

(3)启用ACL过滤技术[8,9,10]。三层交换机内置的ACL(访问控制列表)技术,可分为以下两种类型:

1)基本访问控制列表。

2)高级访问控制列表。

(4)防范ARP入侵攻击[11,12]。防范ARP对三层交换机的攻击可以考虑以下几种措施:

1)绑定合法用户的MAC与IP地址。

2)绑定三层交换机的端口、VLAN与网关。

3)借助硬件防火墙,拦截ARP攻击、拦截IP冲突、分析ARP数据、监测ARP缓存、主动防御、追踪攻击者。

4)借助三层交换机的高级设置,通过限制ARP流量的策略,减低对三层交换机入侵攻击的风险。

(5)管理网络运行状态[8,9,10]。应充分利用三层交换机主动地管理网络运行状态,有以下几种措施:

1)定时检查MAC地址与IP地址的映射表。

2)实时调整通过汇聚端口的VLAN。

3)为网络服务器拓宽通信信道。

4 结语

路由器和三层交换机都属网络互连所需的路由设备,路由器适合广域网、城域网相互之间,局域网与广域网、城域网相互之间的互连;三层交换机则适合局域网的内联,即虚拟子网(VLAN)之间的相互通信。路由技术与三层交换技术,两者之间紧密联系,一齐促进路由交换网的发展。

参考文献

[1]伍仁勇,付彬.网络交换与路由[M].湖南大学出版社,201 1:10—135.

[2]王亚楠.交换与路由组网技术[M].机械工业出版社,2014:56—170.

Cisco路由器交换机安全配置 篇3

为了使设备配置简单或易于用户使用,Router或Switch初始状态并没有配置安全措施,所以网络具有许多安全脆弱性,因此网络中常面临如下威胁:

1. DDOS攻击

2. 非法授权访问攻击,

口令过于简单,口令长期不变,口令明文创送,缺乏强认证机制。

3.IP地址欺骗攻击

….

利用Cisco Router和Switch可以有效防止上述攻击。

二、保护路由器

2.1 防止来自其它各省、市用户Ddos攻击

最大的威胁:Ddos, hacker控制其他主机,共同向Router访问提供的某种服务,导致Router利用率升高。

Ddos是最容易实施的攻击手段,不要求 有高深的网络知识就可以做到。

如SMURF DDOS 攻击就是用最简单的命令ping做到的。利用IP 地址欺骗,结合ping就可以实现DDOS攻击。

防范措施:

应关闭某些缺省状态下开启的服务,以节省内存并防止安全破坏行为/攻击

Router(config-t)#no service finger

Router(config-t)#no service pad

Router(config-t)#no service udp-small-servers

Router(config-t)#no service tcp-small-servers

Router(config-t)#no ip http server

Router(config-t)#no service ftp

Router(config-t)#no ip bootp server

以上均已经配置。

防止ICMP-flooging攻击

Router(config-t)#int e0

Router(config-if)#no ip redirects

Router(config-if)#no ip directed-broadcast

Router(config-if)#no ip proxy-arp

Router(config-t)#int s0

Router(config-if)#no ip redirects

Router(config-if)#no ip directed-broadcast

Router(config-if)#no ip proxy-arp

以上均已经配置。

除非在特别要求情况下,应关闭源路由:

Router(config-t)#no ip source-route

以上均已经配置。

禁止用CDP发现邻近的cisco设备、型号和软件版本

Router(config-t)#no cdp run

Router(config-t)#int s0

Router(config-if)#no cdp enable

如果使用works2000网管软件,则不需要此项操作

此项未配置。

使用CEF转发算法,防止小包利用fast cache转发算法带来的Router内存耗尽、CPU利用率升高。

Router(config-t)#ip cef

2.2 防止非法授权访问

通过单向算法对 “enable secret”密码进行加密

Router(config-t)#enable secret

Router(config-t)#no enable password

Router(config-t)#service password-encryption

?vty端口的缺省空闲超时为10分0秒

Router(config-t)#line vty 0 4

Router(config-line)#exec-timeout 10 0

应该控制到VTY的接入,不应使之处于打开状态;Console应仅作为最后的管理手段:

如只允许130.9.1.130 Host 能够用Telnet访问.

access-list 110 permit ip 130.9.1.130 0.0.0.0 130.1.1.254 0.0.0.0 log

line vty 0 4

access-class 101 in

exec-timeout 5 0

2.3 使用基于用户名和口令的强认证方法 Router(config-t)#username admin pass 5 434535e2

Router(config-t)#aaa new-model

Router(config-t)#radius-server host 130.1.1.1 key key-string

Router(config-t)#aaa authentication login neteng group radius local

Router(config-t)#line vty 0 4

Router(config-line)#login authen neteng

三、保护网络

3.1防止IP地址欺骗

经常冒充地税局内部网IP地址,获得一定的访问权限,

在省地税局和各地市的WAN Router上配置:

防止IP地址欺骗--使用基于unicast RPF(逆向路径转发)

包发送到某个接口,检查包的IP地址是否与CEF表中到达此IP地址的最佳路由是从此接口转发,若是,转发,否则,丢弃。

Router(config-t)#ip cef

Router(config-t)#interface e0

Router(config-if)# ip verify unicast reverse-path 101

Router(config-t)#access-list 101 permit ip any any log

注意:通过log日志可以看到内部网络中哪些用户试图进行IP地址欺骗。

此项已配置。

防止IP地址欺骗配置访问列表

防止外部进行对内部进行IP地址

Router(config-t)#access-list 190 deny ip 130.9.0.0 0.0.255.255 any

Router(config-t)#access-list 190 permit ip any any

Router(config-t)#int s4/1/1.1

Router(config-if)# ip access-group 190 in

防止内部对外部进行IP地址欺骗

Router(config-t)#access-list 199 permit ip 130.9.0.0 0.0.255.255 any

Router(config-t)#int f4/1/0

Router(config-if)# ip access-group 199 in

四、保护服务器

对于地税局内部的某些Server,如果它不向各地提供服务可以在总局核心Cisco Router上配置空路由。

ip route 130.1.1.1 255.255.255.255.0 null

在WAN Router上配置CBAC,cisco状态防火墙,防止Sync Flood攻击

hr(config)#int s0/0

hr(config-if)#ip access-group 100 in

hr(config)#int f0/0

hr(config-if)#ip inspect insp1 in

hr(config)#ip inspect audit-trial

hr(config)#ip inspect name insp1 tcp

hr(config)#ip inspect max-incomplete high 350

hr(config)#ip inspect max-incomplete low 240

hr(config)#ip audit

hr(config)#access-list 100 permit tcp any 130.1.1.2 eq 80

在WAN Router 上配置IDS入侵检测系统

hr(config)#ip audit name audit1 info action alarm

hr(config)#ip audit name audit1 attack action alarm drop

reset

hr(config)#ip audit audit1 notify log

hr(config)#int s0/0

hr(config)#ip audit audit1 in

五、网络运行监视

配置syslog server,将日志信息发送到syslog server上

Syslog Server纪录Router的平时运行产生的一些事件,如广域口的up, down

H3C配置导入导出总结 篇4

一、h3c配置远程登录

1、服务器端配置(下面4步没有先后顺序)

1)开启远程登录服务

[h3c]telnet server enable

开启远程登录

2)创建telnet用户

[h3c]local-user h3c

创建用户名h3c [h3c-luser-h3c]password cipher/simple h3c

为h3c创建密文/明文显示的密码

[h3c-luser-h3c]service-type telnet

定义该用户的服务类型为telnet [h3c-luser-h3c]authorization-attribute level 3授权当前用户的命令行级别为3级——管理级P40 3)设定远程登录用户属性

[h3c]user-interface vty 0 4

设置虚拟用户端口

[h3c-ui-vty0-4]authentication-mode scheme

设定远程登录用户的登录方式使用用户名和密码

[h3c-ui-vty0-4]user privilege level 3

设置远程登录用户登录后的最高级别

4)配置IP地址

[h3c]interface vlan-interface 1 [h3c-vlan-interface1]ip address 192.168.1.1 24 2、客户端口配置

1)配置IP地址

192.168.1.2/24

3、登录

开始——程序——附件——命令提示符——telnet 192.168.1.1

二、导出配置文件

1、保存配置:

1)显示保存的配置:Display saved-cofiguration(结果是:配置文件不存在)

2)保存配置文件:Save(将current-configuration内容保存到saved-configuration中,文件名是:startup.cfg。保存过程中先:Y确认保存,再确认使用默认文件名。此时再显示:此时可以看到配置文件内容。)说明:

1)移除保存的配置文件:reset saved-cofiguration(再显示时,提示:配置文件不存在)2)重启设备:reboot 交换机重启时:直接确认为清除current-configuration 路由器重启时:直接确认为保存current-configuration 3)路由器的默认配置中g0/0口ip为192.168.1.1,telnet用户名为admin

2、创建ftp用户

[h3c]local-user h3c1

创建用户名h3c1 [h3c-luser-h3c]password cipher/simple h3c1

为h3c1创建密文/明文显示的密码

[h3c-luser-h3c]service-type ftp

定义该用户的服务类型为ftp [h3c-luser-h3c]authorization-attribute level 3授权当前用户的命令行级别为3级

3、开启远程登录服务

[h3c]ftp server enable

4、登录服务器

>ftp 192.168.1.1 ftp>dir/ls(dir显示包括文件读写属性、大小、日期时间、文件名等属性,ls只显示文件名)

ftp>Get startup.cfg d:/sw1.cfg(将保存的配置文件从服务器上下载到本地机上,用记事本打开可以查看里面内容)说明:

上传文件:put 1)将d:/sw1.cfg文件通过记事本修改(如:将sysname 改为zs)并保存

2)上传文件Put d:/sw1.cfg startup.cfg(若上传后的文件名不是startup.cfg,则需要用设置下次启动时的配置文件,命令为:tartup saved-configuration filename)

3)重新启动reboot,此时可以看到系统提示符为,说明修改的配置文件已经生效。

1、保证你的主机和目标设备网络可达,2、在目标设备上开启ftp服务,并设置相应的用户名、密码、服务类型

3、直接在主机上命令行中运行ftp 目的主机地址(192.168.5.11),输入用户名和密码后,使用get命令获取你想要的文件

4、如果不知道那个是你的配置文件可以通过如下命令

dis start-up / dis saved-config(这个是保存的配置配件,命令好像是这样的,记得不是很清了)

或者直接在尖括号输入 dir

二、使用FTP方式

步骤

1、在PC机“开始菜单”的“运行”栏中键入“cmd”,进入DOS界面,保证PC机可以PING通设备。

步骤

2、在交换机上启动FTP服务器,并配置从PC机上FTP登陆时的用户名和密码

[H3C]ftp server enable /启动FTP服务/

% FTP server has been started

[H3C]local-user guest /增加一个本地用户,用户名为guest/

New local user added.[H3C-luser-ftp]password simple ftp /配置用户名为guest的密码为ftp/

[H3C-luser-ftp]service-type ftp ftp-directory flash:/

/指定此用户的服务类型为ftp,且ftp后的上传下载目录为flash下/

步骤

3、在PC机“开始菜单”的“运行”栏中键入“cmd”,进入DOS界面(1)获取配置文件

C:>ftp 10.10.0.254 Connected to 10.10.0.254.220 FTP service ready.User(10.10.0.254:(none)): guest 331 Password required for guest.Password: 230 User logged in.ftp> dir 200 Port command okay.150 Opening ASCII mode data connection for *.-rwxrwxrwx 1 noone nogroup 5287115 Oct 31 2006 s5500si-cmw5-rwxrwxrwx 1 noone nogroup 2254 May 05 04:05 config.cfg 226 Transfer complete.ftp: 148 bytes received in 0.02Seconds 9.25Kbytes/sec.ftp> get config.cfg 200 Port command okay.150 Opening ASCII mode data connection for config.cfg.226 Transfer complete.ftp: 2254 bytes received in 0.00Seconds 2254000.00Kbytes/sec.【提示】

1、此时在PC机的C:文件夹下就可以看到备份的config.cfg文件了,可以通过记事本或写字板打开

(2)上传配置文件

# 以FTP方式登录FTP服务器,上传.bin文件,并存放于FTP服务器的根目录下。

c:> ftp 10.10.0.254

ftp> put aaa.bin bbb.bin

远程用户——-internet——-F100 采用l2tp方式 sysname XXXX //设备名称 # l2tp enable //开启l2tp功能

# firewall packet-filter enable firewall packet-filter default permit # undo connection-limit enable connection-limit default deny connection-limit default amount upper-limit 50 lower-limit 20 # firewall statistic system enable # radius scheme system server-type extended # domain system ip pool 1 192.1.2.2 192.1.2.10 # local-user admin password cipher.]@USE=B,53Q=^Q`MAF4<1!service-type telnet terminal level 3 local-user xxx //配置拨号用户 password simple 123456 service-type ppp interface Virtual-Template1 //配置虚拟接口模板1及其验证方式

ppp authentication-mode pap ip address 192.168.2.1 255.255.255.0 remote address pool 1 # interface Ethernet1/0 ip address 172.16.2.2 255.255.255.252 # interface Ethernet2/0 speed 10 duplex half ip address 60.6.3.136 255.255.255.0 # interface NULL0 # firewall zone local set priority 100 # firewall zone trust //把虚拟接口模板添加进入安全域 add interface Ethernet1/0 add interface Virtual-Template1 set priority 85 # firewall zone untrust add interface Ethernet2/0 set priority 5 # firewall zone DMZ set priority 50 # firewall interzone local trust # firewall interzone local untrust # firewall interzone local DMZ # firewall interzone trust untrust # firewall interzone trust DMZ # firewall interzone DMZ untrust # l2tp-group 1 //配置l2tp组1

undo tunnel authentication //取消隧道验证

allow l2tp virtual-template 1 //配置使用名字的方式发起l2tp连接 # FTP server enable # telnet source-interface Ethernet1/0 # undo dhcp enable # ip route-static 0.0.0.0 0.0.0.0 60.6.3.1 preference 60 //配置静态默认路由

ip route-static 192.1.100.0 255.255.255.0 172.16.2.1 preference 60 //配置到内网静态路由

ip route-static 192.2.100.0 255.255.255.0 172.16.2.1 preference 60 //配置到内网静态路由 # user-interface con 0 user-interface vty 0 4 authentication-mode scheme # return

windows L2TP客户端配置(以XP为例)配置L2TP 拨号连接:

7、输入准备连接的L2TP 服务器的IP 地址“60.6.3.136”,单击“下一步”

8、单击“完成”。

9、双击“l2tp”连接,在l2tp 连接窗口,单击“属性”。

10、选择“安全”属性页,选择“高级(自定义设置)”,单击“设置”。

11、在“数据加密”中选择“可选加密(没有加密也可以连接)”。

12、在“允许这些协议”选中“不加密的密码(PAP)”、“质询握手身份验证协议(CHAP)”、“Microsoft CHAP(MS-CHAP)”,单击“确定”。

13、选择“网络”属性页面,在“VPN 类型”选择“L2TP IPSec VPN”。

14、选中“Internet 协议(TCP/IP)”

15、“NWLink IPX/SPX/NetBIOS Compatible Transport Prococol”、“微软网络文件和打印共享”、“微软网络客户”协议不选。

16、单击“确定”,保存所做的修改。2.修改注册表

缺省的Windows XP L2TP 传输策略不允许L2TP 传输不使用IPSec 加密。可以通过修改 Windows XP 注册表来禁用缺省的行为: 通过附件自动修改

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesRasManParameters] “ProhibitIPSec”=dword:00000001 ============================================= //允许外网UDP数据访问192.168.0.1

nat server protocol udp global 1.1.1.1 any inside 192.168.0.1 any

思科交换机配置命令总结 篇5

1.switch(config)# hostname hostname 在基于CLI的交换机上设置主机名/系统名: switch(enable)set system name name-string 2.在基于IOS的交换机上设置登录口令: switch(config)# enable password level 1 password 在基于CLI的交换机上设置登录口令: switch(enable)set password switch(enable)set enalbepass 3.在基于IOS的交换机上设置远程访问: switch(config)# interface vlan 1 switch(config-if)# ip address ip-address netmask switch(config-if)# ip default-gateway ip-address 在基于CLI的交换机上设置远程访问: switch(enable)set interface sc0 ip-address netmask broadcast-address switch(enable)set interface sc0 vlan switch(enable)set ip route default gateway 4.在基于IOS的交换机上启用和浏览CDP信息: switch(config-if)# cdp enable switch(config-if)# no cdp enable 为了查看Cisco邻接设备的CDP通告信息: switch# show cdp interface [type modle/port] switch# show cdp neighbors [type module/port] [detail] 在基于CLI的交换机上启用和浏览CDP信息: switch(enable)set cdp {enable|disable} module/port 为了查看Cisco邻接设备的CDP通告信息: switch(enable)show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS的交换机的端口描述: switch(config-if)# description description-string 基于CLI的交换机的端口描述: switch(enable)set port name module/number description-string 6.在基于IOS的交换机上设置端口速度: switch(config-if)# speed{10|100|auto} 在基于CLI的交换机上设置端口速度: switch(enable)set port speed moudle/number {10|100|auto} switch(enable)set port speed moudle/number {4|16|auto} 7.在基于IOS的交换机上设置以太网的链路模式: switch(config-if)# duplex {auto|full|half} 在基于CLI的交换机上设置以太网的链路模式: switch(enable)set port duplex module/number {full|half} 8.在基于IOS的交换机上配置静态VLAN: switch# vlan database switch(vlan)# vlan vlan-num name vla switch(vlan)# exit switch# configure teriminal switch(config)# interface interface module/number switch(config-if)# switchport mode access switch(config-if)# switchport access vlan vlan-num switch(config-if)# end 在基于CLI的交换机上配置静态VLAN: switch(enable)set vlan vlan-num [name name] switch(enable)set vlan vlan-num mod-num/port-list 9.在基于IOS的交换机上配置VLAN中继线: switch(config)# interface interface mod/port switch(config-if)# switchport mode trunk switch(config-if)# switchport trunk encapsulation {isl|dotlq} switch(config-if)# switchport trunk allowed vlan remove vlan-list switch(config-if)# switchport trunk allowed vlan add vlan-list 在基于CLI的交换机上配置VLAN中继线: switch(enable)set trunk module/port [on|off|desirable|auto|nonegotiate] Vlan-range [isl|dotlq|dotl0|lane|negotiate] 10.在基于IOS的交换机上配置VTP管理域: switch# vlan database switch(vlan)# vtp domain domain-name 在基于CLI的交换机上配置VTP管理域: switch(enable)set vtp [domain domain-name] 11.在基于IOS的交换机上配置VTP 模式: switch# vlan database switch(vlan)# vtp domain domain-name switch(vlan)# vtp {sever|cilent|transparent} switch(vlan)# vtp password password 在基于CLI的交换机上配置VTP 模式: switch(enable)set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password] 12.在基于IOS的交换机上配置VTP版本: switch# vlan database switch(vlan)# vtp v2-mode 在基于CLI的交换机上配置VTP版本: switch(enable)set vtp v2 enable 13.在基于IOS的交换机上启动VTP剪裁: switch# vlan database switch(vlan)# vtp pruning 在基于CL I 的交换机上启动VTP剪裁: switch(enable)set vtp pruning enable 14.在基于IOS的交换机上配置以太信道: switch(config-if)# port group group-number [distribution {source|destination}] 在基于CLI的交换机上配置以太信道: switch(enable)set port channel moudle/port-range mode{on|off|desirable|auto} 15.在基于IOS的交换机上调整根路径成本: switch(config-if)# spanning-tree [vlan vlan-list] cost cost 在基于CLI的交换机上调整根路径成本: switch(enable)set spantree portcost moudle/port cost switch(enable)set spantree portvlancost moudle/port [cost cost][vlan-list] 16.在基于IOS的交换机上调整端口ID: switch(config-if)# spanning-tree[vlan vlan-list]port-priority port-priority 在基于CLI的交换机上调整端口ID: switch(enable)set spantree portpri {mldule/port}priority switch(enable)set spantree portvlanpri {module/port}priority [vlans] 17.在基于IOS的交换机上修改STP时钟: switch(config)# spanning-tree [vlan vlan-list] hello-time seconds switch(config)# spanning-tree [vlan vlan-list] forward-time seconds ` switch(config)# spanning-tree [vlan vlan-list] max-age seconds 在基于CLI的交换机上修改STP时钟: switch(enable)set spantree hello interval[vlan] switch(enable)set spantree fwddelay delay [vlan] switch(enable)set spantree maxage agingtiame[vlan] 18.在基于IOS的交换机端口上启用或禁用Port Fast 特征: switch(config-if)#spanning-tree portfast 在基于CLI的交换机端口上启用或禁用Port Fast 特征: switch(enable)set spantree portfast {module/port}{enable|disable} 19.在基于IOS的交换机端口上启用或禁用UplinkFast 特征: switch(config)# spanning-tree uplinkfast [max-update-rate pkts-per-second] 在基于CLI的交换机端口上启用或禁用UplinkFast 特征: switch(enable)set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocols off|on] 20.为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name 21.为了从一条中继链路上删除VLAN,可使用下列命令: switch(enable)clear trunk module/port vlan-range 22.用show vtp domain 显示管理域的VTP参数.23.用show vtp statistics显示管理域的VTP参数.24.在Catalyst交换机上定义TrBRF的命令如下: switch(enable)set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {ieee|ibm}] 25.在Catalyst交换机上定义TrCRF的命令如下: switch(enable)set vlan vlan-num [name name] type trcrf {ring hex-ring-num|decring decimal-ring-num} parent vlan-num 26.在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口: switch(enable)set vlan vlan-num mod-num/port-num 27.命令show spantree显示一个交换机端口的STP状态.28.配置一个ELAN的LES和BUS,可以使用下列命令: ATM(config)# interface atm number.subint multioint ATM(config-subif)# lane serber-bus ethernet elan-name 29.配置LECS: ATM(config)# lane database database-name ATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-address ATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-address ATM(lane-config-databade)# name …

30.创建完数据库后,必须在主接口上启动LECS.命令如下: ATM(config)# interface atm number ATM(config-if)# lane config database database-name ATM(config-if)# lane config auto-config-atm-address 31.将每个LEC配置到一个不同的ATM子接口上.命令如下: ATM(config)# interface atm number.subint multipoint ATM(config)# lane client ethernet vlan-num elan-num 32.用show lane server 显示LES的状态.33.用show lane bus显示bus的状态.34.用show lane database显示LECS数据库可内容.35.用show lane client显示LEC的状态.36.用show module显示已安装的模块列表.37.用物理接口建立与VLAN的连接: router# configure terminal router(config)# interface media module/port router(config-if)# description description-string router(config-if)# ip address ip-addr subnet-mask router(config-if)# no shutdown 38.用中继链路来建立与VLAN的连接: router(config)# interface module/port.subinterface router(config-ig)# encapsulation[isl|dotlq] vlan-number router(config-if)# ip address ip-address subnet-mask 39.用LANE 来建立与VLAN的连接: router(config)# interface atm module/port router(config-if)# no ip address router(config-if)# atm pvc 1 0 5 qsaal router(config-if)# atm pvc 2 0 16 ilni router(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-mask router(config-if)# lane client ethernet elan-num router(config-if)# interface atm module/port.subinterface multipoint router(config-if)# ip address ip-address subnet-name router(config-if)# lane client ethernet elan-name router(config-if)# …

40.为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行: router(config)# ip routing router(config)# router ip-routing-protocol router(config-router)# network ip-network-number router(config-router)# network ip-network-number 41.配置默认路由: switch(enable)set ip route default gateway 42.为一个路由处理器分配VLANID,可在接口模式下使用下列命令: router(config)# interface interface number router(config-if)# mls rp vlan-id vlan-id-num 43.在路由处理器启用MLSP: router(config)# mls rp ip 44.为了把一个外置的路由处理器接口和交换机安置在同一个VTP域中: router(config)# interface interface number router(config-if)# mls rp vtp-domain domain-name 45.查看指定的VTP域的信息: router# show mls rp vtp-domain vtp domain name 46.要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令: router(config-if)#mls rp management-interface 47.要检验MLS-RP的配置情况: router# show mls rp 48.检验特定接口上的MLS配置:

router# show mls rp interface interface number 49.为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表: set mls flow [destination|destination-source|full] 50.为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令: router(config)# mls rp ip input-acl [page] 51.当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令: switch(enable)set mls enable 52.若想改变老化时间的值,可在特权模式下输入以下命令: switch(enable)set mls agingtime agingtime 53.设置快速老化:

switch(enable)set mls agingtime fast fastagingtime pkt_threshold 54.确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定: switch(enable)show mls include 55.显示MLS高速缓存记录: switch(enable)show mls entry 56.用命令show in arp显示ARP高速缓存区的内容。

57.要把路由器配置为HSRP备份组的成员,可以在接口配置模式下使用下面的命令: router(config-if)# standby group-number ip ip-address 58.为了使一个路由器重新恢复转发路由器的角色,在接口配置模式下: router(config-if)# standy group-number preempt 59.访问时间和保持时间参数是可配置的:

router(config-if)# standy group-number timers hellotime holdtime 60.配置HSRP跟踪:

router(config-if)# standy group-number track type-number interface-priority 61.要显示HSRP路由器的状态:

router# show standby type-number group brief 62.用命令show ip igmp确定当选的查询器。63.启动IP组播路由选择:

router(config)# ip muticast-routing 64.启动接口上的PIM:

dalllasr1>(config-if)# ip pim {dense-mode|sparse-mode|sparse-dense-mode} 65.启动稀疏-稠密模式下的PIM: router# ip multicast-routing router# interface type number router# ip pim sparse-dense-mode 66.核实PIM的配置:

dallasr1># show ip pim interface[type number] [count] 67.显示PIM邻居:

dallasr1># show ip neighbor type number 68.为了配置RP的地址,命令如下:

dallasr1># ip pim rp-address ip-address [group-access-list-number][override] 69.选择一个默认的RP: dallasr1># ip pim rp-address 通告RP和它所服务的组范围:

dallasr1># ip pim send-rp-announce type number scope ttl group-list access-list-number 为管理范围组通告RP的地址:

dallasr1># ip pim send-rp-announce ethernet0 scope 16 group-list1 dallasr1># access-list 1 permit 266.0.0.0 0.255.255.255 设定一个RP映像代理:

dallasr1># ip pim send-rp-discovery scope ttl 核实组到RP的映像:

dallasr1># show ip pim rp mapping dallasr1># show ip pim rp [group-name|group-address] [mapping] 70.在路由器接口上用命令ip multicast ttl-threshold ttl-value设定TTL阀值: dallasr1>(config-if)# ip multicast ttl-threshold ttl-value 71.用show ip pim neighbor显示PIM邻居表。72.显示组播通信路由表中的各条记录:

dallasr1>show ip mroute [group-name|group-address][scoure][summary][count][active kbps] 73.要记录一个路由器接受和发送的全部IP组播包:

dallasr1> #debug ip mpacket [detail] [access-list][group] 74.要在CISCO路由器上配置CGMP: dallasr1>(config-if)# ip cgmp 75.配置一个组播路由器,使之加入某一个特定的组播组: dallasr1>(config-if)# ip igmp join-group group-address 76.关闭 CGMP:

dallasr1>(config-if)# no ip cgmp 77.启动交换机上的CGMP:

dallasr1>(enable)set cgmp enable 78.核实Catalyst交换机上CGMP的配置情况: catalystla1>(enable)show config set prompt catalystla1> set interface sc0 192.168.1.1 255.255.255.0 set cgmp enable 79.CGMP离开的设置:

Dallas_SW(enable)set cgmp leave 80.在Cisco设备上修改控制端口密码: R1(config)# line console 0 R1(config-line)# login R1(config-line)# password Lisbon R1(config)# enable password Lilbao R1(config)# login local R1(config)# username student password cisco 81.在Cisco设备上设置控制台及vty端口的会话超时: R1(config)# line console 0 R1(config-line)# exec-timeout 5 10 R1(config)# line vty 0 4 R1(config-line)# exec-timeout 5 2 82.在Cisco设备上设定特权级:

R1(config)# privilege configure level 3 username R1(config)# privilege configure level 3 copy run start R1(config)# privilege configure level 3 ping R1(config)# privilege configure level 3 show run R1(config)# enable secret level 3 cisco 83.使用命令privilege 可定义在该特权级下使用的命令: router(config)# privilege mode level level command 84.设定用户特权级:

router(config)# enable secret level 3 dallas router(config)# enable secret san-fran router(config)# username student password cisco 85.标志设置与显示:

R1(config)# banner motd ‘unauthorized access will be prosecuted!’ 86.设置vty访问:

R1(config)# access-list 1 permit 192.168.2.5 R1(config)# line vty 0 4 R1(config)# access-class 1 in 87.配置HTTP访问:

Router3(config)# access-list 1 permit 192.168.10.7 Router3(config)# ip http sever Router3(config)# ip http access-class 1 Router3(config)# ip http authentication local Router3(config)# username student password cisco 88.要启用HTTP访问,请键入以下命令: switch(config)# ip http sever 89.在基于set命令的交换机上用setCL1启动和核实端口安全:

switch(enable)set port security mod_num/port_num…enable mac address switch(enable)show port mod_num/port_num 在基于CiscoIOS命令的交换机上启动和核实端口安全:

switch(config-if)# port secure [mac-mac-count maximum-MAC-count] switch# show mac-address-table security [type module/port] 90.用命令access-list在标准通信量过滤表中创建一条记录:

Router(config)# access-list access-list-number {permit|deny} source-address [source-address] 91.用命令access-list在扩展通信量过滤表中创建一条记录: Router(config)# access-list access-list-number {permit|deny{protocol|protocol-keyword}}{source source-wildcard|any}{destination destination-wildcard|any}[protocol-specific options][log] 92.对于带内路由更新,配置路由更新的最基本的命令格式是:

R1(config-router)#distribute-list access-list-number|name in [type number] 93.对于带外路由更新,配置路由更新的最基本的命令格式是:

R1(config-router)#distribute-list access-list-number|name out [interface-name] routing-process| autonomous-system-number 94.set snmp命令选项:

set snmp community {read-only|ready-write|read-write-all}[community_string] 95.set snmp trap 命令格式如下: set snmp trap {enable|disable} [all|moudle|classis|bridge|repeater| auth|vtp|ippermit|vmps|config|entity|stpx] set snmp trap rvcr_addr rcvr_community 96.启用SNMP chassis 陷阱: Console>(enable)set snmp trap enable chassis 97.启用所有SNMP chassis 陷阱: Console>(enable)set snmp trap enable 98.禁用SNMP chassis 陷阱: Console>(enable)set snmp trap disable chassis 99.给SNMP陷阱接收表加一条记录:

Console>(enable)set snmp trap 192.122.173.42 public 100.show snmp 输出结果。

上一篇:大学元旦联欢会流程下一篇:美国电影《绿皮书》的个人观后感作文