思科路由交换的配置步骤,以及步骤中命令详解

kuaidi.ping-jia.net  作者:佚名   更新日期:2024-07-02
思科交换机详细配置方法和命令

思科交换机的基本配置命令学习
一、交换机口令设置:

switch>enable ;进入特权模式
switch#config terminal ;进入全局配置模式

switch(config)#hostname csico ;设置交换机的主机名
switch(config)#enable secret
csico1 ;设置特权加密口令
switch(config)#enable password csico8 ;设置特权非密口令

switch(config)#line console 0 ;进入控制台口
switch(config-line)#line vty 0 4
;进入虚拟终端
switch(config-line)#login ;虚拟终端允许登录
switch(config-line)#password
csico6 ;设置虚拟终端登录口令csico6
switch#exit ;返回命令

二、交换机显示命令:
switch#write ;保存配置信息

switch#show vtp ;查看vtp配置信息
switch#show run ;查看当前配置信息
switch#show
vlan ;查看vlan配置信息
switch#show interface ;查看端口信息
switch#show int f0/0
;查看指定端口信息
switch#show int f0/0 status;查看指定端口状态
switch#dir flash: ;查看闪存

Cisco路由器配置命令大全网络 2010-06-26 06:43:44 阅读657 评论0 字号:大中小 订阅 .

(1)模式转换命令
用户模式----特权模式,使用命令"enable"
特权模式----全局配置模式,使用命令"config
t"
全局配置模式----接口模式,使用命令"interface+接口类型+接口号"

全局配置模式----线控模式,使用命令"line+接口类型+接口号"
注:
用户模式:查看初始化的信息.

特权模式:查看所有信息、调试、保存配置信息
全局模式:配置所有信息、针对整个路由器或交换机的所有接口
接口模式:针对某一个接口的配置

线控模式:对路由器进行控制的接口配置
(2)配置命令
show running config 显示所有的配置
show
versin 显示版本号和寄存器值
shut down 关闭接口
no shutdown 打开接口
ip add +ip地址
配置IP地址
secondary+IP地址 为接口配置第二个IP地址
show interface+接口类型+接口号 查看接口管理性

show controllers interface 查看接口是否有DCE电缆
show history 查看历史记录
show
terminal 查看终端记录大小
hostname+主机名 配置路由器或交换机的标识
config memory
修改保存在NVRAM中的启动配置
exec timeout 0 0 设置控制台会话超时为0
service password-encryptin
手工加密所有密码
enable password +密码 配置明文密码
ena sec +密码 配置密文密码
line vty 0
4/15 进入telnet接口
password +密码 配置telnet密码
line aux 0 进入AUX接口
password
+密码 配置密码
line con 0 进入CON接口
password +密码 配置密码
bandwidth+数字 配置带宽

no ip address 删除已配置的IP地址
show startup config 查看NVRAM中的配置信息
copy
run-config atartup config 保存信息到NVRAM
write 保存信息到NVRAM
erase
startup-config 清除NVRAM中的配置信息
show ip interface brief 查看接口的谪要信息
banner
motd # +信息 + # 配置路由器或交换机的描素信息
description+信息 配置接口听描素信息
vlan database
进入VLAN数据库模式
vlan +vlan号+ 名称 创建VLAN
switchport access vlan +vlan号
为VLAN为配接口
interface vlan +vlan号 进入VLAN接口模式
ip add +ip地址 为VLAN配置管理IP地址

vtp+service/tracsparent/client 配置SW的VTP工作模式
vtp +domain+域名 配置SW的VTP域名

vtp +password +密码 配置SW的密码
switchport mode trunk 启用中继
no vlan +vlan号
删除VLAN
show spamming-tree vlan +vlan号 查看VLA怕生成树议

三. 路由器配置命令
ip
route+非直连网段+子网掩码+下一跳地址 配置静态/默认路由
show ip route 查看路由表
show protocols
显示出所有的被动路由协议和接口上哪些协议被设置
show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用

的定时器
等信息
router rip 激活RIP协议
network +直连网段 发布直连网段

interface lookback 0 激活逻辑接口
passive-interface +接口类型+接口号 配置接口为被动模式

debug ip +协议 动态查看路由更新信息
undebug all 关闭所有DEBUG信息
router eigrp +as号
激活EIGRP路由协议
network +网段+子网掩码 发布直连网段
show ip eigrp neighbors 查看邻居表

show ip eigrp topology 查看拓扑表
show ip eigrp traffic 查看发送包数量
router
ospf +process-ID 激活OSPF协议
network+直连网段+area+区域号 发布直连网段
show ip ospf
显示OSPF的进程号和ROUTER-ID
encapsulation+封装格式 更改封装格式
no ip admain-lookup
关闭路由器的域名查找
ip routing 在三层交换机上启用路由功能
show user 查看SW的在线用户
clear line
+线路号 清除线路

