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、交换机清除配置 :<H3C>reset save ;<H3C>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交换机的一些简单配置
2009-11-25 18:49
这里使用的H3C交换机是H126A,仅仅只做了最基本的配置以满足使用。
配置中可以通过display current-configura命令来显示当前使用的配置内容。
# 配置VLAN 1
<Sysname>system-view
System View: return to User View with Ctrl+Z.
vlan 1
quit
management-vlan 1
interface Vlan-interface 1
ip address 10.0.1.201 255.255.255.0
# 显示VLAN 接口1 的相关信息。
<Sysname> display ip interface Vlan-interface 1
# 创建VLAN(H3C不支持cisco的VTP,所以只能添加静态VLAN)
<H3C_TEST>system-view
System View: return to User View with Ctrl+Z.
vlan 99
name seicoffice
quit
# 把交换机的端端口划分到相应的Vlan中
interface ethernet1/0/2 //进入端口模式
port link-type access //设置端口的类型为access
port access vlan 99 //把当前端口划到vlan 99
vlan 99
port ethernet1/0/1 to ethernet1/0/24 //把以及网端口1/0/1到1/0/24划到vlan99
quit
port trunk permit vlan 1 99 // {ID|All} 设置trunk端口允许通过的VLAN
-------------------------------------------------------------------------------------------------------
# 配置本地用户
<Sysname>system-view
System View: return to User View with Ctrl+Z.
local-user h3c
New local user added.
service-type telnet level 3
password simple h3c
# 配置欢迎信息
header login %Welcome to login h3c!%
# 配置用户认证方式telnet(vty 0-4)
user-interface vty 0 4
authentication-mode scheme
protocol inbound telnet
super authentication-mode super-password
quit
super password level 3 simple h3c //用户登陆后提升权限的密码
# 配置Radius策略
radius scheme radius1
New Radius scheme
primary authentication 10.0.1.253 1645
primary accounting 10.0.1.253 1646
secondary authentication 127.0.0.1 1645
secondary accounting 127.0.0.1 1646
timer 5
key authentication h3c
key accounting h3c
server-type extended
user-name-format without-domain
# 配置域
domain h3c
authentication radius-scheme radius1 local
scheme radius-scheme radius1 local
domain default enable h3c
# 配置在远程认证失败时,本地认证的key
local-server nas-ip 127.0.0.1 key h3c
H3C交换机路由器telnet和console口登录配置
2009年11月09日 星期一 10:00
级别说明
Level 名称
命令
0
参观
ping、tracert、telnet
1
监控
display、debugging
2
配置
所有配置命令(管理级的命令除外)
3
管理
文件系统命令、FTP命令、TFTP命令、XMODEM命令
telnet仅用密码登录,管理员权限
user-interface vty 0 4user privilege level 3set authentication password simple abc
telnet仅用密码登录,非管理员权限
super password level 3 simple super
user-interface vty 0 4user privilege level 1set authentication password simple abc
telnet使用路由器上配置的用户名密码登录,管理员权限
local-user admin password simple adminlocal-user admin service-type telnetlocal-user admin level 3
user-interface vty 0 4authentication-mode local
telnet使用路由器上配置的用户名密码登录,非管理员权限
super password level 3 simple super
local-user manage password simple managelocal-user manage service-type telnetlocal-user manage level 2
user-interface vty 0 4authentication-mode local
对console口设置密码,登录后使用管理员权限
user-interface con 0user privilege level 3set authentication password simple abc
对console口设置密码,登录后使用非管理员权限
super password level 3 simple super
user-interface con 0user privilege level 1set authentication password simple abc
对console口设置用户名和密码,登录后使用管理员权限
local-user admin password simple adminlocal-user admin service-type terminallocal-user admin level 3
user-interface con 0authentication-mode local
对console口设置用户名和密码,登录后使用非管理员权限
super password level 3 simple super
local-user manage password simple managelocal-user manage service-type terminallocal-user manage level 2
user-interface con 0authentication-mode local
simple 是明文显示,cipher 是加密显示
路由器不设置telnet登录配置时,用户无法通过telnet登录到路由器上
acl 2000 inbound可以通过acl的规则只允许符合条件的用户远程登录路由器
路由器命令
~~~~~~~~~~
display version 显示版本信息
display current-configuration 显示当前配置
display interfaces 显示接口信息
display ip route 显示路由信息
sysname aabbcc 更改主机名
super passwrod 123456 设置口令
interface serial0 进入接口
ip address <ip><mask>
undo shutdown 激活端口
link-protocol hdlc 绑定hdlc协议
user-interface vty 0 4
authentication-mode password
set authentication-mode password simple 222
user privilege level 3
quit
debugging hdlc all serial0 显示所有信息
debugging hdlc event serial0 调试事件信息
debugging hdlc packet serial0 显示包的信息
静态路由:
ip route-static <ip><mask>{interface number|nexthop}
例如:
ip route-static 129.1.0.0 16 10.0.0.2
ip route-static 129.1.0.0 255.255.0.0 10.0.0.2
ip route-static 129.1.0.0 16 Serial 2
ip route-static 0.0.0.0 0.0.0.010.0.0.2
动态路由:
rip
rip work
rip input
rip output
network 1.0.0.0 ;可以all
network 2.0.0.0
peer ip-address
summary
rip version 1
rip version 2 multicast
rip split-horizon ;水平分隔
router id A.B.C.D 配置路由器的ID
ospf enable 启动OSPF协议
import-route direct 引入直联路由
ospf enable area <area_id> 配置OSPF区域
标准访问列表命令格式如下:
acl <acl-number> 默认前者顺序匹配。
rule {permit|deny}
例:
acl 10
rule normal permit source 10.0.0.0 0.0.0.255
rule normal deny source any
扩展访问控制列表配置命令
配置TCP/UDP协议的扩展访问列表:
rule {normal|special}{permit|deny}{tcp|udp}source {<ip wild>|any}destination <ip wild>|any}
配置ICMP协议的扩展访问列表:
rule {normal|special}{permit|deny}icmp source {<ip wild>|any]destination {<ip wild>|any]
扩展访问控制列表操作符的含义
equal portnumber 等于
greater-than portnumber 大于
less-than portnumber 小于
not-equal portnumber 不等
range portnumber1 portnumber2 区间
扩展访问控制列表举例
acl 101
rule deny souce any destination any
rule permit icmp source any destination any icmp-type echo
rule permit icmp source any destination any icmp-type echo-reply
acl 102
rule permit ip source 10.0.0.1 0.0.0.0 destination 202.0.0.1 0.0.0.0
rule deny ip source any destination any
acl 103
rule permit tcp source any destination 10.0.0.1 0.0.0.0 destination-port equal ftp
rule permit tcp source any destination 10.0.0.2 0.0.0.0 destination-port equal www
firewall enable
firewall default permit|deny
int e0
firewall packet-filter 101 inbound|outbound
地址转换配置举例
firewall enable
firewall default permit
acl 101
rule deny ip source any destination any
rule permit ip source 129.38.1.4 0 destination any
rule permit ip source 129.38.1.1 0 destination any
rule permit ip source 129.38.1.2 0 destination any
rule permit ip source 129.38.1.3 0 destination any
acl 102
rule permit tcp source 202.39.2.3 0 destination 202.38.160.1 0
rule permit tcp source any destination 202.38.160.1 0 destination-port great-than
1024
firewall packet-filter 101 inbound
firewall packet-filter 102 inbound
nat address-group 202.38.160.101 202.38.160.103 pool1
acl 1
rule permit source 10.110.10.0 0.0.0.255
rule deny source any
int serial 0
nat outbound 1 address-group pool1
nat server global 202.38.160.101 inside 10.110.10.1 ftp tcp
nat server global 202.38.160.102 inside 10.110.10.2 www tcp
nat server global 202.38.160.102 8080 inside 10.110.10.3 www tcp
nat server global 202.38.160.103 inside 10.110.10.4 smtp udp
PPP验证:
主验方:pap|chap
local-user u2 password {simple|cipher} aaa
interface serial 0
ppp authentication-mode {pap|chap}
ppp chap user u1 //pap时,不用此句
pap被验方:
interface serial 0
ppp pap local-user u2 password {simple|cipher} aaa
chap被验方:
interface serial 0
ppp chap user u1
local-user u2 password {simple|cipher} aaa
页:
[1]