Cisco路由器交换机配置命令大全

Cisco路由器交换机配置命令大全
Cisco路由器交换机配置命令大全

Cisco路由器交换机配置命令大全

1. switch配置命令

(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怕生成树议

2. 路由器配置命令

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 +线路号清除线路

3. 三层交换机配置命令

配置一组二层端口

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号或旧的来进行修改

name vlan-name 可选)输入一个VLAN名,如果没有配置VLAN名,缺省的名字是VLAN号前面用0填满

的4位数,如VLAN0004是VLAN4的缺省名字

mtu mtu-size (可选) 改变MTU大小

Switch# configure terminal

Switch(config)# vlan 20

Switch(config-vlan)# name test20

Switch(config-vlan)# end

Switch# vlan database

Switch(vlan)# vlan 20 name test20

Switch(vlan)# exit

将端口分配给一个VLAN

configure terminal 进入配置状态

interface interface-id 进入要分配的端口

switchport mode access 定义二层口

switchport access vlan vlan-id 把端口分配给某一VLAN 例

Switch# configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)# interface fastethernet0/1

Switch(config-if)# switchport mode access

Switch(config-if)# switchport access vlan 2

Switch(config-if)# end

Switch#

配置VLAN trunk

configure terminal 进入配置状态

interface interface-Id 进入端口配置状态

switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封装ISL 或802.1Q 或

自动协商

switchport mode {dynamic {auto | desirable} | trunk} 配置二层trunk模式。

dynamic auto—自动协商是否成为trunk

dynamic desirable—把端口设置为trunk如果对方端口是trunk, desirable, 配置Native VLAN

(802.1q)

或自动模式,trunk—设置端口为强制的trunk方式,而不理会对方端口是否为trunk

switchport access vlan vlan-id 可选) 指定一个缺省VLAN, 如果此端口不再是trunk

switchport trunk native vlan vlan-id 指定802.1Q native VLAN号

例:

Switch# configure terminal

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)# interface fastethernet0/4

Switch(config-if)# switchport mode trunk

Switch(config-if)# switchport trunk encapsulation dot1q

Switch(config-if)# end

定义TRUNK允许的VLAN

configure terminal子进入配置状态

interface interface-id 进入端口配置

switchport mode trunk 配置二层口为trunk

switchport trunk allowed vlan {add | all | except | remove} vlan-list可选) 配置trunk允

许的VLAN.使用add, all, except, remove关健字

no switchport trunk allowed vlan 允许所有VLAN通过

Switch(config)# interface fastethernet0/1

Switch(config-if)# switchport trunk allowed vlan remove 2

Switch(config-if)# end

配置Native VLAN(802.1q)

configure terminal 进入配置状态

interface interface-id 进入配置成802.1qtrunk的端口

switchport trunk native vlan vlan-Id 配置native VLAN号

no switchport trunk native vlan 端口配置命令回到缺省的状态

配置基于端口权值的负载均衡

configure terminal 进入Switch 1配置状态

vtp domain domain-name 配置VTP域

vtp mode server 将Switch 1配置成VTP server.

show vtp status 验证VTP的配置

show vlan 验证VLAN

configure terminal 进入配置状态

interface fastethernet 0/1 进入F0/1端口

switchport trunk encapsulation {isl | dot1q | negotiate}配置trunk封装switchport mode trunk 配置成trunk

show interfaces fastethernet0/1 switchport 验证VLAN配置

按以上步骤对想要负载均衡的接口进行配置

在另一个交换机上进行此配置

show vlan 当trunk已经起来,在switch2上验证已经学到相的vlan配置configure terminal 在Switch 1上进入配置状态

interface fastethernet0/1 进入要配置的端口

spanning-tree vlan 8 port-priority 10 将端口权值10赋与VLAN 8. spanning-tree vlan 9 port-priority 10 将端口权值10赋与VLAN 9. spanning-tree vlan 10 port-priority 10 将端口权值10赋与VLAN 10. interface fastethernet0/2 进入F0/2

spanning-tree vlan 3 port-priority 10 将端口权值10赋与VLAN 3. spanning-tree vlan 4 port-priority 10 将端口权值10赋与VLAN 4 spanning-tree vlan 5 port-priority 10 将端口权值10赋与VLAN 5 spanning-tree vlan 6 port-priority 10 将端口权值10赋与VLAN 10

end 退出

show running-config 验证配置

copy running-config startup-config 保存配置

配置STP路径值的负载均衡

Trunk1走VLAN8-10,Trunk2走VLAN2-4

configure terminal 进入Switch 1配置状态

interface fastethernet 0/1 进入F0/1

switchport trunk encapsulation {isl | dot1q | negotiate}配置封装

switchport mode trunk 配置Trunk,缺省是ISL封装

exit 退回

在F0/2口上重复2-4步骤

exit 退回

show running-config 验证配置

show vlan验证switch1 已经学到Vlan

configure terminal 进入配置状态

interface fastethernet 0/1 进入F0/1

spanning-tree vlan 2 cost 30 设置Vlan2生成树路径值为30

spanning-tree vlan 3 cost 30 设置Vlan3生成树路径值为30

spanning-tree vlan 4 cost 30 设置Vlan4生成树路径值为30