四. 三层交换机配置命令
配置一组二层端口
configure terminal 进入配置状态

nterface range {port-range} 进入组配置状态
配置三层端口
configure terminal 进入配置状态

interface {{fastethernet | gigabitethernet} interface-id} | {vlan vlan-id} |
{port-

channel port-channel-number} 进入端口配置状态
no switchport
把物理端口变成三层口
ip address ip_address subnet_mask 配置IP地址和掩码
no shutdown 激活端口

例:
Switch(config)# interface gigabitethernet0/2
Switch(config-if)#
no switchport
Switch(config-if)# ip address 192.20.135.21 255.255.255.0

Switch(config-if)# no shutdown
配置VLAN
configure terminal 进入配置状态

vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改

情况没说清楚吧??你是在做实验还是家里用思科的路由器?

若是做实验的话,我建议你好好学思科技术吧,从 CCNA中文学习指南第六版开始!动态路由多了,Rip、Eigrp、Ospf....

若是家里用或是网吧里用,最好不要改。家里的你改不了,网吧里的不能改!

思科Cisco交换机、路由器设置命令
Lzshihj_tz2f_3550
交换机口令设置:
switch>enable ;进入特权模式
switch#config terminal ;进入全局配置模式
switch(config)#hostname <hostname> ;设置交换机的主机名
switch(config)#enable secret xxx ;设置特权加密口令为 xxx
switch(config)#enable password xxx ;设置特权非密口令为 xxx
switch(config)#line console 0 ;进控制台口(Rs232)初始化
switch(config-line)#line vty 0 4 ;进入虚拟终端virtual tty
switch(config-line)#login ;允许登录
switch(config-line)#password xx ;设置登录口令xx
switch#exit ;返回命令

交换机VLAN设置:
switch#vlan database ;进入VLAN设置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;删vlan 2
switch(config)#int f0/1 ;进入端口1
switch(config-if)#switchport access vlan 2 ;当前端口1加入VLAN 2
switch(config-if)#switchport mode trunk ;设置为干线
switch(config-if)#switchport trunk allowed vlan 1,2;设置允许的vlan
switch(config-if)#switchport trunk encap dot1q ;设置vlan中继
switch(config)#vtp domain <name> ;设置发vtp域名
switch(config)#vtp password <word>
switch(config)#vtp mode server
switch(config)#vtp mode client
交换机设置IP地址:
switch(config)#interface vlan 1 ;进入vlan 1
switch(config-if)#ip address <IP> <mask> ;添加远程登录IP
switch(config)#ip default-gateway <IP> ;添加默认网关
switch#dir flash: ;查看内存
交换机显示命令:
switch#write ;写入保存
switch#show vtp
switch#show run ;查看当前配置信息
switch#show vlan ;看VLAN
switch#show interface ;显示所有端口信息
switch#show int f0/0 ;显示端口0的信息
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
路由器显示命令:
router#show run ;显示接口
router#show interface ;显示接口
router#show ip route ;显示路由
router#show cdp nei ;看邻居
router#reload     ;重新起动

设置口令:
router>enable ;进入特权模式
router#config terminal ;进入全局配置模式
router(config)#hostname <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 <ip><netmask> ;
router(config-subif.1)#encapsulation dot1q <n> ;
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:<sname> flash:<dname> ;从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 <ip-address> <subnet-mask> <gateway> 例:
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 <netid> ;配置范围,有的支持all。
router(config-router)#negihbor <ip-address> ;点对点 帧中继用。

帧中继命令:
router(config)# frame-relay switching ;使能帧中继交换
router(config-s0)# encapsulation frame-relay ;使能帧中继
router(config-s0)# frame-relay intf-type DCE ;DCE端(需要配虚电路)
router(config-s0)# frame-relay local-dlci 20 ;配置虚电路号

基本访问控制列表:
router(config)#access-list <number> permit|deny <source ip> <wild|any>
router(config)#interface <interface> ;default: deny any
router(config-if)#ip access-group <number> in|out ;default: out

例:
RB(config)#access-list 4 permit 10.8.1.1
RB(config)#access-list 4 deny 10.8.1.0 0.0.0.255
RB(config)#access-list 4 permit 10.8.0.0 0.0.255.255
RB(config)#access-list 4 deny 10.0.0.0 0.255.255.255
RB(config)#access-list 4 permit any
RB(config)#int f0/0
RB(config-if)#ip access-group 4 in

