方法一:
QUOTE:RedHat的话:vi /etc/sysconfig/syslog把SYSLOGD_OPTIONS=”-m 0″修改为SYSLOGD_OPTIONS=”-r -m 0″ ,然后/etc/rc.d/init.d/syslog restart就OK了.别忘了设置防火墙规则,仅允许你的设备发送到udp/514。
方法二:
QUOTE:对于cisco交换机,你只要用下面logging on,logging trap warning , trap后面共有7个参数,对应不同的级别,logging host inside 192.168.7.2 这个地址是log服务器的地址QUOTE:Cisco路由器日志主机设置vi /etc/sysconfig/syslog把SYSLOGD_OPTIONS=”-m 0″修改为SYSLOGD_OPTIONS=”-r -m 0″ //-r 从远端主机写入 -m 0 vi /etc/syslog.conf加入下列内容。
把设备号为local4(PIX的默认设备号)的所有的日志记录到 /var/log/router.log中#Save pix messages all to router.loglocal4.* 把设备号为local5(在S8016中用info-center loghost host-ip-addr facility local-number指定)的所有的日志记录到 /var/log/router.log中#Save S8016 messages all to S8016.loglocal5.*/var/log/S8016.log。
然后/etc/rc.d/init.d/syslog restart就OK了.别忘了设置防火墙规则,仅允许你的设备发送到udp/514(默认的UDP端口为514,默认的tcp端口为104,PIX的配置logging on //打开Cisco路由器日志logging host [if_name] ip_address [protocol/port] //指定日志主机例:logging host log 133.3.3.2logging trap level //指定日志消息的级别 (0:紧急(Emergencies) 1:告警(Alerts) 2:严重的(Critical) 3:错误(Errors) 4:警告(Warnings) 5:通知(Notifications) 6:信息(Informational) 7:调试(Debugging))。
logging trap 7 //把调试信息设置为Debug级,记录FTP命令和WWW的URL另外可用logging facility命令更改设备号,PIX默认为local4(20),Huawei S8016的配置,Huawei S8016 新命令行设置日志服务器,info-center enable //打开信息中心,inf-center loghost host-ip-addr channel 2 facility local-number,设置日志主机的IP地址,info-center logging host host-ip-addr,设置Cisco路由器日志主机的信息通道,info-center host host-ip-addr channel {channel-number|channel-name},设置日志主机记录工具,set logging host host-ip-addr facility local-number,取消向日志主机输出信息undo info-center loghost host-ip-addr。
Cisco 7505的配置
logging 133.3.3.2
logging on
logging trap 6
logging facility local0
interface Vlan2nameif outside --------------------对端口命名外端口
security-level 0 --------------------设置端口等级
ip address X.X.X.X 255.255.255.224 --------------------调试外网地址
!
interface Vlan3
nameif inside --------------------对端口命名内端口
security-level 100 --------------------调试外网地址
ip address 192.168.1.1 255.255.255.0 --------------------设置端口等级
!
interface Ethernet0/0
switchport access vlan 2 --------------------设置端口VLAN与VLAN2绑定
!
interface Ethernet0/1
switchport access vlan 3 --------------------设置端口VLAN与VLAN3绑定
!
interface Ethernet0/2
shutdown
!
interface Ethernet0/3
shutdown
!
interface Ethernet0/4
shutdown
!
interface Ethernet0/5
shutdown
!
interface Ethernet0/6
shutdown
!
interface Ethernet0/7
shutdown
!
passwd 2KFQnbNIdI.2KYOU encrypted
ftp mode passive
dns domain-lookup inside
dns server-group DefaultDNS
name-server 211.99.129.210
name-server 202.106.196.115
access-list 102 extended permit icmp any any ------------------设置ACL列表(允许ICMP全部通过)
access-list 102 extended permit ip any any ------------------设置ACL列表(允许所有IP全部通过)
pager lines 24
mtu outside 1500
mtu inside 1500
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
global (outside) 1 interface ------------------设置NAT地址映射到外网口
nat (inside) 1 0.0.0.0 0.0.0.0 ------------------NAT地址池(所有地址)
access-group 102 in interface outside ------------------设置ACL列表绑定到外端口
route outside 0.0.0.0 0.0.0.0 x.x.x.x 1 ------------------设置到外网的默认路由
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout uauth 0:05:00 absolute
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
telnet 0.0.0.0 0.0.0.0 inside ------------------设置TELNET所有地址进入
telnet timeout 5
ssh 0.0.0.0 0.0.0.0 outside ------------------设置SSH所有地址进入
ssh timeout 30
ssh version 2
console timeout 0
!
dhcpd address 192.168.1.100-192.168.1.199 inside ------------------设置DHCP服务器地址池
dhcpd dns 211.99.129.210 202.106.196.115 interface inside ------------------设置DNS服务器到内网端口
dhcpd enable inside ------------------设置DHCP应用到内网端口
您好,很高兴为您解答。基于IOS的命令行:
(config)#logging xxx.xxx.xxx.xxx 指定日志服务器IP地址。
(config)#logging trap debugging指定日志级别,可选的级别有0-7共八个级别,0最高,7最低。这八个级别分别为:
alerts Immediate action needed (severity=1)
critical Critical conditions (severity=2)
debugging Debugging messages(severity=7)
emergenciesSystem is unusable(severity=0)
errors Error conditions (severity=3)
informational Informational messages(severity=6)
notifications Normal but significant conditions (severity=5)
warnings Warning conditions(severity=4)
(config)#logging on启用日志服务。
选取最低的debugging级别可以记录所有可以记录的信息
如若满意,请点击右侧【采纳答案】,如若还有问题,请点击【追问】
希望我的回答对您有所帮助,望采纳!
~ O(∩_∩)O~
欢迎分享,转载请注明来源:夏雨云
评论列表(0条)