end 退出

在switch1的F0/2上重复9-11步骤设置VLAN8,9,10生成树路径值为30 end 退出

show running-config 验证配置

copy running-config startup-config 保存配置

补充:CISCO命令集——路由选择协议及排障

*ip route命令

Router(config)# ip route <目录网络或子网号> [子网掩码] <下一路由器IP地址| 从本地出口

的地址> [管理距离0~255,默认为1]

(注:静态地址配置)

*ip default-network命令

Router(config)# ip default-network <目标网络号>

(注:配合路由协使用,用其中的一个动态路由号作默认路由配置)

Router(config)# ip route 0.0.0.0 0.0.0.0 <下一路由器IP地址| 从本地出口的地址>

(注:只有一个公网地址时,在出口路由器上的配置)

*内部路由选择协议

*使用router和network命令

Router(config)# router <路由协议rip | igrp | eigrp | ospf | is-is等> [自主系统号] Router(config-router)# network <直接相连的要用此路由协议的网络号>

Router(config-router)# network <直接相连的要用此路由协议的网络号> *路由信息协议RIP

Router(config)# router rip

Router(config-router)# network <直接相连的要用rip协议的有类别网络号> Router# show ip protocols

Router# show ip route

Router# debug ip rip

*内部网关路由协议IGRP

Router(config)# router igrp <自主系统号>

Router(config-router)# network <直接相连的要用igrp协议的有类别网络号>

Router# show ip interface

Router# show ip protocols

Router# show ip route

Router# debug ip rip

*排除网络故障

排除网络故障的一个总体模型

Router# ping <有故障的主机| 有故障的IP地址> Router# show ip route

Router# show interface <有故障的接口>

Router# show run

*IP的故故障排除

检查可用的路由

Router# show ip route <有故障的IP地址>

27.4.4 跟踪路由(Tracing the Route)

SUN-A> traceroute <有故障的主机| 有故障的IP地址> C:\windows\> winipcfg

C:\windows\> ipconfig

C:\windows\> ipconfig / all

C:\windows\> tracert <有故障的主机| 有故障的IP地址> 使用扩展的ping来跟踪连接性

Router# ping

*其它可能的故障

一个地址解析(ARP)的故障

Router# show arp

Router# show interface <有故障的接口>

C:\windows\> arp -a

SUN-A> arp –a

验证终端系统的路由表

C:\windows\> netstat –rn

C:\windows\> route –f add 0.0.0.0 mask 0.0.0.0 <需要添加入的网关地址>

C:\windows\> route [–f ] [[print | add | delete | change] [destination] [mask

netmask] [gateway]]

C:\windows\> route add mask <网络掩码> <网关ip地址>

C:\windows\> route delete mask <网络掩码> <网关ip地址>

C:\windows\> nbtstat <相应的参数>

SUN-A> netstat -rn路由器

CISCO交换机配置命令大全2009-08-13 21:131.在基于IOS的交换机上设置主机名/系统名:

switch(config)# hostname hostname

在基于CLI的交换机上设置主机名/系统名:

switch(enable) set system name name-string

2.在基于IOS的交换机上设置登录口令:

switch(config)# enable password level 1 password

在基于CLI的交换机上设置登录口令:

switch(enable) set password

switch(enable) set enalbepass

3.在基于IOS的交换机上设置远程访问:

switch(config)# interface vlan 1

switch(config-if)# ip address ip-address netmask

switch(config-if)# ip default-gateway ip-address

在基于CLI的交换机上设置远程访问:

switch(enable) set interface sc0 ip-address netmask broadcast-address

switch(enable) set interface sc0 vlan

switch(enable) set ip route default gateway

4.在基于IOS的交换机上启用和浏览CDP信息:

switch(config-if)# cdp enable

switch(config-if)# no cdp enable

为了查看Cisco邻接设备的CDP通告信息:

switch# show cdp interface [type modle/port]

switch# show cdp neighbors [type module/port] [detail]

在基于CLI的交换机上启用和浏览CDP信息:

switch(enable) set cdp {enable|disable} module/port

为了查看Cisco邻接设备的CDP通告信息:

switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 5.基于IOS的交换机的端口描述:

switch(config-if)# description description-string

基于CLI的交换机的端口描述:

switch(enable)set port name module/number description-string 6.在基于IOS的交换机上设置端口速度:

switch(config-if)# speed{10|100|auto}

在基于CLI的交换机上设置端口速度:

switch(enable) set port speed moudle/number {10|100|auto} switch(enable) set port speed moudle/number {4|16|auto}

7.在基于IOS的交换机上设置以太网的链路模式:

switch(config-if)# duplex {auto|full|half}

在基于CLI的交换机上设置以太网的链路模式:

switch(enable) set port duplex module/number {full|half}

8.在基于IOS的交换机上配置静态VLAN:

switch# vlan database

switch(vlan)# vlan vlan-num name vla

switch(vlan)# exit

switch# configure teriminal

switch(config)# interface interface module/number

switch(config-if)# switchport mode access

switch(config-if)# switchport access vlan vlan-num

switch(config-if)# end

在基于CLI的交换机上配置静态VLAN:

switch(enable) set vlan vlan-num [name name]