扩展访问控制列表:
access-list <number> permit|deny icmp <SourceIP wild> <destinationIP
wild>[type]
access-list <number> permit|deny tcp <SourceIP wild> <destinationIP
wild>[port]
例1:
router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo
router(config)#access-list 101 permit ip any any
router(config)#int s0/0
router(config-if)#ip access-group 101 in
例2:
router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
router(config)#access-list 102 permit ip any any
router(config)#interface s0/1
router(config-if)#ip access-group 102 out

router(config)#no access-list 102
router(config-if)#no ip access-group 101 in

在路由器上设置 SNMP Community Strings
router(config) # snmp-server community read-community-string ro

router(config) # snmp-server community write-community-string rw

在交换机上设置 SNMP Community Strings
switch(config) # snmp-server community read-community-string ro

switch(config) # snmp-server community write-community-string rw

在路由器上配置日志信息(Syslog Message Logging)

router(config) # logging on

router(config) # logging server-ip-address
router(config) # logging trap severity-level
路由器恢复出厂设置
erase start-config
或write erase
或erase NVROM

  • 思科路由交换的配置步骤,以及步骤中命令详解
    答:router#show ip route ;显示路由router#show cdp nei ;看邻居router#reload ;重新起动 设置口令:router>enable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname <hostname> ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令为 xxxrouter(config)#enable password...
  • 思科交换路由实例配置!望高手解答!
    答:第一步,交换机上配置VLAN 第二步,路由器R1上配置单臂路由 使VLAN2 PING通VLAN3(10.1.1.2 PING通10.2.2.2)第三步,R1、R2、R3配置OSPF路由协议 使R1 与R3相互PING通 VLAN2和VLAN3能够与MAIL服务器和WWW服务器相互PING通 第四步,配置扩展访问列表,允许VLAN2的成员可以访问R3下的 MAIL服...
  • 配置思科路由器3640,有三台路由器,每个路由器上接两台主机,最后使得各...
    答:no shutdown 配好多自己搞 二、然后跑一个路由协议简单点的就是rip enable configure termianl ip routre rip network xxx.xxx.xxx.xxx(该路由器的每一个接口ip)注意:路由器每个接口配置的ip最好用C类地址 rip协议不携带子网掩码,或者使用rip version 2 三、给每个pc配置ip 和网关,网关为与本...
  • 思科路由配置教程(思科路由配置)
    答:一、理解路由的本质与静态路由的作用 在网络架构中,路由器如同导航系统,决定数据报的传输路径。静态路由与动态路由各有其用武之地。在此,我们将重点讲解静态路由,特别是在哪些场景下选择它,以及它的配置步骤。二、静态路由的细致配置 静态路由的配置要求手动为每台路由器添加特定的路由信息。以Cisco...
  • 思科三层交换机路由功能配置教程
    答:类似的配置24口:Switch#enable Switch#configure terminal Switch(config)#interface fastEthernet 0/24 Switch(config)ip addr 60.1.1.1 255.255.255.0 Switch(config-if)#no switchport Switch(config-if)#no shutdown Switch(config-if)#end 打开交换机路由转发开关:Switch#configure terminal Swi...
  • 如何配置思科路由器?
    答:你好!美国思科路由器设置方法步骤如下:1、首先把电源接通,然后插上网线,进线插在wan口,然后跟电脑连接的网线就随便插一个lan口。2、连接好无线路由器后,在电脑浏览器地址栏输入在路由器IP地址:192.168.1.1。3、连接后会看到输入相应的登陆用户名:admin,密码:admin。4、进入操作界面,点击...
  • 思科交换机的基本配置
    答:实验步骤:一、 交换机的带外配置;1、 在使用者模式、特权模式、全域性模式、介面模式之间转换;Switch>enable Switch#configure terminal Enter configuration mands, one perline. End with CNTL/Z.Switchconfig#interface FastEthernet 0/1 Switchconfig-if#exit Switchconfig#exit Switch SYS-5-CONFIG_...
  • Cisco思科交换机配置请高手赐教。急!急!急!
    答:CISCO交换机基本配置:Console端口连接 用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;交换机口令设置:switch>enable ;进入特权模式 switch#config terminal ;进入全局配置模式 switch(config)#hostname csico ;设置交换机的主机名 switch(config)#enable secret ...
  • 思科交换机,路由器互联,所有网络互通。麻烦写清配置过程。
    答:特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址 配置IP...
  • 思科路由器配置命令保存思科路由器配置命令
    答:1、switch> 用户模式1:进入特权模式 enableswitch>enableswitch# 2:进入全局配置模式 configure terminalswitch>enableswitch#c onfigure terminalswitch(conf)# 3:交换机命名 hostname aptech2950 以aptech2950为例switch>enableswitch#c onfigure terminalswitch(conf)#hostnameaptch-2950aptech...