思科常用命令

1、 清除NAT缓存:clear ip nat translation *

2、清除交换机上的所有配置:erase nvram/wrie erase------>reload(重启)
3、设置路由器telnet管理:en----->conf t------>line vty 0 4------>login------>password cisco

4、设置交换机telnet管理:en----->conf t------>interface vlan 1------>no shut------>ip address 192.168.0.253------->enable password cisco

如果想管理其他网段的交换机需设置网关:en----->conf t------>p default-gateway 192.168.0.254 ------->telnet 192.168.1.253
5、查看硬件信息:show idb all show version

75系列查看机框序列号:show diag 查看板卡序列号:show rsp chassis-info

7513查看板卡序列号:show diagbus

6509:show module (后可加参数) show idprom (后可参数,可查如风扇、电源等序列号等)

6、使日志同步(可取消输入命令时系统自动生成的日志):logging synchronous

7、超时设置:A、登陆超时(输入用户名和密码时):timeout login response 20(20秒)

B、登陆后无操作超时:exec-timeout 0 0(为永不超时)

8、配置SSH:

Router(config)#ip http server

Router(config)#ip http secure-server

Router(config)#ip http authentication local

Router(config)#username cisco privilege 15 password 0 cisco

Router(config)#line console 0

Router(config-line)#login local

Router(config-line)#exit

Router(config)#line vty 0 4

Router(config-line)#privilege level 15

Router(config-line)#login local

Router(config-line)#transport input telnet

Router(config-line)#transport input telnet ssh

Router(config-line)#^Z

Router#conf t

Router(config)#int f0/0

Router(config-if)#ip address 1.1.1.1 255.255.255.0

Router(config-if)#no shut

Router(config-if)#do ping 1.1.1.2

!!!!!

---------------------------------------------------------------------------------------------------

打开WEB,输入https://1.1.1.1 进行连接测试

9、配置无线:

Router(config)#int dotl1radio 0

Router(config-if)# ip address 10.1.12.1 255.255.255.0

Router(config-if)#no shut

Router(config-if)#ssid WIRELESS

Router(config-if-ssid)#guest-mode

Router(config-if-ssid)#authentication open

Router(config-if-ssid)#infrastructure-ssid

Router(config-if-ssid)#exit

Router(config-if)#line con 0

Router(config-line)#password console

Router(config-line)#logging sync

Router(config-line)#exec-timeout 0 0

Router(config-line)#exit

.........

10、配置DHCP:

Router(config)#ip dhcp pool R3WLAN

Router(dhcp-config)#network 10.11.2.0 255.255.255.0

Router(dhcp-config)#default-router 10.11.2.1

Router(dhcp-config)#exit

Router(config)#ip dhcp excluded-address 10.11.2.1

11、清除ASA5510的配置:write erase/重新加载:reload

12、

思科IOS基

本配置

R(config)#hostname wildlee——设置思科IOS系统名称

R(config)#no ip domain lookup——关闭域名解析功能

Wildlee(config)#line console 0—-指定控制线路

Wildlee(config)#line vty 0 15—–指定虚拟终端访问线路

Wildlee(config-line)#exec-timeout 5 0—–指定线路超时时间5分0秒

Wildlee(config-line)#password wildlee—–指定console线路的访问密码为wildlee

Wildlee(config)#enable secret wildlee——设置特权访问密码为wildlee

Wildlee(config)#service password-encryption——加密明文密码

Wildlee(config)#banner motd $this is text$——欢迎广告词



VLAN配置命令

1.创建vlan

Wildlee(config)#vlan {vlan id}——–给vlan设置ID

Wildlee(config-vlan)#name {vlan name}———给vlan取名

2.配置中继端口

wildlee(config-if)#switchport trunk encapsulation dot1q———-定义中继端口封装模式

wildlee(config-if)#switchport mode trunk ————-配置端口为中继端口

3.划分端口

wildlee(config)#interface {interface}——-指定要加入vlan的接口

wildlee(config)#interface range {interface},{interface}——-将多个不连续端口划分到vlan

wildlee(config)#interface range {interface 0/1 – 20}———将多个连续的端口划分到vlan

wildlee(config-if)#speed {10|100|1000}——指定接口速率

wildlee(config-if)#duplex {auto|half|full}——-指定双工模式

wildlee(config-if)#switchport mode access————将指定接口定义为访问端口

wildlee(config-if)#switchport access vlan id———–将指定端口分配到特定vlan

wildlee#show mac-address-table ——-查看接口MAC地址列表

wildlee#show mac-address-table aging-time ———-查看交换机MAC地址学习老化时间

wildlee(config)#mac-address-table aging-time time[s]———修改此时间值

4.给vlan配置IP

wildlee(config)#interface vlan {vlan id}———指定VLAN号

wildlee(config-vlan)#ip address {ip address与 netmask}—–给vlan配置IP地址用于vlan间路由

5.查看配置

wildlee#show interface fastEthernet {interface}———查看指定接口

wildlee#show interface fastEthernet {interface} switchport——-查看交换机端口状态及封装模式

wildlee#show ip interface brief———查看接口摘要信息

wildlee#show vlan-switchport——-查看vlan接口配置情况



VTP配置命令

Wildlee(config)#vtp domain {vtp name}———配置vtp域名

Wildlee(config)#vtp mode {server|client|transparent}——–配置配置vtp工作模式

Wildlee(config)#vtp password {vtp password}——-给vtp设置密码

Wildlee(config)#vtp pruning ——-启用vtp修剪

Wildlee#show vtp status——查看vtp配置情况

Wildlee#show vtp counters——-显示vtp消息发送与接收情况



典型VTP与VLAN配置过程

a.设置VTP DOMAIN(核心、分支交换机上都设置)

b.配置中继(核心、分

支交换机上都设置)

c.创建VLAN(在server上设置)

d.将交换机端口划入VLAN

e.配置三层交换


STP生成树协议

wildlee(config)#spanning-tree vlan {vlan id}——-开启生成树协议

wildlee(config)#spanning-tree vlan {vlan id} root primary——-设置为根交换机

wildlee(config)#spanning-tree vlan {vlan id} priority {bridge priority}——-设置交换机ID优先级值

wildlee(config-if)#spanning-tree vlan {vlan id} cost {cost}———设置交换机端口成本值

wildlee(config-if)#spanning-tree vlan {vlan id} port-priority {priority}———设置端口优先级

wildlee#show spanning-tree——-查看生成树信息


设定交换机MAC地址老化时间
switch(config)#mac-address-table aging-time <10-1000000>--------默认是300秒

设定交换机端口/MAC绑定
switch(config)#mac-address-table static 0100.5e00.0005 vlan 1 interface f0/1




13、ip unnumbered Loopback0 借用端口IP地址命令


“借用IP地址”实际就是:一个接口上没有配置IP地址,但是还想使用该接口。就向其它有IP地
址的接口借一个IP地址来。如果被借用接口有多个IP地址,只能借来主IP地址。如果被借用接口没有
IP地址,则借用接口的IP地址为0.0.0.0。该功能通过Ip unnumbered命令来实现。

相关文档
最新文档