switch(enable) set vlan vlan-num mod-num/port-list

9. 在基于IOS的交换机上配置VLAN中继线:

switch(config)# interface interface mod/port

switch(config-if)# switchport mode trunk

switch(config-if)# switchport trunk encapsulation {isl|dotlq}

switch(config-if)# switchport trunk allowed vlan remove vlan-list switch(config-if)# switchport trunk allowed vlan add vlan-list

在基于CLI的交换机上配置VLAN中继线:

switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate] Vlan-range [isl|dotlq|dotl0|lane|negotiate]

10.在基于IOS的交换机上配置VTP管理域:

switch# vlan database

switch(vlan)# vtp domain domain-name

在基于CLI的交换机上配置VTP管理域:

switch(enable) set vtp [domain domain-name]

CISCO路由器基本配置命令

一、 1.router(config)#router rip 启动rip进程 2.router(conifg-router)#network 172.17.0.0指定rip协议的主网络 3.router(config-router)#passive-interface f0/1把f0/1配置成passive端口 4.router(config-router)#neighbor 172.17.12.67 以单波方式通告rip更新给路由器 5.router(config-if)#ip address 192.168.83.244 255.255.255.0 主ip地址 router(config-if)#ip address 10.33.55.1 255.255.255.0 secondary辅助ip地址二、 1.router(config-router)#version 2将rip配置成版本2 2.router(config-ip)#ip rip send version 1只发rip 1数据包 router(config-ip)#ip rip receive version 2只接收rip 2数据包 3.router(config-router)#no auto-summary 关闭汇总功能 4.router(config-if)#no ip split-horizon关闭水平分割 5.router#show ip ospf database router 192.168.30.10显示路由器LSA通告 router#show ip ospf database network 192.168.17.18显示网络LSA通告 router#show ip ospf database summary 172.16.121.0显示网络汇总LSA通告 router#show ip ospf database asbr-summary显示ASBR汇总LSA通告 router#show ip ospf database external 10.83.10.0显示自主系统外部LSA通告router#show ip ospf database nssa-external显示NSSA外部LSA通告 三、 1.router(config)#router ospf 10配置ospf进程id 2.router(config)#interface loopback0

交换机和路由器的基本配置

实验一交换机和路由器的基本配置 交换机的基本配置 【实验名称】 交换机的基本配置。 【实验目的】 掌握交换机命令行各种操作模式的区别,能够使用各种帮助信息,以及用命令进行基本的配置。 【背景描述】 你是某公司新进的网管,公司要求你熟悉网络产品,公司采用全系列锐捷网络产品,首先要求你登录交换机,了解、掌握交换机的命令行操作技巧,以及如何使用一些基本命令进行配置。 【需求分析】 需要在交换机上熟悉各种不同的配置模式以及如何在配置模式间切换,使用命令进行基本的配置,并熟悉命令行界面的操作技巧。 【实验拓扑】 图1-1 实验拓扑图 【实验设备】 三层交换机1台 【预备知识】 交换机的命令行界面和基本操作 【实验原理】 交换机的管理方式基本分为两种:带内管理和带外管理。通过交换机的Console口管理交换机属于带外管理,不占用交换机的网络接口,其特点是需要使用配置线缆,近距离配置。第一次配置交换机时必须利用Console端口进行配置。 交换机的命令行操作模式,主要包括:用户模式、特权模式、全局配置模式、端口模式等几种。 ???用户模式进入交换机后得到的第一个操作模式,该模式下可以简单查看交换机的软、硬件版本信息,并进行简单的测试。用户模式提示符为switch> ???特权模式由用户模式进入的下一级模式,该模式下可以对交换机的配置文件进行管理,查看交换机的配置信息,进行网络的测试和调试等。特权模式提示符为switch# ???全局配置模式属于特权模式的下一级模式,该模式下可以配置交换机的全局性参数(如主机名、登录信息等)。在该模式下可以进入下一级的配置模式,对交换机具体的功能进行配置。全局模式提示符为switch(config)# ???端口模式属于全局模式的下一级模式,该模式下可以对交换机的端口进行参数配置。端口模式提示符为switch(config-if)# 交换机的基本操作命令包括:

华为交换机路由器常用命令

华为交换机路由器常用命令

