(设备管理)常用网络设备配置命令及配置实例
- 格式:doc
- 大小:175.57 KB
- 文档页数:8
常用网络设备配置命令及配置实例
计算机命令:
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-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: ;查看闪存中的内容rommon>boot ;引导IOS
静态路由:
ip route
router(config)#ip route 10.1.0.0 255.255.0.0 10.2.1.1
router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2
动态路由:
router(config)#ip routing ;启动路由
router(config)#router rip ;启动RIP路由协议。
router(config-router)#network
router(config-router)#negihbor