当前位置:首页 » 存储配置 » 思科交换机如何配置日志

思科交换机如何配置日志

发布时间: 2023-03-18 12:26:09

⑴ 关于思科交换机的日志输出问题

你还要在交换机上设置snmptrap,说白了就是当交换机的某些状态变化时自动发一条消息给syslog服务器。

在我的3750上面默认有如下的trap

sw01(config)#snmp-serverenabletraps?

clusterEnableClustertraps

configEnableSNMPconfigtraps

-configEnableSNMPconfig-traps

entityEnableSNMPentitytraps

fru-

hsrpEnableSNMPHSRPtraps

mac-notification戚派羡

port-

snmpEnableSNMPtraps

stpx羡戚EnableSNMPSTPXMIBtraps

syslogEnableSNMPsyslogtraps

vlan-

vtpEnableSNMPVTPtraps

<cr>

如果开启的话,上面的配置每发生一次变化就会发送一条消息出去。IOS版本不高拍一样,支持的trap有多有少。

在配置模式下输入snmp-serverenabletraps就开启了。但是还得加点条件。

比如说接收trap的服务器地址:snmp-serverhost192.168.x.xtrapsxxxxx

把命令帖完格式全变了,给你帖个图上来吧。

⑵ 思科交换机路由器日志问题

应该先在命令行中开启日志!
set logging server enable
set logging server 192.168.2.3
后面的地址就是你的服务器也就是PC的地址。

你在网络上查下具体的配置。
反正要设置一大堆的参数。

CISCO交换机基本配置:Console端口连接
用户模式hostname# ;
特权模式hostname(config)# ;
全局配置模式hostname(config-if)# ;

交换机口令设置:
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 ;返回命令

交换机VLAN创建,删除,端口属性的设置,配置trunk端口,将某端口加入vlan中,配置VTP:
switch#vlan database ;进入VLAN设置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#vlan 3 name vlan3 ;建VLAN 3并命名为vlan3
switch(vlan)#no vlan 2 ;删vlan 2
switch(config)#int f0/1 ;进入端口1
switch(config)#speed ? 查看speed命令的子命令
switch(config)#speed 100 设置该端口速率为100mb/s (10/auto)
switch(config)#plex ? 查看plex的子命令
switch(config)#plex full 设置该端口为全双工(auto/half)
switch(config)#description TO_PC1 这是该端口描述为TO_PC1
switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2
switch(config-if)#switchport mode trunk ;设置为trunk模式(access模式)
switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允备判许的vlan
switch(config-if)#switchport trunk encap dot1q ;设仿正改置vlan 中继
switch(config)#vtp domain vtpserver ;设置vtp域名相同
switch(config)#vtp password ;设置发vtp密码
switch(config)#vtp server ;设置vtp服务器模式
switch(config)#vtp client ;设置vtp客户机模式

交换机设置IP地址,默认网关,域名,域名服务器,配置和查看MAC地址表:
switch(config)#interface vlan 1 ;进入vlan 1
switch(config-if)#ip address 192.168.1.1 255.255.255.0 ;设置IP地址
switch(config)#ip default-gateway 192.168.1.6 ;设置默认网关
switch(config)#ip domain-name cisco.com 设置域名
switch(config)#ip name-server 192.168.1.18 设置域名服务器
switch(config)#mac-address-table? 查看mac-address-table的子命令
switch(config)#mac-address-table aging-time 100 设置超时时间为100ms
switch(config)#mac-address-table permanent 0000.0c01.bbcc f0/3 加入永久地址在f0/3端口
switch(config)#mac-address-table restricted static 0000.0c02.bbcc f0/6 f0/7 加入静态地址目标端口f0/6源端口f0/7
switch(config)#end
switch#show mac-address-table 查看整个MAC地址表
switch#clear mac-address-table restricted static 清除限制性静态地址

交换机显示命令:
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: ;查看闪存

http://www.netexpert.cn/thread-2000-1-1.html

⑶ cisco交换机会自动记录所有日志么

内容来自,就是方便自己查询使用:

地址: http://luyingwfeng.blog.163.com/blog/static/39555822011744736547/

cisco配置log的方法
一:启动log服务 
第一步:启动log logging on
注:By de fault, the logging level is set to 3 (error).
默认log的级别为3(error)
第二步:设置log级别 logging trap severity_level (1-7)
第三步:检查log设置 show logging
二:测试log输出
通过下面几个步骤测试log信息输出:
第一步:log信息发送到console口。
logging console 7
quit

Ubuntu 论坛
这个测试会产生下面的syslog信息
111005: nobody End configuration: OK
这个信息显示已经退出configureation mode.”111005”是该信息标识号。“nobody”指出你是通过console口登录PIX的。
第二步:停止输送log信息到console
no logging console 7
quit
三、发送syslog信息到缓存
第一步:保存显示的信息
logging buffered severity_level (1-7)
第二步:查看console口上的信息
show logging
第三步:清除缓存中的信息以便接收查看新的信息
clear logging
第四步:停止发送log信息到缓存
no logging buffered
新的信息到列表的尾部。

