中国网管论坛's Archiver

极品肥猫 发表于 2008-1-4 15:07

华为路由器命令

[color=#000000]
[size=36pt][/size][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]计算机命令:[/color][/font]
[color=#000000][font=Times New Roman]PCA login: root
[/font][font=宋体];使用[/font][font=Times New Roman]root[/font][font=宋体]用户[/font][/color]
[color=#000000][font=Times New Roman]
password: linux
[/font][font=宋体];口令是[/font][font=Times New Roman]linux[/font][/color]
[color=#000000][font=Times New Roman]# shutdown -h now
[/font][font=宋体];关机[/font][/color]
[color=#000000][font=Times New Roman]# init 0

[/font][font=宋体];关机[/font][/color]
[font=Times New Roman][color=#000000]# logout[/color][/font]
[font=Times New Roman][color=#000000]# login[/color][/font]
[color=#000000][font=Times New Roman]# ifconfig
[/font][font=宋体];显示[/font][font=Times New Roman]IP[/font][font=宋体]地址[/font][/color]
[color=#000000][font=Times New Roman]# ifconfig eth0 <ip address> netmask <netmask>
[/font][font=宋体];设置[/font][font=Times New Roman]IP[/font][font=宋体]地址[/font][/color]
[color=#000000][font=Times New Roman]# ifconfig eht0 <ip address> netmask <netmask> down ; [/font][font=宋体]删除[/font][font=Times New Roman]IP[/font][font=宋体]地址[/font][/color]
[font=Times New Roman][color=#000000]# route add 0.0.0.0 gw <ip>[/color][/font]
[font=Times New Roman][color=#000000]# route del 0.0.0.0 gw <ip>[/color][/font]
[color=#000000][font=Times New Roman]# route add default gw <ip>
[/font][font=宋体];设置网关[/font][/color]
[color=#000000][font=Times New Roman]# route del default gw <ip>
[/font][font=宋体];删除网关[/font][/color]
[color=#000000][font=Times New Roman]# route
[/font][font=宋体];显示网关[/font][/color]
[font=Times New Roman][color=#000000]# ping <ip>[/color][/font]
[color=#000000][font=Times New Roman]# telnet <ip>
[/font][font=宋体];建立[/font][font=Times New Roman]telnet[/font][font=宋体]之前先[/font][font=Times New Roman]ping[/font][font=宋体]一下[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=Times New Roman][color=#000000]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[/color][/font]
[font=宋体][color=#000000]交换机基本状态:[/color][/font]
[color=#000000][font=Times New Roman]switch:
[/font][font=宋体];[/font][font=Times New Roman]ROM[/font][font=宋体]状态[/font][font=Times New Roman], [/font][font=宋体]路由器是[/font][/color]
[font=Times New Roman][color=#000000]rommon>[/color][/font]
[color=#000000][font=Times New Roman]hostname>
[/font][font=宋体];用户模式[/font][/color]
[color=#000000][font=Times New Roman]hostname#
[/font][font=宋体];特权模式[/font][/color]
[color=#000000][font=Times New Roman]hostname(config)#
[/font][font=宋体];全局配置模式[/font][/color]
[color=#000000][font=Times New Roman]hostname(config-if)#
; [/font][font=宋体]接口状态[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]交换机口令设置:[/color][/font]
[color=#000000][font=Times New Roman]switch>enable
[/font][font=宋体];进入特权模式[/font][/color]
[color=#000000][font=Times New Roman]switch#config terminal
[/font][font=宋体];进入全局配置模式[/font][/color]
[color=#000000][font=Times New Roman]switch(config)#hostname <hostname>
[/font][font=宋体];设置交换机的主机名[/font][/color]
[color=#000000][font=Times New Roman]switch(config)#enable secret xxx
[/font][font=宋体];设置特权加密口令为[/font][font=Times New Roman] xxx[/font][/color]
[color=#000000][font=Times New Roman]switch(config)#enable password xxx
[/font][font=宋体];设置特权非密口令为[/font][font=Times New Roman] xxx[/font][/color]
[color=#000000][font=Times New Roman]switch(config)#line console 0
[/font][font=宋体];进控制台口[/font][font=Times New Roman](Rs232)[/font][font=宋体]初始化[/font][/color]
[color=#000000][font=Times New Roman]switch(config-line)#line vty 0 4
[/font][font=宋体];进入虚拟终端[/font][font=Times New Roman]virtual tty [/font][/color]
[color=#000000][font=Times New Roman]switch(config-line)#login
[/font][font=宋体];允许登录[/font][/color]
[color=#000000][font=Times New Roman]switch(config-line)#password xx
[/font][font=宋体];设置登录口令[/font][font=Times New Roman]xx[/font][/color]
[color=#000000][font=Times New Roman]switch#exit
[/font][font=宋体];返回命令[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[color=#000000][font=宋体]交换机[/font][font=Times New Roman]VLAN[/font][font=宋体]设置:[/font][/color]
[color=#000000][font=Times New Roman]switch#vlan database
[/font][font=宋体];进入[/font][font=Times New Roman]VLAN[/font][font=宋体]设置[/font][/color]
[color=#000000][font=Times New Roman]switch(vlan)#vlan 2
[/font][font=宋体];建[/font][font=Times New Roman]VLAN 2 [/font][/color]
[color=#000000][font=Times New Roman]switch(vlan)#no vlan 2
[/font][font=宋体];删[/font][font=Times New Roman]vlan 2[/font][/color]
[color=#000000][font=Times New Roman]switch(config)#int f0/1
[/font][font=宋体];进入端口[/font][font=Times New Roman]1[/font][/color]
[color=#000000][font=Times New Roman]switch(config-if)#switchport access vlan 2
[/font][font=宋体];当前端口[/font][font=Times New Roman]1[/font][font=宋体]加入[/font][font=Times New Roman]VLAN 2[/font][/color]
[color=#000000][font=Times New Roman]switch(config-if)#switchport mode trunk
[/font][font=宋体];设置为干线[/font][/color]
[color=#000000][font=Times New Roman]switch(config-if)#switchport trunk allowed vlan 1,2 [/font][font=宋体];设置允许的[/font][font=Times New Roman]vlan[/font][/color]
[color=#000000][font=Times New Roman]switch(config-if)#switchport trunk encap dot1q
[/font][font=宋体];设置[/font][font=Times New Roman]vlan [/font][font=宋体]中继[/font][/color]
[color=#000000][font=Times New Roman]switch(config)#vtp domain <name>
; [/font][font=宋体]设置发[/font][font=Times New Roman]vtp[/font][font=宋体]域名[/font][/color]
[font=Times New Roman][color=#000000]switch(config)#vtp password <word>[/color][/font]
[font=Times New Roman][color=#000000]switch(config)#vtp mode server[/color][/font]
[font=Times New Roman][color=#000000]switch(config)#vtp mode client[/color][/font]
[font=Times New Roman][color=#000000] [/color][/font]
[color=#000000][font=宋体]交换机设置[/font][font=Times New Roman]IP[/font][font=宋体]地址:[/font][/color]
[color=#000000][font=Times New Roman]switch(config)#interface vlan 1
[/font][font=宋体];进入[/font][font=Times New Roman]vlan 1[/font][/color]
[color=#000000][font=Times New Roman]switch(config-if)#ip address <IP> <mask>
[/font][font=宋体];添加远程登录[/font][font=Times New Roman]IP [/font][/color]
[color=#000000][font=Times New Roman]switch(config)#ip default-gateway <IP>
[/font][font=宋体];添加默认网关[/font][font=Times New Roman] [/font][/color]
[color=#000000][font=Times New Roman]switch#dir flash:
[/font][font=宋体];查看内存[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]交换机显示命令:[/color][/font]
[color=#000000][font=Times New Roman]switch#write
[/font][font=宋体];写入保存[/font][font=Times New Roman] [/font][/color]
[font=Times New Roman][color=#000000]switch#show vtp[/color][/font]
[color=#000000][font=Times New Roman]switch#show run

[/font][font=宋体];查看当前配置信息[/font][/color]
[color=#000000][font=Times New Roman]switch#show vlan
[/font][font=宋体];看[/font][font=Times New Roman]VLAN[/font][/color]
[color=#000000][font=Times New Roman]switch#show interface
[/font][font=宋体];显示所有端口信息[/font][font=Times New Roman] [/font][/color]
[color=#000000][font=Times New Roman]switch#show int f0/0
[/font][font=宋体];显示端口[/font][font=Times New Roman]0[/font][font=宋体]的信息[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=Times New Roman][color=#000000]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[/color][/font]
[font=宋体][color=#000000]路由器显示命令:[/color][/font]
[color=#000000][font=Times New Roman]router#show run
[/font][font=宋体];显示接口[/font][/color]
[color=#000000][font=Times New Roman]router#show interface
[/font][font=宋体];显示接口[/font][/color]
[color=#000000][font=Times New Roman]router#show ip route
[/font][font=宋体];显示路由[/font][/color]
[color=#000000][font=Times New Roman]router#show cdp nei
[/font][font=宋体];看邻居[/font][/color]
[color=#000000][font=Times New Roman]router#reload
[/font][font=宋体] [/font][font=Times New Roman]  [/font][font=宋体] [/font][font=Times New Roman]                   [/font][font=宋体];重新起动[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]设置口令:[/color][/font]
[color=#000000][font=Times New Roman]router>enable
[/font][font=宋体];进入特权模式[/font][/color]
[color=#000000][font=Times New Roman]router#config terminal
[/font][font=宋体];进入全局配置模式[/font][/color]
[color=#000000][font=Times New Roman]router(config)#hostname <hostname>
[/font][font=宋体];设置交换机的主机名[/font][/color]
[color=#000000][font=Times New Roman]router(config)#enable secret xxx
[/font][font=宋体];设置特权加密口令为[/font][font=Times New Roman] xxx[/font][/color]
[color=#000000][font=Times New Roman]router(config)#enable password xxx
[/font][font=宋体];设置特权非密口令为[/font][font=Times New Roman] xxx[/font][/color]
[color=#000000][font=Times New Roman]router(config)#line console 0
[/font][font=宋体];进控制台口[/font][font=Times New Roman](Rs232)[/font][font=宋体]初始化[/font][/color]
[color=#000000][font=Times New Roman]router(config-line)#line vty 0 4
[/font][font=宋体];进入虚拟终端[/font][font=Times New Roman]virtual tty [/font][/color]
[color=#000000][font=Times New Roman]router(config-line)#login
[/font][font=宋体];允许登录[/font][/color]
[color=#000000][font=Times New Roman]router(config-line)#password xx
[/font][font=宋体];设置登录口令[/font][font=Times New Roman]xx[/font][/color]
[color=#000000][font=Times New Roman]router(config)# (Ctrl+z)
; [/font][font=宋体]返回特权模式[/font][/color]
[color=#000000][font=Times New Roman]router#exit
[/font][font=宋体];返回命令[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[color=#000000][font=宋体]配置[/font][font=Times New Roman]IP[/font][font=宋体]地址:[/font][/color]
[color=#000000][font=Times New Roman]router(config)#int s0/0
[/font][font=宋体];进行串[/font][font=Times New Roman]Serail[/font][font=宋体]接口[/font][/color]
[color=#000000][font=Times New Roman]router(config-if)#no shutdown
[/font][font=宋体];起动接口[/font][/color]
[color=#000000][font=Times New Roman]router(config-if)#clock rate 64000
[/font][font=宋体];设置时钟[/font][/color]
[color=#000000][font=Times New Roman]router(config-if)#ip address 10.1.1.1 255.255.0.0
[/font][font=宋体];设置[/font][font=Times New Roman]IP[/font][font=宋体]地址和子网掩码[/font][/color]
[color=#000000][font=Times New Roman]router(config-if)#ip add 10.1.1.2 255.255.0.0 second[/font][font=宋体];[/font][/color]
[color=#000000][font=Times New Roman]router(config-if)#int f0/0.1
; [/font][font=宋体]进入子接口[/font][/color]
[color=#000000][font=Times New Roman]router(config-subif.1)#ip address <ip><netmask>
[/font][font=宋体];[/font][/color]
[color=#000000][font=Times New Roman]router(config-subif.1)#encapsulation dot1q <n>
[/font][font=宋体];[/font][/color]
[color=#000000][font=Times New Roman]router(config)#config-register 0x2142
[/font][font=宋体];跳过配置文件[/font][/color]
[color=#000000][font=Times New Roman]router(config)#config-register 0x2102
[/font][font=宋体];正常使用配置文件[/font][/color]
[color=#000000][font=Times New Roman]router#reload
[/font][font=宋体];重新引导[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]复制操作:[/color][/font]
[color=#000000][font=Times New Roman]router#copy running-config startup-config

[/font][font=宋体];存配置[/font][/color]
[color=#000000][font=Times New Roman]router#copy running-config tftp
[/font][font=宋体];上载[/font][/color]
[font=Times New Roman][color=#000000]router#copy startup-config tftp [/color][/font]
[color=#000000][font=Times New Roman]router#copy tftp flash:
[/font][font=宋体];特权模式下升级[/font][font=Times New Roman]IOS[/font][/color]
[color=#000000][font=Times New Roman]router#copy tftp startup-config[/font][font=宋体] [/font][font=Times New Roman]   [/font][font=宋体]       [/font][font=Times New Roman]  [/font][font=宋体];下载配置文件到[/font][font=Times New Roman]nvram[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[color=#000000][font=Times New Roman]ROM[/font][font=宋体]状态:[/font][/color]
[color=#000000][font=Times New Roman]Ctrl+Break

[/font][font=宋体];进入[/font][font=Times New Roman]ROM[/font][font=宋体]监控状态[/font][font=Times New Roman] [/font][/color]
[color=#000000][font=Times New Roman]rommon>confreg 0x2142
[/font][font=宋体];跳过配置,[/font][font=Times New Roman]26 36 45xx[/font][/color]
[color=#000000][font=Times New Roman]rommon>confreg 0x2102
[/font][font=宋体];使用配置,恢复工作状态[/font][/color]
[color=#000000][font=Times New Roman]rommon>reset[/font][font=宋体]     [/font][font=Times New Roman]                              [/font][font=宋体];重新引导,等效于重开机[/font][/color]
[color=#000000][font=Times New Roman]rommon>copy xmodem:<sname> flash:<dname>
[/font][font=宋体];从[/font][font=Times New Roman]console[/font][font=宋体]升级[/font][font=Times New Roman]IOS[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[color=#000000][font=Times New Roman]rommon>IP_ADDRESS=10.65.1.2
[/font][font=宋体];设置路由器[/font][font=Times New Roman]IP[/font][/color]
[color=#000000][font=Times New Roman]rommon>IP_SUBNET_MASK=255.255.0.0
[/font][font=宋体];设置路由器掩码[/font][/color]
[color=#000000][font=Times New Roman]rommon>TFTP_SERVER=10.65.1.1
[/font][font=宋体];指定[/font][font=Times New Roman]TFTP[/font][font=宋体]服务器[/font][font=Times New Roman]IP[/font][/color]
[color=#000000][font=Times New Roman]rommon>TFTP_FILE=c2600.bin
[/font][font=宋体];所要下载的文件[/font][/color]
[color=#000000][font=Times New Roman]rommon>tftpdnld
[/font][font=宋体];[/font][font=Times New Roman]ROM[/font][font=宋体]监控状态下升级[/font][font=Times New Roman]IOS[/font][/color]
[color=#000000][font=Times New Roman]rommon>dir flash:
[/font][font=宋体];查看闪存中的内容[/font][/color]
[color=#000000][font=Times New Roman]rommon>boot
[/font][font=宋体];引导[/font][font=Times New Roman]IOS[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]静态路由:[/color][/font]
[color=#000000][font=Times New Roman]ip route <ip-address> <subnet-mask> <gateway>
[/font][font=宋体]例:[/font][/color]
[font=Times New Roman][color=#000000]router(config)#ip route 10.1.0.0 255.255.0.0 10.2.1.1[/color][/font]
[color=#000000][font=Times New Roman]router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2
[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]动态路由:[/color][/font]
[color=#000000][font=Times New Roman]router(config)#ip routing
[/font][font=宋体];启动路由[/font][/color]
[color=#000000][font=Times New Roman]router(config)#router rip
[/font][font=宋体];启动[/font][font=Times New Roman]RIP[/font][font=宋体]路由协议。[/font][/color]
[color=#000000][font=Times New Roman]router(config-router)#network <netid>
[/font][font=宋体];配置范围[/font][font=Times New Roman],[/font][font=宋体]有的支持[/font][font=Times New Roman]all[/font][font=宋体]。[/font][/color]
[color=#000000][font=Times New Roman]router(config-router)#negihbor <ip-address>
[/font][font=宋体];点对点 帧中继用。[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]帧中继命令:[/color][/font]
[color=#000000][font=Times New Roman]router(config)# frame-relay switching
[/font][font=宋体];使能帧中继交换[/font][/color]
[color=#000000][font=Times New Roman]router(config-s0)# encapsulation frame-relay
[/font][font=宋体];使能帧中继[/font][/color]
[color=#000000][font=Times New Roman]router(config-s0)# frame-relay intf-type DCE
[/font][font=宋体];[/font][font=Times New Roman]DCE[/font][font=宋体]端[/font][font=Times New Roman]([/font][font=宋体]需要配虚电路[/font][font=Times New Roman])[/font][/color]
[color=#000000][font=Times New Roman]router(config-s0)# frame-relay local-dlci 20
[/font][font=宋体];配置虚电路号[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]基本访问控制列表:[/color][/font]
[font=Times New Roman][color=#000000]router(config)#access-list <number> permit|deny <source ip> <wild|any>[/color][/font]
[color=#000000][font=Times New Roman]router(config)#interface <interface>

[/font][font=宋体];[/font][font=Times New Roman]default: deny any[/font][/color]
[color=#000000][font=Times New Roman]router(config-if)#ip access-group <number> in|out
[/font][font=宋体];[/font][font=Times New Roman]default: out[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]例:[/color][/font]
[font=Times New Roman][color=#000000]RB(config)#access-list 4 permit 10.8.1.1[/color][/font]
[font=Times New Roman][color=#000000]RB(config)#access-list 4 deny 10.8.1.0 0.0.0.255[/color][/font]
[font=Times New Roman][color=#000000]RB(config)#access-list 4 permit 10.8.0.0 0.0.255.255[/color][/font]
[font=Times New Roman][color=#000000]RB(config)#access-list 4 deny 10.0.0.0 0.255.255.255[/color][/font]
[color=#000000][font=Times New Roman]RB(config)#access-list 4 permit any
[/font][/color]
[font=Times New Roman][color=#000000]RB(config)#int f0/0[/color][/font]
[color=#000000][font=Times New Roman]RB(config-if)#ip access-group 4 in[/font][/color]
[font=Times New Roman][color=#000000] [/color][/font]
[font=Times New Roman][color=#000000] [/color][/font]
[font=宋体][color=#000000]扩展访问控制列表:[/color][/font]
[font=Times New Roman][color=#000000]access-list <number> permit|deny icmp <SourceIP wild> <destinationIP [/color][/font]
[font=Times New Roman][color=#000000]wild>[type][/color][/font]
[font=Times New Roman][color=#000000]access-list <number> permit|deny tcp <SourceIP wild> <destinationIP [/color][/font]
[font=Times New Roman][color=#000000]wild>[port][/color][/font]
[color=#000000][font=宋体]例[/font][font=Times New Roman]1[/font][font=宋体]:[/font][/color]
[font=Times New Roman][color=#000000]router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo[/color][/font]
[color=#000000][font=Times New Roman]router(config)#access-list 101 permit ip any any
[/font][/color]
[font=Times New Roman][color=#000000]router(config)#int s0/0[/color][/font]
[color=#000000][font=Times New Roman]router(config-if)#ip access-group 101 in[/font][/color]
[color=#000000][font=宋体]例[/font][font=Times New Roman]2[/font][font=宋体]:[/font][/color]
[font=Times New Roman][color=#000000]router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80[/color][/font]
[font=Times New Roman][color=#000000]router(config)#access-list 102 permit ip any any [/color][/font]
[font=Times New Roman][color=#000000]router(config)#interface s0/1[/color][/font]
[font=Times New Roman][color=#000000]router(config-if)#ip access-group 102 out[/color][/font]
[font=Times New Roman][color=#000000] [/color][/font]
[font=Times New Roman][color=#000000]router(config)#no access-list 102 [/color][/font]
[color=#000000][font=Times New Roman]router(config-if)#no ip access-group 101 in[/font][/color]

yz1121 发表于 2008-1-15 10:20

谢谢,真全哟,收下了

yonaling 发表于 2008-1-15 22:05

正在学习这个,可帮了大忙了,谢谢了

bycts 发表于 2008-1-16 17:20

太谢谢了,我找了很久,在这发现,真是三生有幸呀!!!:lol :lol

http2000xp 发表于 2008-2-26 16:48

谢谢了!

正在寻找这些东西呢 !哈哈!谢谢!!

chanzi9302 发表于 2008-3-5 17:02

从来没有人如此!!

旧坊 发表于 2008-3-10 10:21

:PP: :PP:

旧坊 发表于 2008-3-10 12:05

:PP: :PP: :PP:

旧坊 发表于 2008-3-10 12:06

这是思科的命令吧

gnailnuhcuil 发表于 2008-3-13 10:10

楼主很厚道,谢谢!

sxyczr 发表于 2008-5-6 22:22

真是谢谢楼主了,辛苦了。

页: [1]

Powered by Discuz! Archiver 6.1.0  © 1999-2008 bbs.bitsCN.com