华为交换机路由器常用命令 网络技术/wangzhijun1743 发表于2007-03-24, 12:25 交换机命令 [Quidway]dis cur ;显示当前配置 [Quidway]display current-configuration ;显示当前配置[Quidway]display interfaces ;显示接口信息[Quidway]display vlan all ;显示路由信息 [Quidway]display version ;显示版本信息[Quidway]super password ;修改特权用户密码[Quidway]sysname ;交换机命名 [Quidway]interface ethernet 0/1 ;进入接口视图[Quidway]interface vlan x ;进入接口视图 [Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0 ;配置VLAN的I P地址 [Quidway]ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关[Quidway]rip ;三层交换支持 [Quidway]local-user ftp [Quidway]user-interface vty 0 4 ;进入虚拟终端 [S3026-ui-vty0-4]authentication-mode password ;设置口令模式 [S3026-ui-vty0-4]set authentication-mode password simple 222 ;设置口令[S3026-ui-vty0-4]user privilege level 3 ;用户级别 [Quidway]interface ethernet 0/1 ;进入端口模式[Quidway]int e0/1 ;进入端口模式 [Quidway-Ethernet0/1]duplex {half|full|auto} ;配置端口工作状态[Quidway-Ethernet0/1]speed {10|100|auto} ;配置端口工作速率[Quidway-Ethernet0/1]flow-control ;配置端口流控 [Quidway-Ethernet0/1]mdi {across|auto|normal} ;配置端口平接扭接[Quidway-Ethernet0/1]port link-type {trunk|access|hybrid} ;设置端口工作模式 [Quidway-Ethernet0/1]port access vlan 3 ;当前端口加入到VLA N [Quidway-Ethernet0/2]port trunk permit vlan {ID|All} ;设trunk允许的VLAN [Quidway-Ethernet0/3]port trunk pvid vlan 3 ;设置trunk端口的P VID [Quidway-Ethernet0/1]undo shutdown ;激活端口 [Quidway-Ethernet0/1]shutdown ;关闭端口 [Quidway-Ethernet0/1]quit ;返回 [Quidway]vlan 3 ;创建VLAN [Quidway-vlan3]port ethernet 0/1 ;在VLAN中增加端口 [Quidway-vlan3]port e0/1 ;简写方式

cisco路由器配置及维护手册

cisco路由器配置及维护手册 作者:pixfire 一、路由器简单配置 1. 用串行电缆将PC机串口与路由器CONSOLE口连接,用WIN95的超级终端或NETTERM 软件进行配置。PC机串口设置为波特率9600 数据位8 停止位1。 2. 新出厂的路由器启动后会进入自动配置状态。可按提示对相应端口进行配置。 3 . 命令行状态。若不采用自动配置,可在自动配置完成后,题问是否采用以上配置时,回答N。此时进入命令行状态。 4 进入CONFIG模式。在router>键入enable , 进入router # ,再键入config t ,进入 router(config)# 。 5 配置广域端口。在正确连接好与E1端口的电缆线后,在router # 下键入sh controller cbus 。检验端口物理特性,及连线是否正确。之后,进入config模式。 进行以下配置。 int serial <端口号> E1端口号。 ip address <掩码> 广域网地址 bandwidth 2000 传输带宽 clock source line 时钟设定。 6 检验配置。设置完成后,按ctrl Z退出配置状态。键入write mem 保存配置。 用sh conf 检查配置信息。用sh int 检查端口状态。 二、路由器常用命令 2.1 Exec commands: <1-99> 恢复一个会话 bfe 手工应急模式设置 clear 复位功能

clock 管理系统时钟 configure 进入设置模式 connect 打开一个终端 copy 从tftp服务器拷贝设置文件或把设置文件拷贝到tftp服务器上 debug 调试功能 disable 退出优先命令状态 disconnect 断开一个网络连接 enable 进入优先命令状态 erase 擦除快闪内存 exit 退出exce模式 help 交互帮助系统的描述 lat 打开一个本地传输连接 lock 锁定终端 login 以一个用户名登录 logout

路由器常用命令

cisco路由器常用命令 1:三大模式 router> 用户模式 router > enable 进入特权模式 router # router > enable 进入全局配置模式 router #configure terminal router (conf)# 2:其它模式 Router(config)#interface f1/0 进入接口配置模式Router(config-if)# Router(config)#interface f1/0.1 进入子接口配置模式Router(config-subif)# Router(config)#line console 0 进入line模式Router(config-line)# Router(config)#router rip 进入路由模式Router(config-router)# 3:路由器命名 hostname routera,以routerA为例 router > enable router #configure terminal router(conf)#hostname routerA routera (conf)# 4:配置各类密码 配置特权模式密码(使能口令) enable password cisco,以cisco为例 router > enable router #configure terminal router(conf)#hostname routerA routerA (conf)# enable password cisco 设置VTY(虚拟终端接口)密码 Router(config)#line vty 0 1

Cisco路由器的基本配置命令

Cisco路由器的基本配置命令 Cisco 路由器的基本配置命令 一(实训目的 1(掌握路由器的连接方式和使用基本规则。 2(掌握路由器的基本配置命令。 二(实训器材及环境 1(安装 Windows 2000 Server 系统的计算机一台。 2(安装模拟软件 Boson Netsim 5.31。 3(模拟环境如下: 图 11-1 实验拓扑环境 三(实训理论基础 1(路由器的基本配置语句 (1)配置路由器名字和特权密码: Router1> enable Router1# conf t Router1(config)# hostname R1 R1(config)# enable secret 123456
b5E2RGbCAP
(2)配置路由器的 Ethernet 端口:
R1(config)# interface e0 R1(config-if)# ip address 192.168.1.1 255.255.255.0 p1EanqFDPw R1(config-if)# no shutdown (3)配置路由器的 Serial 端口(DTE 端):DXDiTa9E3d R1(config)# interface s0 R1(config-if)# ip address 10.0.0.1 255.0.0.0 R1(config-if)# no shutdown (4)配置路由器的 Serial 端口(DCE 端):
RTCrpUDGiT
R2(config)# interface s0 R2(config-if)# ip address 10.0.0.2 255.0.0.0 R2(config-if)# clock rate 64000 R2(config-if)# no shutdown 2(路由器可以有多种类型的端口,用于连接 不同的网络,常用的有以太网端口(Ethernet)、快速以太网端口 (FastEthernet)、高速同步串口(Serial)等。有的端口是固定端口,有的端
5PCzVD7HxA
- 1 -

三层交换机与路由器的配置_实例(图解)

三层交换机与路由器的配置实例(图解) 目的:学会使用三层交换与路由器让处于不同网段的网络相互通信 实验步骤:一:二层交换机的配置: 在三个二层交换机上分别划出两VLAN,并将二层交换机上与三层交换或路由器上的接线设置为trunk接口 二:三层交换机的配置: 1:首先在三层交换上划出两个VLAN,并进入VLAN为其配置IP,此IP将作为与他相连PC的网关。 2:将与二层交换机相连的线同样设置为trunk接线,并将三层交换与路由器连接的线设置为路由接口(no switchsport) 3:将路由器和下面的交换机进行单臂路由的配置 实验最终结果:拓扑图下各个PC均能相互通信

交换机的配置命令: SW 0: Switch> Switch>en Switch#conf Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 2 Switch(config-vlan)#exit Switch(config)#int f0/2 Switch(config-if)#switchport access vlan 2 Switch(config-if)#no shut Switch(config-if)#int f0/3 Switch(config-if)#switchport mode trunk %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)#exit Switch(config)# SW 1: Switch>en Switch#conf Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#int f0/2 Switch(config-if)#switchport access vlan 2 % Access VLAN does not exist. Creating vlan 2 Switch(config-if)#no shut Switch(config-if)#exit Switch(config)#int f0/3 Switch(config-if)#switchport mode trunk %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/3, changed state to up Switch(config-if)# SW 2: Switch>en Switch#conf Configuring from terminal, memory, or network [terminal]?

思科交换机路由器命令大全

思科交换机路由器命令 大全 YUKI was compiled on the morning of December 16, 2020

1. 交换机支持的命令:交换机基本状态: 交换机口令设置: switch>enable ;进入特权模式switch#config terminal ;进入全局配置模式 switch(config)#hostname ;设置交换机的主机名 switch(config)#enable secret xxx ;设置特权加密口 令switch(config)#enable password xxa ;设置特权非 密口令switch(config)#line console 0 ;进入控制台 口switch(config-line)#line vty 0 4 ;进入虚拟终端 switch(config-line)#login ;允许登录 switch(config-line)#password xx ;设置登录口令 xxswitch#exit ;返回命令 交换机VLAN设置:

switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端 口1switch(config-if)#switchport access vlan 2 ; 当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config- if)#switchport trunk allowed vlan 1,2 ;设置允许 的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名switch(config)#vtp password ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式 交换机设置IP地址: 交换机显示命令:

路由器常用配置命令

Cisco常用配置命令Cisco常用配置命令 一.交换机的基本配置 C2950# config terminal 进入全局配置模式 show interface fastethernet0/1 查看端口0/1的配置结果 show interface fastethernet0/1 status 查看端口0/1的状态 show mac-address-table 查看整个MAC地址表 clear mac-address-table restricted static 清除限定性地址 C2950(config)# hostname 2950A / 设置主机名为2950A interface f0/23 / 进入端口23的配置模式 enable password cisco / 设置enable password为cisco enable secret cisco1 / 设置enable secret为cisco1 ip address 192.168.1.1 255.255.255.0 / 设置交换机IP 地址 ip default-gateway 192.168.1.254 / 设置默认网关 ip domain-name https://www.360docs.net/doc/a811415212.html, / 设置域名 ip name-server 200.0.0.1 / 设置域名服务器 配置查看MAC地址表 mac-address-table ? mac-address-table aging-time 100 / 设置超时是时间为100s mac-address-table permanent https://www.360docs.net/doc/a811415212.html, /f0/3 加入永久地址mac-address-table restricted static 0000.0c02.bbcc / f0/6 f0/7 加入静态地址 end show mac-address-table /查看整个Mac地址表 clear mac-address-table restricted static C2950(config-if)# interface fastethernet0/1 /进入接口F0/1子配置模式 interface Ethernet0 /进入以太网口0子配置模式 no shutdown /激活接口 speed ? /查看speed命令的子命令 speed 100 /设置该端口速率为100Mb/s dulplex full/half/auto /设置该端口为全双工 description TO_PC1 /设置该端口描述为TO_PC1 show interface fastethernet 0/1 /查看端口0/1的配置结果 show interface fastethernet 0/1 status /查看端口0/1的状态 配置VTP和STP 一. 配置VTP 2950A #vlan database /进入VLAN配置子模式 show vtp status /查看VTP设置信息 show vlan /查看VLAN配置信息 copy running-config startup-config /保存配置文件 2950A(vlan)#vtp server/client /设置本交换机为server/client模式

CISCO路由器配置手册----帧中继(Frame Relay)配置

CISCO路由器配置手册----Frame Relay 1. 帧中继技术 帧中继是一种高性能的WAN协议,它运行在OSI参考模型的物理层和数据链路层。它是一种数据包交换技术,是X.25的简化版本。它省略了X.25的一些强健功能,如提供窗口技术和数据重发技术,而是依靠高层协议提供纠错功能,这是因为帧中继工作在更好的WAN设备上,这些设备较之X.25的WAN设备具有更可靠的连接服务和更高的可靠性,它严格地对应于OSI参考模型的最低二层,而X.25还提供第三层的服务,所以,帧中继比X.25具有更高的性能和更有效的传输效率。 帧中继广域网的设备分为数据终端设备(DTE)和数据电路终端设备(DCE),Cisco 路由器作为 DTE设备。 帧中继技术提供面向连接的数据链路层的通信,在每对设备之间都存在一条定义好的通信链路,且该链路有一个链路识别码。这种服务通过帧中继虚电路实现,每个帧中继虚电路都以数据链路识别码(DLCI)标识自己。DLCI的值一般由帧中继服务提供商指定。帧中继即支持PVC也支持SVC。 帧中继本地管理接口(LMI)是对基本的帧中继标准的扩展。它是路由器和帧中继交换机之间信令标准,提供帧中继管理机制。它提供了许多管理复杂互联网络的特性,其中包括全局寻址、虚电路状态消息和多目发送等功能。 2. 有关命令: 端口设置 任务命令 设置Frame Relay封装encapsulation frame-relay[ietf] 1 设置Frame Relay LMI类型frame-relay lmi-type {ansi | cisco | q933a}2 设置子接口interface interface-type interface-number.subinterface -number [multipoint|point-to-point] 映射协议地址与DLCI frame-relay map protocol protocol-address dlci

思科路由器命令大全详解

一 switch> 用户模式 1:进入特权模式enable switch> enable switch# 2:进入全局配置模式configure terminal switch> enable switch#c onfigure terminal switch(conf)# 3:交换机命名hostname aptech2950 以aptech2950为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令enable password cisco 以cisco为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5:配置使能密码enable secret ciscolab 以cicsolab为例 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab 6:设置虚拟局域网vlan 1 interface vlan 1 switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface vlan 1 aptech2950(conf-if)#ip address 配置交换机端口ip和子网掩码 aptech2950(conf-if)#no shut 是配置处于运行中aptech2950(conf-if)#exit aptech2950(conf)#ip default-gateway 设置网关地址 7:进入交换机某一端口interface fastehernet 0/17 以17端口为例switch> enable switch#c onfigure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# interface fastehernet 0/17 aptech2950(conf-if)# 8:查看命令show switch> enable

交换机路由器基本命令

准备工作: 1)SecureCRT 软件(推荐使用8.0注册机版) 2)console线一条,RS232转USB线一条(淘宝购买) RS232转USB线插在电脑上,打开设备管理(快捷键devmgmt.msc),就会有提示,用360驱动(或其他驱动软件)打上即可。 下图为驱动安装成功后的设备管理器界面(本人电脑系统为win10)。 注意:com口与电脑上USB口是对应的,接在另一个USB口,com口的序号会变化。 file:///C:/Users/Potter/AppData/Local/Temp/msohtmlclip1/01/clip_imag e002.jpg 3)电脑一台 4)网络基础知识(OSI,IP,路由交换基础等) 5)登陆设备( CLI命令行) 设备-----Console—RS232-USB---电脑,打开SecureCRT软件 file:///C:/Users/Potter/AppData/Local/Temp/msohtmlclip1/01/clip_imag e004.jpg 一,锐捷交换机( 和cisco命令类似) 1,设备登陆 Web登陆:192.168.1.1 admin/admin Console密码:默认为空,如果不行试试ruijie / admin 2,系统基本配置

enable //进入用户模式,华为H3C无对应命令clockset 10:00:00 3 17 2017 //clock set 小时:分:秒月日年! config //进入全局模式,对应华为H3C的sys hostname xx //修改设备名称 ! 3,配置vlan ! config //进入全局模式 vlan 10 name xxx //创建一个vlan,并命名 vlan 20 name xxx exit ! no vlan 10 //删除一个vlan ! int range gi 0/2-4 sw mo ac //配置多个接口为access模式 sw ac vl 10 //配置多个接口加入vlan10 exit

(完整版)思科路由器查看配置命令.doc

思科路由器查看配置命令 show run// 看运行状况 show ip route// 看路由表 show int// 看断口 * show ip int br// 看端口 ip 地址 show cdp nei// 察看 cdp 邻居 show ip pro// 察看 ip 协议 查看配置信息用 show 命令,该命令可以在用户模式和特权模式下执行,且在特权模式下看 到的信息比用户模式多。 show 命令很多,常用的有: 1、查看运行配置文件: Router#show running-config 运行配置文件 running-config 位于路由器的 RAM 中,存放的是路由器当前使用的配置信息。 2、查看启动配置文件: Router#show startup-config 启动配置文件 startup-config 位于路由器的 NVRAM 中,可以长期保存。它在启动路由器时装入 RAM ,成为 running-config 。 3、查看路由器的版本信息: Router#show version' 4、查看路由器的接口状态: Router#show ip interface brief 如果接口状态标识为“ Down ”,表示此接口未激活,如果标识为“ Up”,表示此接口已经激活。 5、查看路由表:

Router#show ip route 通过路由表可以看出该路由器已经识别的网络。 6、查看 NAT 翻译情况: Router#show ip nat translation 应该先进行内网与外网的通讯(如:用 ping 命令 ),然后再查看,才能看到翻译情况。

hc交换机与路由器的基本配置

H3C交换机与路由器的基本配置 交换机的基本配置: 传统的基于集线器的局域网中所有的站点都处于同一个“冲突域”中,这里的“冲突域”是.指CSMA/CD算法中每个站点所监听的网络范围。处于同一个冲突域中的站点在任意时刻只能有一个站点占用信道,这意味着传统以太网的带宽被各个站点在统计意义上均分的,这决定了传统形式的以太网不具有可伸缩性。局域网交换机可以让通信的双方拥有一条不受干扰的信道,当一个站点想发送一802.3帧是,他就向交换机发送一标准帧,交换机通过检查帧头的目的地址并将此帧通过高速背板总线从连接目的站点的端口发出。高速背板总线的设计可以保证同时通信的若干站点互不影响。 对交换机的配置有多中方法:通过Console口,通过telnet等。 用Console口对交换机进行配置是最常用的方法,也是对没有经过任何配置的交换机进行配置单唯一途径,配置过程如下: 1.用Console电缆把交换机和PC机进行连接,RJ—45的一端插在交换机的Console 口,另一端与计算机的串口相连。 交换机 Console线缆 PC 图1:通过Console口配置交换机 2.在PC机上打开超级终端应用程序建立与交换机的连接,在PC上点击开始,以此选择程序,附件,通讯,单击“超级终端”,弹出“连接描述”对话框,在名称框输入名称并在图标框选择一个图标(名称和图标可以自由设置,不会影响对交换机的配置),然后点击确定,弹出COM1属性对话框,设置波特率为:9600 数据位为:8 奇偶效验为:无停止位为:1 流量控制为:无,点击“确定”,进入配置编辑窗口。 图2:COM1口属性配置 3.在编辑窗口对交换机进行配置

CISCO 路由交换命令大全

思科交换机路由器命令大全 交换机命令: switch> 用户模式 1:进入特权模式 enable switch> enable switch# 2:进入全局配置模式 configure terminal switch> enable switch#configure terminal switch(conf)# 3:交换机命名 hostname aptech2950 以aptech2950为例 switch> enable switch#configure terminal switch(conf)#hostname aptch-2950 aptech2950(conf)# 4:配置使能口令 enable password cisco 以cisco为例 switch> enable switch#configure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable password cisco 5:配置使能密码 enable secret ciscolab 以cicsolab为例--设置禁用IP地址解析特性,设置启用消息同步特性 switch> enable switch#configure terminal switch(conf)#hostname aptch2950 aptech2950(conf)# enable secret ciscolab aptech2950(conf)#no ip domain-lookup -----设置禁用IP地址解析特性 aptech2950(conf)#logging synchronous -----设置启用消息同步特性 aptech2950(conf)#interface range fastethernet0/1-20 aptech2950(conf-if-range)#spanning-tree portfast -----设置快速端口

思科路由器基本配置与常用配置命令

思科路由器基本配置与常用配置命令(simple for CCNA) 启动接口,分配IP地址: router> router> enable router# router# configure terminal router(config)# router(config)# interface Type Port router(config-if)# no shutdown router(config-if)# ip address IP-Address Subnet-Mask router(config-if)# ^z 配置RIP路由协议:30秒更新一次 router(config)# router rip router(config-if)# network Network-Number router(config-if)# ^z 配置IGRP路由协议:90秒更新一次 router(config)# router igrp AS-Number router(config-if)# network Network-Number router(config-if)# ^z配置Novell IPX路由协议:Novell RIP 60秒更新一次 router(config)# ipx routing [node address] router(config)# ipx maximum-paths Paths router(config)# interface Type Port router(config-if)# ipx network Network-Number [encapsulation encapsulation-type] [secondary] router(config-if)# ^z配置DDR: router(config)# dialer-list Group-Number protocol Protocol-Type permit [list ACL-Number] router(config)# interface bri 0 router(config-if)# dialer-group Group-Number router(config-if)# dialer map Protocol-Type Next-Hop-Address name Hostname Telphone-Number router(config-if)# ^z配置ISDN: router(config)# isdn swith-type Swith-Type router(config-if)# ^z 配置Frame Relay: router(config-if)# encapsulation frame-relay [cisco | ietf ] router(config-if)# frame-relay lmi-type [ansi | cisco | q933a ] router(config-if)# bandwidth kilobits router(config-if)# frame-relay invers-arp [ Protocol ] [dlci ] router(config-if)# ^z配置标准ACL: router(config)# access-list Access-List-Number [ permit | deny ] source [ source-mask ] router(config)# interface Type Port router(config-if)# ip access-group Access-List-Number [ in | out ] router(config-if)# ^z配置扩展ACL: router(config)# access-list Access-List-Number [ permit | deny ] [ Protocol | Protocol-Number ] source source-wildcard [ Source-Port ] destination destination-wildcard [ Destination-Port ] [ established ]

思科路由器常用配置命令大全

思科路由器常用配置命令大全 本文按字母顺序列举了思科路由器常用配置命令,适合思科路由器操作人员随时查看 Access-enable允许路由器在动态访问列表中创建临时访问列表入口 Access-group把访问控制列表(ACL)应用到接口上 Access-list定义一个标准的IP ACL Access-template在连接的路由器上手动替换临时访问列表入口 Appn向APPN子系统发送命令 Atmsig 执行ATM信令命令 B 手动引导操作系统 Bandwidth 设置接口的带宽 Banner motd 指定日期信息标语 Bfe 设置突发事件手册模式 Boot system 指定路由器启动时加载的系统映像 Calendar 设置硬件日历 Cd 更改路径 Cdp enable 允许接口运行CDP协议 Clear 复位功能 Clear counters 清除接口计数器 Clear interface 重新启动接口上的件逻辑 Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率 Cmt 开启/关闭FDDI连接管理功能 Config-register 修改配置寄存器设置 Configure 允许进入存在的配置模式,在中心站点上维护并保存配置信息 Configure memory 从NVRAM加载配置信息 Configure terminal 从终端进行手动配置 Connect 打开一个终端连接 Copy 复制配置或映像数据 Copy flash tftp 备份系统映像文件到TFTP服务器 Copy running-config startup-config 将RAM中的当前配置存储到NVRAM Copy running-config tftp 将RAM中的当前配置存储到网络TFTP服务器上 Copy tftp flash 从TFTP服务器上下载新映像到Flash Copy tftp running-config 从TFTP服务器上下载配置文件 Debug 使用调试功能 Debug dialer 显示接口在拨什么号及诸如此类的信息 Debug ip rip 显示RIP路由选择更新数据 Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息 Debug ipx sap 显示关于SAP(业务通告协议)更新数据包信息 Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层(第2层)的访问过程 Debug ppp 显示在实施PPP中发生的业务和交换信息 Delete 删除文件 Deny 为一个已命名的IP ACL设置条件 Dialer idle-timeout 规定线路断开前的空闲时间的长度 Dialer map 设置一个串行接口来呼叫一个或多个地点 Dialer wait-for-carrier-time 规定花多长时间等待一个载体 Dialer-group 通过对属于一个特定拨号组的接口进行配置来访问控制 Dialer-list protocol 定义一个数字数据接受器(DDR)拨号表以通过协议或ACL与协议的组合来控

华三华为交换机-路由器配置常用命令汇总

欢迎阅读H3C交换机配置命令大全 1、system-view 进入系统视图模式 2、sysname 为设备命名 3、display current-configuration 当前配置情况 4、language-mode Chinese|English 中英文切换 5、interface Ethernet 1/0/1 进入以太网端口视图 6、port link-type Access|Trunk|Hybrid 设置端口访问模式 7、undo shutdown 打开以太网端口 8、shutdown 关闭以太网端口 9、quit 退出当前视图模式 10、vlan 10 创建VLAN 10并进入VLAN 10的视图模式 11、port access vlan 10 在端口模式下将当前端口加入到vlan 10中 12、port E1/0/2 to E1/0/5 在VLAN模式下将指定端口加入到当前vlan中 13、port trunk permit vlan all 允许所有的vlan通过 H3C路由器配置命令大全华为交换机常用配置实例 H3C交换机路由器telnet和console口登录配置 2009年11月09日星期一 10:00 级别说明 Level 名称 命令 参观 ping、tracert、telnet 1 监控 display、debugging

2 配置 所有配置命令(管理级的命令除外) 3 管理 文件系统命令、FTP命令、TFTP命令、XMODEM命令 telnet仅用密码登录,管理员权限 [Router]user-interface vty 0 4[Router-ui-vty0-4]user privilege level 3[Router-ui-vty0-4]set authentication password simple abc telnet仅用密码登录,非管理员权限 [Router]super password level 3 simple super [Router]user-interface vty 0 4[Router-ui-vty0-4]user privilege level 1[Router-ui-vty0-4]set authentication password simple abc telnet使用路由器上配置的用户名密码登录,管理员权限 [Router]local-user admin password simple admin[Router]local-user admin service-type telnet[Router]local-user admin level 3 [Router]user-interface vty 0 4[Router-ui-vty0-4]authentication-mode local telnet使用路由器上配置的用户名密码登录,非管理员权限 [Router]super password level 3 simple super [Router]local-user manage password simple manage[Router]local-user manage service-type telnet[Router]local-user manage level 2 [Router]user-interface vty 0 4[Router-ui-vty0-4]authentication-mode local 对console口设置密码,登录后使用管理员权限 [Router]user-interface con 0[Router-ui-console0]user privilege level 3[Router-ui-console0]set authentication password simple abc 对console口设置密码,登录后使用非管理员权限 [Router]super password level 3 simple super [Router]user-interface con 0[Router-ui-console0]user privilege level 1[Router-ui-console0]set authentication password simple abc 对console口设置用户名和密码,登录后使用管理员权限 [Router]local-user admin password simple admin[Router]local-user admin service-type terminal[Router]local-user admin level 3 [Router]user-interface con 0[Router-ui-console0]authentication-mode local 对console口设置用户名和密码,登录后使用非管理员权限 [Router]super password level 3 simple super [Router]local-user manage password simple manage[Router]local-user

相关文档
最新文档