四、把log信和行猛息发送到一个telnet会话
第一步:在PIX的内部配置一个host允许telnet到PIX
a. 输入下面的命令:ubuntu 输入法
telnet ip_address [subnet_mask] [if_name]
For example, if a host has the IP address 192.168.1.2, the command is:
telnet 192.168.1.2 255.255.255.255
b.设置一个telnet会话的空闲时间,默认为5分钟,建议值15分钟。
telnet timeout 15
第二步:启动一个telnet会话
第三步:进行configuration模式
enable
(Enter your password at the prompt)
configure terminal
第四步:开始log设置
logging monitor severity_level (1-7)
第五步:发送log信息到该tetlnet会话
terminal monitor
该命令功能只发送log信息到当前telnet会话。“Logging monitor”设置所有的telnet会话参数,执行该命令后,log信息发送到每一个单独的telnet会话。
第六步:使用像ping,web访问等应用触发产生syslog信息发送到telnet 会话窗口。
第八步:
terminal no monitor
no logging monitor思科路由器
五、发送syslog 信息到Syslog服务器
使用TCP或者UCP协议发送syslog信息到一台主机,该主机必须运行一个syslog程序。有在UNIX和Windeow系统下的第三方软件(Kiwi Syslog Daemon不错)。
参考Cisco PIX防火墙和VPN的配置手册来配置syslog。可以设置log信息的发送方式,如:Email、发送到一个档,发送到一个工作站。
安照下面的步聚配置防火墙发送log信息到一台Syslog服务器唤桥。
第一步:指定一台主机接收log信息
logging host [interface] ip_address [tcp[/port] | udp[/port]] [format emblem]
For example:
logging host dmz1 192.168.1.5
可以指定多台服务器来接收log信息,这样当一台服务器不在线的时候其它的服务器仍可以接带耐收信息。
第二步:设置log级别。
logging trap severity_level (1-7)
第三步:如果想在信息中包含设备的ID使用如下命令
logging device-id {hostname | ipaddress if_name | string text}
包含特定设备的ID(设备的名字,和特定接口的IP或者一个字符串)
六、把log信息发送到SNMP管理机
做下面的配置工作:
第一步:设置SNMP管理机的IP地址
snmp-server host [if_name] ip_addr
第二步:设备其它SNMP服务器的设置,也是必需的
snmp-server location text
snmp-server contact text
snmp-server community key
参考PIX防火墙命令解释可以获得更多的信息。
通过下面的设置来配置发送log信息到SNMP服务器上。
第一步Netscreen 防火墙
snmp-server enable traps
第二步:设置log级别:
logging history severity_level (1-7)
第三步:关闭syslog捕获用下面的命令:
no snmp-server enable traps

本文转自孤舟夜航之家博客51CTO博客,原文链接http://blog.51cto.com/cysky/786539如需转载请自行联系原作者

⑷ 思科交换机如何开启同步日志与域名解析

1,同步日志,你是指把日志则州保存到一个服务器上吗,下例为使得交换机的所有日志都保存到192.168.25.17的/tol/logs/cisco/cisco.log日志中.

cisco#conf t
cisco(config)#logging on -->打开日志显示
cisco(config)#logging 192.168.25.17
cisco(config)#logging facility local2
cisco(config)#logging source-interface vlan 1
cisco(config)#service timestamps debug uptime
cisco(config)#logging buffered 8192 debugging

2,cisco#conf t
cisco(config)#ip name-server 192.168.1.18 设置域名服务器<---DNS 服务器

3,VLAN描述孙洞蔽字符与端口描述是否有区别
VLAN 描述字符是指给VLAN取的名字,因为VLAN 都有一个数字式的ID的。
端口描述,是给指定颤团端口设定描述。是在进行端口配置之后用 “DESCRIPTION 描述字符”设定的。

⑸ 怎么查看CISCO交换机日志

1、首先,进行打开一个的robotframework的窗口的界面当中,进行点核滑击 tools的菜毁敏单。

热点内容
内置存储卡可以拆吗 发布:2025-05-18 04:16:35 浏览:336
编译原理课时设置 发布:2025-05-18 04:13:28 浏览:378
linux中进入ip地址服务器 发布:2025-05-18 04:11:21 浏览:612
java用什么软件写 发布:2025-05-18 03:56:19 浏览:32
linux配置vim编译c 发布:2025-05-18 03:55:07 浏览:107
砸百鬼脚本 发布:2025-05-18 03:53:34 浏览:945
安卓手机如何拍视频和苹果一样 发布:2025-05-18 03:40:47 浏览:742
为什么安卓手机连不上苹果7热点 发布:2025-05-18 03:40:13 浏览:803
网卡访问 发布:2025-05-18 03:35:04 浏览:511
接收和发送服务器地址 发布:2025-05-18 03:33:48 浏览:372