一.熟悉交换机,路由器的根本设置装备摆设.
1.路由器的几个操做形式
Router //用户形式
Routerenable //用户形式敲进enable进进特权形式
Router#configure terminal //特权形式敲进configure termina进进设置装备摆设形式
Router(config)#interface ethernet 0 //设置装备摆设形式敲进interface+接口类型+接口编号,进进设置装备摆设形式(如:interface serial 0 或是interface serial 0/1 ,interface fast1/1,接口编号是几详细要看是哪个型号的设备)
Router(config-if)#exit //从接口形式退出到设置装备摆设形式
Router(config)#exit //从设置装备摆设形式退出到enable形式
Router# //enable形式,也是特权形式.
重视:任何时候按Ctrl-z或是end城市退出到特权形式
2.定名主机名
路由默认主机名为Router
例如:把路由器的主机名定名为XM-WENPING-R2600-A
Router(config)#hostname XM-WENPING-R2600-A
XM-WENPING-R2600-A(config)#
XM-WENPING-R2600-A(config)#hostname Wisdom //设置主机名是Wisdom
Wisdom(config)#
3.给路由器设置时间
Wisdom(config)#Wisdom#clock set 23:46:50 sep 4 2006
Wisdom#show clock //用show clock 号令查看时间
23:46:57.527 UTC Mon Sep 4 2006
Wisdom#
4.给路由器设置banner //登录信息
Wisdom(config)#banner motd #
Enter TEXT message. End with the character '#'.
Welcome to wisdom !!
Wisdom(config)#end
Wisdom#exit
03:12:58: %SYS-5-CONFIG_I: Configured from console by console
Wisdom#exit
Wisdom con0 is now available
Press RETURN to get started.
Welcome to wisdom !! // 设置装备摆设是banner之后无论谁登录到路由器城市先看到的信息.
Wisdomenable
Wisdom#
Banner信息良多情状下是一些警告的信息:
如:
banner motd ^C
* [WARNING] *
* If you are not authorised to access this system *
* exit immediately. *
* Unauthorised access to this system is forbidden by *
* company policies, national, and international laws. *
* Unauthorised users are subject to criminal and civil *
* penalties as well as company initiated disciplinary *
* proceedings. *
* By entry into this system you acknowledge that you *
* are authorised to access it and have the level of *
* privilege at which you subsequently operate on *
* this system *
* You consent by entry into this system to the *
* monitoring of your activities *
^C
5.路由器,交换机接口的描述
Wisdom(config)#interface ethernet 0
Wisdom(config-if)#description To Fuzhou-R2600-A //描述ethernet0口是接到福州的路由器A,一般都要尽能够的描述详尽一点,如许有利于日后的庇护.
6.路由器,交换奥秘码的设置
A.enable密码的设置(enable的密码就是从用户形式到特权形式的密码,enable的密码有两种,一种是加密的,一种是不加密码的,定见利用enable secret 设置密码)
Wisdom(config)#enable password cisco
Wisdom(config)#enable secret cisco1
Wisdom(config)#end
Wisdom#disable
03:29:29: %SYS-5-CONFIG_I: Configured from console by console
Wisdomenable
Password: //那里要输进的是cisco1 ,假设enable的两个密码同时设置,只是secret生效.
Wisdom#
Wisdom#show run
Building configuration...
Current configuration:
enable secret 5 $1$LNtZ$XFAQft5YyTsrXFVAXNp0Y/ //加密过的
enable password cisco //展现为明文,随便被破解.不外能够手工加密,用号令service password-encryption 停止加密
Wisdom(config)#service password-encryption
Wisdom#show run
Building configuration...
Current configuration:
enable secret 5 $1$LNtZ$XFAQft5YyTsrXFVAXNp0Y/ //加密过的
enable password 7 104D000A0618 //手工加密过的
B.设置交换机路由器的console 口密码
Wisdom(config)#line console 0
Wisdom(config-line)#login //启用密码 no login 是不启用密码
Wisdom(config-line)#password cisco //设置的密码为cisco
Wisdom(config-line)#end
03:39:51: %SYS-5-CONFIG_I: Configured from console by console
Wisdom#exit
Wisdom con0 is now available
Press RETURN to get started.
Welcome to wisdom !!
User Access Verification
Password: //要输进console口密码cisco 才能够进进用户形式
Wisdom
C.设置路由器交换机的vty 密码(也是就是长途登岸telnet的密码)
Wisdom(config)#line vty 0 4 //04的意思是0到4,5小我能够同时登录
Wisdom(config-line)#login //启用密码,no login 是不启用密码
Wisdom(config-line)#password cisco //设置的密码为cisco
测试收集的连通性:
telnet+IP address
c:\telnet 192.168.10.200
D:删除enable ,console ,vty 密码
Wisdom(config)#no enable password
Wisdom(config)#no enable secret
Wisdom(config)#line con
Wisdom(config)#line console 0
Wisdom(config-line)#no password
Wisdom(config)#line vty 0 4
Wisdom(config-line)#no password
Wisdom(config-line)#
E.两条常用的号令
阻遏会话退出--exec-timeout
使光标复原到本来的位置,从头展现被笼盖的命里--logging synchronous
Wisdom(config)#line console 0
Wisdom(config-line)#exec-timeout 0 0 //0分0秒表达永久不超时,等同于no exec-timeout
Wisdom (config)#line console 0
Wisdom (config-line)#logging synchronous
F.路由器和交换机的根本设置装备摆设是一样的.大同小异.那里介绍怎么长途telnet 到交换机.
Switch(config)#hostname SW2950 //定名次要机
SW2950(config)#interface vlan 1 //在二层的交换机上设置装备摆设一个三层治理地址
SW2950(config-if)#ip add 192.168.10.225 255.255.255.0
SW2950(config-if)#no shutdown //启用接口
SW2950(config)#line vty 0 4
SW2950(config-line)#login
SW2950(config-line)#password cisco
SW2950(config-line)#
pctelnet 192.168.10.225
Trying 192.168.10.225 ... Open
User Access Verification
Password:
SW2950
那证明长途telnet 胜利.
G:设置装备摆设R1.R2.R3的根本设置装备摆设,使得在R1能够ping通12.1.1.2,ping通13.1.1.3
设置装备摆设R1:
R1(config)#no ip domain-lookup //关掉域名查找
R1(config)#line console 0
R1(config-line)#login
R1(config-line)#password cisco
R1(config-line)#logging synchronous
R1(config-line)#exec-timeout 0 0
R1(config-line)#
设置装备摆设路由器的E0口IP地址
Router(config)#hostname R1
R1(config)#interface ethernet 0 //设置装备摆设E0接口的IP地址
R1(config-if)#ip address 11.1.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#no keepalive
R1(config-if)#exit
设置装备摆设路由器的S0 口IP地址
R1(config)#interface serial 0
R1(config-if)#ip address 12.1.1.1 255.255.255.0
R1(config-if)#clock rate 4000000 //给DCE接口设置装备摆设时钟
R1(config-if)#no shutdown
设置装备摆设路由器的S1 口IP地址
R1(config)#interface serial 1
R1(config-if)#ip address 13.1.1.1 255.255.255.0
R1(config-if)#clock rate 4000000
R1(config-if)#no shutdown
设置装备摆设R2:
R2(config)#no ip domain-lookup //关掉域名查找
R2(config)#line console 0
R2(config-line)#login
R2(config-line)#password cisco
R2(config-line)#logging synchronous
R2(config-line)#exec-timeout 0 0
R2(config-line)#
Router(config)#hostname R2
R2(config)#interface ethernet 0
R2(config-if)#ip address 22.1.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#no keepalive
R2(config-if)#exi
R2(config)#interface serial 0
R2(config-if)#ip address 12.1.1.2 255.255.255.0
R2(config-if)#no shutdown
设置装备摆设R3:
R3(config)#no ip domain-lookup //关掉域名查找
R3(config)#line console 0
R3(config-line)#login
R3(config-line)#password cisco
R3(config-line)#logging synchronous
R3(config-line)#exec-timeout 0 0
R3(config-line)#exit
Router(config)#hostname R3
R3(config)#interface ethernet 0
R3(config-if)#ip address 33.1.1.3 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#no keepalive
R3(config)#int serial 0
R3(config-if)#ip address 13.1.1.3 255.255.255.0
R3(config-if)#no shutdown
设置装备摆设了以前步调之后用号令show interface 查抄接口的形态.
R1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0 11.1.1.1 YES manual up up
Serial0 12.1.1.1 YES manual up up
Serial1 13.1.1.1 YES manual up up
R1#show interfaces ethernet 0
Ethernet0 is up, line protocol is up
Hardware is Lance, address is 00e0.b05b.018e (bia 00e0.b05b.018e)
Internet address is 11.1.1.1/24
MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive not set
ARP type: ARPA, ARP Timeout 04:00:00
R1#show interfaces serial 0
Serial0 is up, line protocol is up
Hardware is HD64570
Internet address is 12.1.1.1/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, loopback not set
Keepalive set (10 sec)
R1#show interfaces serial 1
Serial1 is up, line protocol is up
Hardware is HD64570
Internet address is 13.1.1.1/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, loopback not set
Keepalive set (10 sec)
R1#
R2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0 22.1.1.2 YES manual up up
Serial0 12.1.1.2 YES manual up up
Serial1 unassigned YES unset administratively down down
R3#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0 33.1.1.3 YES manual up up
Serial0 13.1.1.3 YES manual up up
Serial1 unassigned YES unset administratively down down
在R1测试到R2 R3的连通性,利用 ping 的号令
Ping + ip address
如:
R1#ping 12.1.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.1.1.2, timeout is 2 seconds:
!!!!! //5个!表白收集是通的
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms
R1#ping 13.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 13.1.1.3, timeout is 2 seconds:
!!!!! //5个!表白收集是通的
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/4/8 ms
R1#
在路由器或是交换机里利用ping号令
假设ping的成果是!!!!!则表白收集一般.
假设ping的成果是…..则表白收集欠亨.
假设ping的成果是U.U.U则表白下一跳不成达.
H:路由器交换机几条常用的号令:
Show version //查看软件版本
show running-config //查看当前运行的设置装备摆设文件
show startup-config //查看已保留过的设置装备摆设文件
show ip int brie //查看接口根本形态
show interface //查看接口形态的详尽信息
copy run star //把当前运行的设置装备摆设COPY到NVRAM(断电后不丧失)
show controller serial 0 //查察s0口的串行线能否毗连好
R1#show controllers serial 0
HD unit 0, idb = 0x29A524, driver structure at 0x2A1AE8
buffer size 1524 HD unit 0, V.35 DCE cable, clockrate 4000000
R1#show controllers serial 1
HD unit 0, idb = 0x29A524, driver structure at 0x2A1AE8
buffer size 1524 HD unit 0, V.35 DCE cable, clockrate 4000000 //DCE接口要设置装备摆设时钟
R2#show controllers serial 0
HD unit 0, idb = 0x270B50, driver structure at 0x278108
buffer size 1524 HD unit 0, V.35 DTE cable //DTE接口不消设置装备摆设时钟
肃清NVRAM(注:交换机和路由器所用号令一样)
SW2950#erase startup-config
要重起路由器或是交换机,设置装备摆设才会丧失.
本文来源: