(设备管理)常用网络设备配置命令及配置实例

  • 格式:doc
  • 大小:175.57 KB
  • 文档页数:8

下载文档原格式

  / 8
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

常用网络设备配置命令及配置实例

计算机命令:

PCA login: root ;使用root用户password: linux ;口令是linux

# shutdown -h now ;关机

# init 0 ;关机

# logout

# login

# ifconfig ;显示IP地址

# ifconfig eth0 netmask ;设置IP地址

# ifconfig eht0 netmask down ; 删除IP地址

# 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 ;建立telnet之前先ping一下

^^^^^^^^^^^^^^^^^^^^^^^^^^^^路由器^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

显示命令:

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: flash: ;从console升级IOS

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 ;配置范围,有的支持all。

router(config-router)#negihbor ;点对点帧中继用。