常用网络设备配置命令及配置实例
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
常用网络设备配置命令及配置实例
常用网络设备配置命令及配置实例
计算机命令:
PCA login: root ;使用root用户
password:
linux ;口令是linux
# shutdown -h now ;关机
# init 0
;关机
# logout
# login
#
ifconfig ;显示IP地址
# ifconfig eth0
# ifconfig eht0
# route add 0.0.0.0 gw
# route del 0.0.0.0 gw
# route add default gw
# route del default gw
#
route ;显示网关
# ping
# telnet
^^^^^^^^^^^^^^^^^^^^^^^^^^^^路由器^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
显示命令:
router#show
run ;显示接口
router#show
interface ;显示接口
router#show ip route ;显示路由
router#show cdp nei ;看邻居
router#reload
;重新起动
设置口令:
router>enable
;进入特权模式
router#config
terminal ;进入全局配置模式
router(config)#hostname
router(config)#enable secret
xxx ;设置特权加密口令为 xxx
router(config)#enable password xxx ;设置特权非密口令为xxx
router(config)#line console 0 ;进控制台口(Rs232)初始化
router(config-line)#line vty 0 4 ;进入虚拟终端virtual tty
router(config-line)#login
;允许登录
router(config-line)#password
xx ;设置登录口令xx router(config)#
(Ctrl+z) ; 返回特权模式
router#exit
;返回命令
配置IP地址:
router(config)#int
s0/0 ;进行串Serail接口
router(config-if)#no
shutdown ;起动接口router(config-if)#clock rate 64000 ;设置时钟
router(config-if)#ip address 10.1.1.1 255.255.0.0 ;设置IP地址和子网掩码router(config-if)#ip add 10.1.1.2 255.255.0.0 second;
router(config-if)#int
f0/0.1 ; 进入子接口
router(config-subif.1)#ip address
router(config-subif.1)#encapsulation
dot1q
router(config)#config-register
0x2142 ;跳过配置文件
router(config)#config-register
0x2102 ;正常使用配置文件
router#reload
;重新引导
复制操作:
router#copy running-config startup-config ;存配置
router#copy running-config tftp ;上载
router#copy startup-config tftp
router#copy tftp flash: ;特权模式下升级IOS
router#copy tftp startup-config ;下载配置文件到nvram
ROM状态:
Ctrl+Break
;进入ROM监控状态
rommon>confreg
0x2142 ;跳过配置,26 36 45xx
rommon>confreg
0x2102 ;使用配置,恢复工作状态
rommon>reset
;重新引导,等效于重开机rommon>copy xmodem:
rommon>IP_ADDRESS=10.65.1.2
;设置路由器IP
rommon>IP_SUBNET_MASK=255.255.0.0
;设置路由器掩码
rommon>TFTP_SERVER=10.65.1.1
;指定TFTP服务器IP
rommon>TFTP_FILE=c2600.bin
;所要下载的文件
rommon>tftpdnld
;ROM监控状态下升级IOS rommon>dir
flash: ;查看闪存中的内容