1、常用网络设备配置命令及配置实例
计算机命令:
PCAlogin:root;使用root用户
password:linux;口令是linux
#shutdown-hnow;关机
#init0;关机
#logout
#login
#ifconfig;显示IP地址
#ifconfigeth0
2、faultgw
3、uter>enable;进进特权模式
router#configterminal;进进全局配置模式
router(config)#hostname
4、)#login;准许登录 router(config-line)#passwordxx;设置登录口令xx router(config)#(Ctrl+z);返回特权模式 router#exit;返回命令 配置IP地址: router(config)#ints0/0;进行串Serail接口 router(config-if)#noshutdown;起动接口 router(config-if)#clockrate64000;设置时钟 router(config-if)#ipaddress10.1.1.1255.255.0.0;设置IP地址和子网掩码 router(config-if
5、)#ipadd10.1.1.2255.255.0.0second;
router(config-if)#intf0/0.1;进进子接口
router(config-subif.1)#ipaddress
6、ng-configstartup-config;存配置 router#copyrunning-configtftp;上载 router#copystartup-configtftp router#copytftpflash:;特权模式下升级IOS router#copytftpstartup-config ;下载配置文件到nvram ROM状态: Ctrl+Break;进进ROM监控状态 rommon>confreg0x2142;跃过配置,263645xx rommon>confreg0x2102;使用配置,恢复工作状态 rommon>reset ;重新
7、引导,等效于重开机
rommon>copyxmodem:
8、静态路由:
iproute
9、frame-relayswitching;使能帧中继交换
router(config-s0)#encapsulationframe-relay;使能帧中继
router(config-s0)#frame-relayintf-typeDCE;DCE端(需要配虚电路)
router(config-s0)#frame-relaylocal-dlci20;配置虚电路号
全然访咨询操纵列表:
router(config)#access-list 10、>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^交换机^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
显示命令:
switch#write;写进保持
switch#showvtp
switch#showrun;查瞧当前配置信息
switch#showvlan;瞧VLAN
switch#showinterface;显示所有端口信息
switch#showintf0/0;显示端口0的信息
交换机全然状态:
switch:;ROM状态,路由器是
rommon>
hostname>;用户模式
hostname#;特权模式
11、hostname(config)#;全局配置模式
hostname(config-if)#;接口状态
交换机口令设置:
switch>enable;进进特权模式
switch#configterminal;进进全局配置模式
switch(config)#hostname 12、witch(config-line)#linevty04;进进虚拟终端virtualtty
switch(config-line)#login;准许登录
switch(config-line)#passwordxx;设置登录口令xx
switch#exit;返回命令
交换机VLAN设置:
switch#vlandatabase;进进VLAN设置
switch(vlan)#vlan2;建VLAN2
switch(vlan)#novlan2;删vlan2
switch(config)#intf0/1;进进端口1
switch(config-if)#switchportaccess 13、vlan2;当前端口1参加VLAN2
switch(config-if)#switchportmodetrunk;设置为干线
switch(config-if)#switchporttrunkallowedvlan1,2;设置准许的vlan
switch(config-if)#switchporttrunkencapdot1q;设置vlan中继
switch(config)#vtpdomain 14、pmodeclient
交换机设置IP地址:
switch(config)#interfacevlan1;进进vlan1
switch(config-if)#ipaddress 15、
在PrivilegedEXEC模式下执行以下命令,瞧瞧并解释执行结果
1.showversion
2.showprocessescpu
3.showprotocols
4.showinterfaces
5.showflash
6.showstartup-config
7.showrunning-config
8.showiproute
9.showmem
命令行编辑
1. 16、
6. 17、onfig
3.copyrunning-configtftp
从tftp效劳器载进配置
1.copytftprunning-config
2.copytftpstartup-config
密码恢复
1.在路由器启动过程中Break
2.更改正程
〈Cisco2600系列〉
a)rommon>confreg
b)Doyouwishtochangetheconfiguration?y/n[n]:y
c)Enable“ignoresystemconfiginfo〞?[y/n]n:y
d)Changethebootcharacteristics?[y/n][n]:y
e)En 18、tertoboot:2
f)Doyouwishtochangetheconfiguration?y/n[n]:n
g)rommon>reset
h)Wouldyouliketoentertheinitialdialog?[yes]:no
i)enable
j)configurememory
k)改密码
l)config-register0x2102
CDP协议
1.cdprun
2.cdptimer
3.cdpholdtime
4.showcdpneighbors
简单一点的实例
Route>你进来是那个模样
Route>en打个en回车进进特权模式
Route 19、特权模式确实是根基那个模样
Router#conft打个conft回车进进全局配置模式
Enterconfigurationcommands,oneperline.EndwithCNTL/Z.那个是自动显示出来的,不打
Router(config)#全局配置模式确实是根基那个模样
Router(config)#hostnameR1第一项配置:把2600路由器改个名如R1
R1(config)#现在名字喊r1了
R1(config)#exit打那个就退出全局配置模式了
%SYS-5-CONFIG_I:Configuredfromconsolebyconsole
R1#showr 20、un打那个就瞧配置了
Buildingconfiguration...
Currentconfiguration:510bytes
!
noservicepassword-encryption
!
hostnameR1
!!
ipsshversion1
!!
interfaceFastEthernet0/0
noipaddress
duplexauto
speedauto
shutdown
下面一大堆就不显示了,
第二项配置:端口配ip
R1#conft应该熟悉了,进进到全局配置模式
Enterconfigurationcommands,oneperline 21、EndwithCNTL/Z.
R1(config)#interfaceFastEthernet0/0进进端口f0/0预备进行IP配置,那个端口你能够在2600面板上寻到标有fastethernet0/0的端口,现在确实是根基要给它分配个IP地址。
R1(config-if)#ipadd192.168.1.1255.255.255.0那个确实是根基给它配ip了。〔add是address的简称〕。
R1(config-if)#nosh那个是up端口
%LINK-5-CHANGED:InterfaceFastEthernet0/0,changedstatetoup
那个时候你拿台电脑,连 22、上配好的口
路由器上的灯该闪了,路由器界面上会显示类似
%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/0,changedstatetoup
的信息。
配到这,你在电脑上ping192.168.1.1是通的。
路由器各端口编号讲明
以如下面图是Cisco2610路由器端口编号的示意图,具体讲明请参考路由器讲明书。
端
用于超级终
接计算机
S0/2
Serial0/2
S1/1
Serial1/1
S1/0
Serial1/0
F0/1
FastEthernet0/1
F0/0
FastEt 23、hernet0/0
S0/0
Serial0/0
S0/3
Serial0/3
S0/1
Serial0/1
二、例子
〔参照“中国网通新建工程网管和路由器IP分配表〞〕
例如:南宁路由器的设置如下
Router#configuret
Router〔config〕#interfacef0/0------------------------------------配端口IP地址
Router〔config-if〕#shut
Router〔config-if〕#noshut
Router〔config-if〕#exit
Router〔config〕 24、interfaces0/0
Router〔config-if〕#shut
Router〔config-if〕#noshut
Router〔config-if〕#exit
Router〔config〕#interfaces0/1
Router〔config-if〕#shut
Router〔config-if〕#noshut
Router〔config-if〕#exit
Router〔config〕#routerospf100------------------------------------配路由协议
Router〔config-router〕#router-id132.37.77.1--------IP地址是以太网口的IP
Router〔config-router〕#nocapabilityopaque
Router〔config-router〕#exit
Router〔config〕#exit
Router#wri-------------------------------------保持配置
结束设置。






