Phanx's profilephanx.comBlogListsGuestbookMore ![]() | Help |
|
phanx.comPowered by Technology 3/8/2009 还真遇到伪造MAC地址让交换机CAM表溢出的事情了今日处理某客户一个网络故障。某个节点总是间歇性故障,重启设备又好了。
开始抓包发现有网络中有一半以上流量是目的地址为随机IP的445包。于是将发送源IP清理出来,断网隔离。
没想到过了几个小时又出毛病了。3550交换机不转发流量,抓包看就只有交换机自身产生的STP,DTP,Loop Detect这些数据。
这时候通过show mac-address-table发现某个端口下有大量伪造的MAC地址,当时就翻了有2000行,n屏都翻不完,放弃,估计CAM表是爆了。
于是在端口下做port-security限制MAC数量,然后清空CAM表。交换机还是不转发流量,估计已经软件已经有问题了,重启好了。
经过观察,故障解决了。
经过了解,判断可能是一台服务器中毒了,可惜没有条件去服务器上确认病毒的名字和类型。 2/13/2009 CS-MARS 6.x.x (6.0.2) 虚拟机的安装========phanx.com========= 网上关于CS-MARS 4.x.x的虚拟机安装的文章已经很多了,对于6.x.x来讲,其实大体一致。但是有些和4.x.x不一样的地方,这里特别讲一下。 在4.x.x版本的安装文章中提到,当MARS的Recovery CD完成安装后,在MARS第一次启动的时侯,按住SHIFT键等待lilo停留在lilo boot:状态,然后输入linux rw init=/bin/bash进入系统的shell。 但是在6.x.x版本的安装中,我发现无法按住SHIFT键停在lilo boot状态(其实lilo只要按住SHIFT或者CTRL或者ALT任意一个键都会停住),后来发现可以通过边按SHIFT边乱敲字母键的方式停在lilo boot:状态,但是只要不敲键,很快就会进入正常启动过程。于是我很快的输入了linux rw init=/bin/bash,但是发现还是进入MARS的shell(pnsh)。 后来找了点资料,发现6.x.x在这里有点不同。需要用linux的CD来启动进入rescue状态。我用的是Redhat Linux Enterprise Server Advanced 5的CD1来启动的。 CD启动后按F5再输入linux rescue进入拯救模式。 Linux会问你,是否自动查找硬盘上的linux。选择Continue,然后就会找到MARS上的Linux了,并且会自动帮你挂载在/mnt/sysimage下面。 然后就可以进入做license了。 cd /mnt/sysimage/opt/janus/release/bin 好了,到这里我们的MARS的license就有了,把光盘拿出来,退出rescure模式的shell,就会重新启动。然后进行MARS的第一次启动,然后开始prepare Oracle(相当慢),完成后就可以进入MARS的shell了。 然后第一次Web登录MARS会让你输入License,OK,前面我们都弄了,所以这里随便输入任意数字填满输入框就行了,全1都可以。然后就可以随便用了。 到这里基本就OK了,但是有的人并不满足,比如我,想用root?OK,有办法。 但是必需要在前面rescue模式下多做些东西。 首先要修改/mnt/sysimage/etc/passwd里面的内容 把pnadmin:x:500:500::/opt/janus/release/bin:/opt/janus/release/bin/pnsh 然后,修改/mnt/sysimage/etc/passwd的内容增加一行 BTW:别说你不会用vi....好了,保存好,其余和前面一样,退出rescue的shell。开始第一次启动MARS的系统,然后开始prepare Oracle(相当慢),完成后就可以进入系统的bash了。 这个时侯用命令 sudo su 好了,退出root用户。回到pnadmin用户,起用:/opt/janus/release/bin/pnsh到MARS的shell,这个时候我们就可以使用隐藏命令expert来进入root用户了,口令就是你刚才为root用户设置的口令。 OK,大功告成,enjoy it~ 重要提示: 这个问题是老外讲的,我也发现了。 还有,在rescue的时侯如果没有自动挂载好,你可以试试 1/24/2009 NAT/PAT中对于FTP的处理,以及PAT后的非标准21 FTP端口设置========phanx.com=========
Author: phanx Updated: 2009-1-24 ========================= 这里先要对FTP的两种模式说一下: 引用一张Cisco上面的图:
![]() FTP分为两种模式: 主动Active 被动 Passive
主动模式下是使用21作为控制, 20作为数据口。
首先是客户端通过大于1023的端口发起到服务器21端口的控制连接,信息交换完成后。服务器从20端口发起连接到客户端提供的接收端口。
这是传统意义上的FTP行为。
被动模式是使用21作为控制,然后服务器自动选择一个大于1023的端口作为数据。
首先是客户端通过大于1023的端口发起到服务器21端口的控制连接,信息交换完成后。服务器告诉客户端一个大于1023的端口作为数据口,
然后客户端再以另外一个大于1023的端口发起连接到服务器提供的数据端口进行数据传输。
目前大多数服务器都支持这种模式,而且大部分客户端都默认采用被动模式和服务器进行传输。
好了,当我们在内网有两台服务器FTP SEVER1和FTP SERVER2都需要被外网访问的时侯,我们会分别为这两个服务器做映射出去。
假定FTP SERVE1(10.0.0.100)占用公网IP(x.x.x.x)的21端口,FTP SERVER2(10.0.0.200)占用公网IP(x.x.x.x)的2211端口。那么我们就会这么写:
ip nat inside source static tcp 10.0.0.100 21 x.x.x.x 21 extendable
ip nat inside source static tcp 10.0.0.200 21 x.x.x.x 2211 extendable
这样做了以后,我们会发现FTP SERVER1是正常的,而FTP SERVER2却不正常,表现为登录以后无法列出目录:
以下为FTP 客户端的LOG:
[xx:xx:03] PASV
[xx:xx:03] 227 Entering Passive Mode (10,0,0,200,6,32) [xx:xx:24] Data Socket Error: Connection timed out [xx:xx:24] List Complete: 0 bytes in 21.44 (1.00 KBps) 这是为什么呢?
答案就是在被动模式下,FTP SEVER告诉客户端的数据端口,无法被访问。为什么 FTP SERVER1又可以呢?
因为FTP SERVER1在对外映射的时侯采用了21端口,IOS会自动识别这个端口是FTP控制口,
从而去检查里面FTP数据控制数据发现服务器告诉客户端的这个用于传送数据的端口,然后自动的添加一条映射。
phanx# sh ip nat tr | in 10.0.0.100:
tcp x.x.x.x:21 10.0.0.100:21 y.y.y.y:1585 y.y.y.y:1585 tcp x.x.x.x:21 10.0.0.100:21 --- --- tcp x.x.x.x:1812 10.0.0.20:1812 y.y.y.y:1594 y.y.y.y:1594 而FTP SERVER2映射的端口2211无法自动被识别成FTP端口,所以IOS不会自动的为它建立数据端口的映射。
解决的办法就是用 ip nat service 来指定这个端口。
access-list 10 permit 10.0.0.200
ip nat service 10 ftp tcp port 21
注意,这里的tcp port 21是指的 10.0.0.200的FTP端口21而不是 x.x.x.x的2211。如果FTP SERVER2用的FTP端口是其他的,那么就写对应的端口号。
这样做了以后,我们的FTP SERVER2就可以以 x.x.x.x:2211 的方式被公网访问了。
说道这里,问题已经解决了。但是,有人可能会提出来,既然FTP SERVER1用被动很正常,x.x.x.x:20端口并没有使用,
那为什么不用把FTP SERVER2主动模式来映射呢?比如这样做:
ip nat inside source static tcp 10.0.0.200 20 x.x.x.x 20 extendable
ip nat inside source static tcp 10.0.0.200 21 x.x.x.x 2211 extendable OK. 这样做其实对于一部分情况是没有问题的。例如客户机的地址是公网地址,或者说能被FTP SERVER2所访问的地址。
但是如果客户机也是通过NAT/PAT上网的呢?假设客户端地址是192.168.1.111我们将看到这样的情况:
[00:14:10] PORT 192,168,1,111,6,179
[00:14:10] 200 PORT Command successful. [00:14:10] REST 2028256 [00:14:10] 350 Restarting at 2028256. Send STORE or RETRIEVE. [00:14:10] RETR fool.exe [00:14:10] 150 Opening BINARY mode data connection for fool.exe (924668 Bytes). [00:14:11] 425 Cannot open data connection. [00:14:11] Transfer Failed! 因为是主动模式,是服务器主动送数据给客户机。那客户机通过控制信息就需要告诉服务器往哪里送,
但是FTP客户端并不知道自己的公网地址和端口,并且客户机也没有能力去自己的NAT/PAT网关上去开放一个端口让服务器来送数据。
所以它是以自己的实际地址去告诉服务器的。对于服务器而言,这个地址是无法被访问到的,所以这个办法也有行不通的地方。
当然,如果FTP客户端支持uPNP能识别到翻译后的公网地址,NAT/PAT网关也有uPNP的能力的话,主动模式的这个问题应该就能解决。
BTW:主动模式的FTP又被称为 "firewall UNfriendly",什么原因? 好好理解哦~
PIX/ASA上面的配置方法见:
PIX/ASA 7.x: Enable FTP/TFTP Services Configuration Examplehttp://www.cisco.com/en/US/products/ps6120/products_configuration_example09186a00807ee585.shtml 12/21/2008 中国电信 我的e家 e8-B 无线MODEM设置指南 阿尔卡特 100A-AA型今天费劲周折,去电信换了一个号称无线Modem的东西。结果回来翻了半天说明书都没有看见在什么地方设置路由和NAT。
Google一番,发现这个玩意儿是电信定制过的。电信可以远程网管。。。给大家贴在机器上的实际上是个Viewer帐号,
真正的管理员帐号是 telecomadmin 密码是 nE7jA%5m
通过这个帐号登录进去以后就可以配置拨号和路由了。
点击“网络”,即可看到配置界面。
连接名称选“1_INTERNET_R_x_xx"
模式选"Route"
"PPPoE"
勾上"PPPoE路由桥混合模式"
VPI用已有的
VCI用已有的
服务类型选"UBR Without PCR"
勾上"NAT"
用户名填入 拨号的用户名
密码填入对应的密码
服务名称 任意填
拨号方式 包月的就选 "自动连接"
服务模式选 "INTERNET"
然后保存,重启即可。
说明以下 VPI/VCI 号各个地方电信都不一样,一般来说领回来的机器上是默认设置好了的。
如果没有,可以参考http://www.chinadsl.net/bbs/thread-29151-1-1.html 全国ADSL宽带虚拟通道值 VPI、VCI值征集【电信、网通、铁通】
默认还有一个TR069连接,那是电信用来管理这个MODEM的连接,走的另外的VPI/VCI,用的DHCP方式得到地址。
可以把这个连接删了,这样电信就没有办法管理了,要不然你的telecomadmin的口令可能就被改了。
12/18/2008 TCP Intercept防止TCP SynFlood DoS========phanx.com=========
Author: phanx Updated: 2008-12-18 ========================= 今天居然有人SynFlood我的Web Server,无聊的人还真多。。。
偶然跑到Router上检查,居然发现有大量的NAT条目,一看端口很规律,都是去往Web Server的80的,而且源地址是同一个,源端口依次递增。
估计是TCP SynFlood了,不过幸好还不是超多。
于是使用2800自带的防止SynFlood DoS的功能TCP Intercept。
配置简单,立马见效,5 seconds 不Established,就向Server发送TCP RST了 。
ip tcp intercept list TCPINTERCEPT
ip tcp intercept connection-timeout 300 ip tcp intercept watch-timeout 5
ip tcp intercept mode watch ip access-list extended TCPINTERCEPT
permit tcp any host 188.8.8.8 eq 80 phanx_Router#sh tcp intercept con
Incomplete: Client Server State Create Timeout Mode 221.201.145.24:51247 188.8.8.8:80 SYNSENT 00:00:04 00:00:00 W 221.201.145.24:51246 188.8.8.8:80 SYNSENT 00:00:04 00:00:00 W 221.201.145.24:51245 188.8.8.8:80 SYNSENT 00:00:04 00:00:00 W 221.201.145.24:51251 188.8.8.8:80 SYNSENT 00:00:03 00:00:01 W 221.201.145.24:51250 188.8.8.8:80 SYNSENT 00:00:04 00:00:00 W 221.201.145.24:51249 188.8.8.8:80 SYNSENT 00:00:04 00:00:00 W 221.201.145.24:51248 188.8.8.8:80 SYNSENT 00:00:04 00:00:00 W Established: phanx_Router#sh tcp intercept st
Watching new connections using access-list TCPINTERCEPT 11 incomplete, 0 established connections (total 11) 55 connection requests per minute 还好还好,不是动真格的。。。
以下是NAT记录。
phanx_Router#sh ip nat translations
Pro Inside global Inside local Outside local Outside global tcp 218.104.217.135:80 188.8.8.8:80 60.240.247.48:1055 60.240.247.48:1055 tcp 218.104.217.135:80 188.8.8.8:80 60.240.247.48:1060 60.240.247.48:1060 tcp 218.104.217.135:80 188.8.8.8:80 60.240.247.48:1061 60.240.247.48:1061 tcp 218.104.217.135:80 188.8.8.8:80 60.240.247.48:1094 60.240.247.48:1094 tcp 218.104.217.135:80 188.8.8.8:80 60.240.247.48:1116 60.240.247.48:1116 。 。
。
tcp 218.104.217.135:80 188.8.8.8:80 60.240.247.48:3688 60.240.247.48:3688
tcp 218.104.217.135:80 188.8.8.8:80 60.240.247.48:3689 60.240.247.48:3689 tcp 218.104.217.135:80 188.8.8.8:80 60.240.247.48:3690 60.240.247.48:3690 。 。
。
tcp 218.104.217.135:80 188.8.8.8:80 60.240.247.48:4887 60.240.247.48:4887
tcp 218.104.217.135:80 188.8.8.8:80 60.240.247.48:4993 60.240.247.48:4993 Pro Inside global Inside local Outside local Outside global tcp 218.104.217.135:80 188.8.8.8:80 94.240.224.240:59779 94.240.224.240:59779 tcp 218.104.217.135:80 188.8.8.8:80 94.240.224.240:60091 94.240.224.240:60091 tcp 218.104.217.135:80 188.8.8.8:80 94.240.224.240:62937 94.240.224.240:62937 tcp 218.104.217.135:80 188.8.8.8:80 94.240.224.240:64645 94.240.224.240:64645 tcp 218.104.217.135:80 188.8.8.8:80 94.240.224.240:65373 94.240.224.240:65373 tcp 218.104.217.135:80 188.8.8.8:80 121.229.68.69:1134 121.229.68.69:1134 tcp 218.104.217.135:80 188.8.8.8:80 123.115.1.69:7744 123.115.1.69:7744 tcp 218.104.217.135:80 188.8.8.8:80 123.115.1.69:8241 123.115.1.69:8241 tcp 218.104.217.135:80 188.8.8.8:80 221.201.145.24:18860 221.201.145.24:18860 tcp 218.104.217.135:80 188.8.8.8:80 221.201.145.24:18999 221.201.145.24:18999 。 。
。
。
。
。
tcp 218.104.217.135:80 188.8.8.8:80 221.201.145.24:40572 221.201.145.24:40572 tcp 218.104.217.135:80 188.8.8.8:80 221.201.145.24:40573 221.201.145.24:40573 tcp 218.104.217.135:80 188.8.8.8:80 221.201.145.24:40574 221.201.145.24:40574 tcp 218.104.217.135:80 188.8.8.8:80 221.201.145.24:40575 221.201.145.24:40575 tcp 218.104.217.135:80 188.8.8.8:80 221.201.145.24:40576 221.201.145.24:40576 tcp 218.104.217.135:80 188.8.8.8:80 --- --- 11/21/2008 nslookup 解析域名的一点发现 ========phanx.com=========
Author: phanx Updated: 2008-11-21 ========================= C:\Documents and Settings\Administrator>nslookup bbs.scu.edu.cn
Server: 68.128.128.61.cq.cq.cta.net.cn Address: 61.128.128.68 Non-authoritative answer:
Name: bbs.scu.edu.cn.huawei.com1 Address: 219.153.42.248 C:\Documents and Settings\Administrator>ping bbs.scu.edu.cn Pinging bbs.scu.edu.cn [125.69.85.16] with 32 bytes of data:
Reply from 125.69.85.16: bytes=32 time=8ms TTL=54
Reply from 125.69.85.16: bytes=32 time=8ms TTL=54 Reply from 125.69.85.16: bytes=32 time=8ms TTL=54 Reply from 125.69.85.16: bytes=32 time=8ms TTL=54 Ping statistics for 125.69.85.16:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 8ms, Maximum = 8ms, Average = 8ms C:\Documents and Settings\Administrator>
用nslookup解析的时候为什么会多出一个 huawei.com1的后缀呢?
原来nslookup解析域名的时候会自动把domain附加在输入的名字后面
在nslookup中用set all检查参数
> set all
Default Server: 68.128.128.61.cq.cq.cta.net.cn Address: 61.128.128.68 Set options:
nodebug defname search recurse nod2 novc noignoretc port=53 type=A class=IN timeout=2 retry=1 root=A.ROOT-SERVERS.NET. domain=huawei.com1 MSxfr IXFRversion=1 srchlist=huawei.com1 >
原来附加了一个huawei.com1 修改一下set nosearch
然后再解析就对了
> bbs.scu.edu.cn
Server: 68.128.128.61.cq.cq.cta.net.cn Address: 61.128.128.68 Non-authoritative answer:
Name: bbs.scu.edu.cn Address: 125.69.85.16 >
11/13/2008 7600 SPA-IPSEC-2G和SPA-5xGE-V2配合之小问题========phanx.com=========
Author: phanx Updated: 2008-11-13 2009-03-08
========================= 某用户需要用SPA-IPSEC-2G在7600上实现到n多节点的IPSec Site-to-Site VPN, 由于7600引擎上的以太口做子接口配合IPSEC SPA不支持CBWFQ,
故又弄了块SPA-5xGE-V2.
说起SPA-5xGE-V2这卡也怪,在6500机框上要用7600-SIP-600来装,在7600上就非得用7600-SIP-400来装. 当然SPA-IPSEC-2G只能装在7600-SSC-400 上 SPA-IPSEC-2G是采用的Vlan Connect方式,即一个在传统直连链路上将IPSEC加速模块嵌入进去.以前是用一个以太口的子接口连接对方.现在则将以太口子接口上的地址移到inside interface vlan上. 然后再用 outside vlan或者一个子接口去连接对方,最后通过connect方式将inside vlan和outside vlan/sub-interface桥接起来. 以前是 sub-interface ------> 对端 或者 interface vlan & switchport trunk -------> 对端 interface Vlan2 现在是 interface Vlan.inside ---[connect engine]--- [SPA-IPSEC-2G] --- [connect vlan.inside] -- vlan outside in switchoport trunk ------>对端 或者是 interface Vlan.inside ---[connect engine]--- [SPA-IPSEC-2G] --- [connect vlan.inside] -- sub-interface.outside ------>对端 interface Vlan102 或者 配置方式就说到这里. Guide上写的很明确,but 遇到一个Bug.. CSCsg49757 Bug Details
什么意思呢,简单说就是用子接口方式做就ping不通对端,IPSec也不行.... 解决方法是在子接口下多配一个 cdp enable.... //寒... 仿佛SPA的GE卡默认就没有开起cdp. 查了Bug Toolkit,发现还没有版本修复这个BUG的(到12.2(33)SRC1为止). 就用Workaround凑合吧. 又遇到另外一个不知道是不是Bug的问题. 由于对端节点较多,所以子接口数目较多, 别人贴配置的时候一不留神把某几个子接口的配置多贴了一次. 贴完发现crypto connect语句重复的地方有提示 xxxx already connect to vlan xxx, 然后发现重复的子接口下的OSPF neighber就起不来了.ping也能ping通对端,就是OSPF无法建立邻接关系. Debug看本端有OSPF的Hello出去,但是在对端Debug却没有收到. 无奈之下,no掉子接口下crypto connect语句重新配上,好了. 依此办法对其他贴重复的子端口重配crypto connect语句, OSPF Neighbor就全部正常了. 看来SIP/SPA的bug还真不少....!
再补充一个SPA-IPSEC-2G的BUG,在Catalyst 6500 Series Switches Release Notes for Cisco IOS Release 12.2(33)SXH and Later Releases中提到:Note 也就是说用SPA-IPSEC-2G来做Remote Access VPN的时侯没法用TACACS来做XAuth。我同事就很走运的遇到这个BUG了。
2950/2960 Port Manager Internal Software Error========phanx.com=========
Author: phanx Updated: 2008-11-13 ========================= 一台2950出现大量的Port Manager Internal Software Error. LOG如下:
CST: %PM-3-INTERNALERROR: Port Manager Internal Software Error (vlanid >=0 && vlanid
< PM_MAX_VLANS: ../switch/pm/pm_vlan.c: 564: pm_vlan_get_vlan_data) -Traceback= 5B7438 60A1E0 617A48 B36EB8 B3A5BC AE7380 AE840C BDD138 BD470C
*Mar 1 08:06:02.052 CST: %PM-3-INTERNALERROR: Port Manager Internal Software Error (vlanid >=0 && vlanid < PM_MAX_VLANS: ../switch/pm/pm_vlan.c: 609: pm_vlan_get_vlan_data) -Traceback= 5B7438 60A1E0 617A48 B36EB8 B3A5BC AE7380 AE840C BDD138 BD470C *Mar 1 08:06:04.048 CST: %PM-3-INTERNALERROR: Port Manager Internal Software Error (vlanid >=0 && vlanid < PM_MAX_VLANS: ../switch/pm/pm_vlan.c: 609: pm_vlan_get_vlan_data) -Traceback= 5B7438 60A1E0 617A48 B36EB8 B3A5BC AE7380 AE840C BDD138 BD470C *Mar 1 08:06:04.048 CST: %PM-3-INTERNALERROR: Port Manager Internal Software Error (vlanid >=0 && vlanid < PM_MAX_VLANS: ../switch/pm/pm_vlan.c: 609: pm_vlan_get_vlan_data) -Traceback= 5B7438 60A1E0 617A48 B36EB8 B3A5BC AE7380 AE840C BDD138 BD470C *Mar 1 08:06:06.053 CST: %PM-3-INTERNALERROR: Port Manager Internal Software Error (vlanid >=0 && vlanid < PM_MAX_VLANS: ../switch/pm/pm_vlan.c: 609: pm_vlan_get_vlan_data) -Traceback= 5B7438 60A1E0 617A48 B36EB8 B3A5BC AE7380 AE840C BDD138 BD470C *Mar 1 08:06:06.053 CST: %PM-3-INTERNALERROR: Port Manager Internal Software Error (vlanid >=0 && vlanid < PM_MAX_VLANS: ../switch/pm/pm_vlan.c: 609: pm_vlan_get_vlan_data) 开始以为是软件BUG,遂即升级到最新的12.1(22)EA12,故障依旧.
后来,更换成一台2960,仍然报错.
检查STP.
2960#sh spanning-tree
VLAN0001
Spanning tree enabled protocol rstp Root ID Priority 49152 Address 00b0.8e21.9400 Cost 3004 Port 49 (GigabitEthernet0/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 49153 (priority 49152 sys-id-ext 1)
Address 0021.1c7a.8380 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 300 UplinkFast enabled but inactive in rapid-pvst mode Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- -------------------------------- Fa0/23 Desg FWD 3019 128.23 P2p Fa0/47 Desg BKN*3019 128.47 P2p *PVID_Inc Fa0/48 Desg BKN*3019 128.48 P2p *PVID_Inc Gi0/1 Root FWD 3004 128.49 P2p Peer(STP) Fa0/47和Fa0/48连接的是同一台设备2811的HWIC-4ESW模块的Fa0/0/0和Fa0/0/1端口.
我检查了2811上的配置,发现用户将vlan 99上的STP关闭了.询问原因是2811上的vlan99和其他H3C的设备连接时,运行生成树会有一些问题,所以将其关闭.
经过测试,发现打开2811上的vlan99的生成树则2950上不会出现报错,所以恢复2811上的生成树就可以解决这个问题,但是又会造成H3C设备的问题.
由于*PVID_Inc是说两边STP的Vlan数目不一致,导致端口的Vlan1被Block,
鉴于用户没有使用vlan1,所以我采用了在2950上Fa0/47和Fa0/48上将vlan1从trunk中remove后,设备不再报错.
另外说一下,发现HWIC-4ESW模块上的口子无法做Port Channel....... 囧rz
7/11/2007 Cisco VPN Client Automatic Initiation 自动重连========phanx.com=========
Author: phanx Updated: 2007-7-11 ========================= 默认情况下,Cisco VPN Client软件在断线以后无法自动重连。某个地方,却需要自动重连功能.
search了一番guide.找到如下解决办法:
通过修改vpnclient.ini,可以实现断线后自动重连。
vpnclient.ini
在[Main]段上添加三句
AutoInitiationEnable=1 // 允许自动发起连接
AutoInitiationRetryInterval=1 // 自动发起连接重试间隔时间(单位分钟) AutoInitiationList=XXXXX // 自动连接配置段名称 XXXXX为自动连接的字段名
然后在[XXXXX]字段下写四句 [XXXXX]
Network=15.66.13.0 // 实际地址段 Subnet=255.255.255.252 // 实际掩码 ConnectionEntry=ATM1 // 需要连接的项目,对应VPN Client中建立的连接项目 Connect=1 // 允许自动连接 修改后,VPN GUI界面在Options下也会多出一项Automatic VPN Initiation...
6/2/2007 创建在Cisco路由器上可以show run的只读用户========phanx.com=========
Author: phanx Updated: 2005-11-01 ========================= 某客户要求实施用户分级,有点特殊的就是需要分为特权用户和只读用户. 特权用户可以查看,修改配置,只读用户只能查看,不能修改配置. 开始使用cisco的权限分级 level 1 和 level 15 来作,
然后给level 1 用户 授予 show run的权限 privilege exec level 1 show running-config 表面上看是达到了要求,但是. 当 level 1 用户使用show run 的时候
命令可以被执行,但是显示出来得确实一个空得配置. Cisco有一篇文档描述了这个问题 IOS Privilege Levels Cannot See Complete Running Configuration www.cisco.com/en/US/tech/tk59/technologies_tech_note09186a00800949d5.shtml 所以,为了解决这个问题,我们要从另外一个角度来做.
要完成这个功能,我们需要通过CiscoACS来配合,而不仅仅是本地AAA认证.
大概思路就是特权用户就和平常得特权用户一样, level 15的用户.
而对于只读用户,我们也给level 15得权限,但是要禁止它执行configure命令. 下面是具体的配置方法:
在需要进行认证的路由器上做如下配置:
aaa authentication login default group tacacs+ local none aaa authentication login no_tacacs local aaa authorization exec default group tacacs+ local aaa authorization commands 15 default group tacacs+ local aaa accounting commands 15 default start-stop group tacacs+ aaa session-id common ip tacacs source-interface Loopback0
tacacs-server host x.x.x.x tacacs-server directed-request tacacs-server key keytoacs 建议再加入一个用户
username admin privilege 15 password passwordforadmin 以备ACS服务器无法访问时候用来进行本地认证 需要在ACS上做一下配置:
1. 添加 超级用户的 group 在 Group Setup 中找到一个未用的组,例如 Group 8, 选 Edit Setting 在TACACS+ Settings 中,选中Shell (exec) 和Privilege level 并将Privilege level 设为15 Shell Command Authorization Set
选 Per Group Command Authorization Unmatched Cisco IOS commands -- Permit Unlisted arguments -- Permit 然后选 Sumit + Restart 2.添加只读用户Group
在Group Setup中选中一个未用的组,例如group 9 选 Edit Setting。 其余操作同添加超级用户一致。 最后一个Shell Command Authorization Set 选 Per Group Command Authorization Unmatched Cisco IOS commands -- Permit 然后勾上 Command 选项,输入 configure,Arguments里面填入 deny terminal ,然后Unlisted arguments - Deny。 点击Submit+Restart
然后添加用户,超级用户划入 group 8, 只读用户划入 group 9。 就是在User Setup的Group to which the user is assigned中选取相应的group就行了。
Cisco PIX /ASA 防火墙密码恢复========phanx.com=========
Author: phanx Updated: 2006-9-1 2007-6-1
========================= PIX 的密码恢复和路由器/交换机稍有不同,需要用密码恢复文件来进行恢复. 密码恢复文件有这些:
np70.bin (7.0 release)
np63.bin (6.3 release)
np62.bin (6.2 release)
np61.bin (6.1 release)
np60.bin (6.0 release)
np53.bin (5.3 release)
np52.bin (5.2 release)
np51.bin (5.1 release)
np50.bin (5.0 release)
np44.bin (4.4 release)
nppix.bin (4.3 and earlier releases)
PIX较老型号带有软驱,新一点的没有了.
这里讲的是无软驱型号的恢复过程. 启动的时候按 ESC 或者 BREAK ,进入 Rom Moniter状态.
然后输入 interface X - X代表端口号
address x.x.x.x - x.x.x.x 代表PIX地址 server x.x.x.y - x.x.x.y 代表TFTP Server地址 file npXY.bin - XY代表版本号 tftp CISCO SYSTEMS PIX FIREWALL
Embedded BIOS Version 4.3.207 01/02/02 16:12:22.73 Compiled by morlee 32 MB RAM PCI Device Table.
Bus Dev Func VendID DevID Class Irq 00 00 00 8086 7192 Host Bridge 00 07 00 8086 7110 ISA Bridge 00 07 01 8086 7111 IDE Controller 00 07 02 8086 7112 Serial Bus 9 00 07 03 8086 7113 PCI Bridge 00 0D 00 8086 1209 Ethernet 11 00 0E 00 8086 1209 Ethernet 10 Cisco Secure PIX Firewall BIOS (4.2) #0: Mon Dec 31 08:34:35 PST 2001
Platform PIX-506E System Flash=E28F640J3 @ 0xfff00000 Use BREAK or ESC to interrupt flash boot.
Use SPACE to begin flash boot immediately. Flash boot interrupted. 0: i8255X @ PCI(bus:0 dev:14 irq:10) 1: i8255X @ PCI(bus:0 dev:13 irq:11) Ethernet auto negotiation timed out.
Ethernet port 1 could not be initialized. Use ? for help. monitor> ? ? this help message address [addr] set IP address of the PIX interface on which the TFTP server resides file [name] set boot file name gateway [addr] set IP gateway help this help message interface [num] select TFTP interface ping <addr> send ICMP echo reload halt and reload system server [addr] set server IP address tftp TFTP download timeout TFTP timeout trace toggle packet tracing monitor> interface 0
0: i8255X @ PCI(bus:0 dev:14 irq:10) 1: i8255X @ PCI(bus:0 dev:13 irq:11) ~两个端口 0 和 1 Using 0: i82557 @ PCI(bus:0 dev:14 irq:10), MAC: 000d.bc7e.d97a
monitor>address 1.1.1.2 address 1.1.1.2 monitor> file np62.bin file np62.bin ~~~~~~~~PIX 6.2 版本的 monitor> ping 1.1.1.1
Sending 5, 100-byte 0x9e5e ICMP Echoes to 1.1.1.1, timeout is 4 seconds: !!!!! Success rate is 100 percent (5/5) monitor> server 1.1.1.1 server 1.1.1.1 monitor> tftp tftp np62.bin@1.1.1.1................................................................................................................................................. Received 73728 bytes Cisco Secure PIX Firewall password tool (3.0) #0: Wed Mar 27 11:02:16 PST 2002
System Flash=E28F640J3 @ 0xfff00000 BIOS Flash=am29f400b @ 0xd8000 Do you wish to erase the passwords? [yn] y
The following lines will be removed from the configuration: enable password mLbCjoY6Ql1vh0o4 encrypted passwd i/Y4R6kWHD6hjJ/v encrypted Do you want to remove the commands listed above from the configuration? [yn] y
Passwords and aaa commands have been erased. Rebooting..
CISCO SYSTEMS PIX FIREWALL Embedded BIOS Version 4.3.207 01/02/02 16:12:22.73 Compiled by morlee 32 MB RAM PCI Device Table.
Bus Dev Func VendID DevID Class Irq 00 00 00 8086 7192 Host Bridge 00 07 00 8086 7110 ISA Bridge 00 07 01 8086 7111 IDE Controller 00 07 02 8086 7112 Serial Bus 9 00 07 03 8086 7113 PCI Bridge 00 0D 00 8086 1209 Ethernet 11 00 0E 00 8086 1209 Ethernet 10 Cisco Secure PIX Firewall BIOS (4.2) #0: Mon Dec 31 08:34:35 PST 2001
Platform PIX-506E System Flash=E28F640J3 @ 0xfff00000 Use BREAK or ESC to interrupt flash boot.
Use SPACE to begin flash boot immediately. Reading 1536512 bytes of image from flash. ################################################################################## 32MB RAM System Flash=E28F640J3 @ 0xfff00000 BIOS Flash=am29f400b @ 0xd8000 mcwa i82559 Ethernet at irq 11 MAC: 000d.bc7e.d97b mcwa i82559 Ethernet at irq 10 MAC: 000d.bc7e.d97a -----------------------------------------------------------------------
|| || || || |||| |||| ..:||||||:..:||||||:.. c i s c o S y s t e m s Private Internet eXchange ----------------------------------------------------------------------- Cisco PIX Firewall Cisco PIX Firewall Version 6.2(2)
~~~~~~ PIX 6.2 Licensed Features: Failover: Disabled VPN-DES: Enabled VPN-3DES: Disabled Maximum Interfaces: 2 Cut-through Proxy: Enabled Guards: Enabled URL-filtering: Enabled Inside Hosts: Unlimited Throughput: Limited IKE peers: Unlimited ****************************** Warning ******************************* Compliance with U.S. Export Laws and Regulations - Encryption. This product performs encryption and is regulated for export by the U.S. Government. This product is not authorized for use by persons located outside the United States and Canada that do not have prior approval from Cisco Systems, Inc. or the U.S. Government. This product may not be exported outside the U.S. and Canada either by physical or electronic means without PRIOR approval of Cisco Systems, Inc. or the U.S. Government. Persons outside the U.S. and Canada may not re-export, resell or transfer this product by either physical or electronic means without prior approval of Cisco Systems, Inc. or the U.S. Government. ******************************* Warning ******************************* Copyright (c) 1996-2002 by Cisco Systems, Inc.
Restricted Rights Legend
Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph (c) of the Commercial Computer Software - Restricted Rights clause at FAR sec. 52.227-19 and subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS sec. 252.227-7013. Cisco Systems, Inc.
170 West Tasman Drive San Jose, California 95134-1706 .
Cryptochecksum(changed): f72dbc0b 3560939d 6544ff4a 70d7e598 Type help or '?' for a list of available commands. pixfirewall> en Password: pixfirewall# 更详细的文档,请参考Cisco文档:
Password Recovery and AAA Configuration Recovery Procedure for the PIX
而ASA的密码恢复过程就更加像路由器了. 同样,启动后按ESC进入Rommon,输入 confreg命令. rommon #1> confreg 然后更改: Current Configuration Register: 0x00000011 Configuration Summary: boot TFTP image, boot default image from Flash on netboot failure Do you wish to change this configuration? y/n [n]: y hostname> enable hostname# copy startup-config running-config hostname# configure terminal hostname(config)# password password hostname(config)# enable password password hostname(config)# username name password password 再把configuration register 改回来. hostname(config)# config-register value 然后存盘. hostname(config)# copy running-config startup-config 请参考cisco文档: Performing Password Recovery for the ASA 5500 Series Adaptive Security Appliance http://www.cisco.com/en/US/docs/security/asa/asa71/configuration/guide/trouble.html#wp1058131
5/12/2007 RR环境下的iBGP等价负载均衡路径问题========phanx.com========= Author: phanx Updated: 2007-5-12 ========================= 这两天被某同事骚扰,协助解决一个RR环境下 iBGP 等价负载均衡的问题.
今天查查文档,用DynaGen做了试验,明白了其中缘由.
拓扑如图所示.
R1和R3都为AS100里面的RR(路由反射体),分别属于cluster 0.0.0.1和0.0.0.3.
R2和R4都是R1和R3的RR客户(Route-reflector-client).
R1,R2,R3,R4之间均为相同类型和带宽的链路. R4下有一个100.0.0.0/24的网段.
问题是,按照理解,R2到达R4的100.0.0.0/24应该存在两条等价路径. ( R2--> R1 --> R4 和 R2--> R3 --> R4 )
但是,通过show ip bgp 100.0.0.0 和 show ip route 100.0.0.0 都只看到了一条路径.
R2#sh ip bgp 100.0.0.0
BGP routing table entry for 100.0.0.0/24, version 5 Paths: (2 available, best #2, table Default-IP-Routing-Table) Multipath: iBGP Not advertised to any peer Local 4.4.4.4 (metric 20) from 1.1.1.1 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, internal, best Originator: 4.4.4.4, Cluster list: 0.0.0.1 Local 4.4.4.4 (metric 20) from 3.3.3.3 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, internal Originator: 4.4.4.4, Cluster list: 0.0.0.3 R2#sh ip route 100.0.0.0
Routing entry for 100.0.0.0/24 Known via "bgp 100", distance 200, metric 0, type internal Last update from 4.4.4.4 00:16:11 ago Routing Descriptor Blocks: * 4.4.4.4, from 1.1.1.1, 00:16:11 ago Route metric is 0, traffic share count is 1 AS Hops 0 如果大家了解BGP,就应该知道,BGP有一系列选择最佳路径的规则,而且默认只使用一条路径.
在这个问题里面, R2上是配置了 bgp maximum-path ibgp 2的,所以只要两条路径的是等价的,
那么就应该可行.
那么为什么会只有一条呢?
其实,我们都被误导了. 要明白这个问题,首先要理解RR.
RR是route reflector 路由反射体,用来减少iBGP中iBGP Peer的连接数的.
在iBGP中,RR只是负责将iBGP Peer通告的路由"反射"给其它的iBGP Peer.
也就是说并不是RR接收iBGP Peer的通告后再通告给别的iBGP Peer,
通告的源是iBGP Peer而不是RR.
再来看看刚才的show ip bgp输出:
R2#sh ip bgp 100.0.0.0
BGP routing table entry for 100.0.0.0/24, version 5 Paths: (2 available, best #2, table Default-IP-Routing-Table) Multipath: iBGP Not advertised to any peer Local 4.4.4.4 (metric 20) from 1.1.1.1 (1.1.1.1) Origin IGP, metric 0, localpref 100, valid, internal, best Originator: 4.4.4.4, Cluster list: 0.0.0.1 Local 4.4.4.4 (metric 20) from 3.3.3.3 (3.3.3.3) Origin IGP, metric 0, localpref 100, valid, internal Originator: 4.4.4.4, Cluster list: 0.0.0.3 这两个条目实际上反映的是同样一条路由,即要到达100.0.0.0/24, 下一条地址是4.4.4.4
这从show ip route的输出也得到了验证.
R2#sh ip route 100.0.0.0
Routing entry for 100.0.0.0/24 Known via "bgp 100", distance 200, metric 0, type internal Last update from 4.4.4.4 00:16:11 ago Routing Descriptor Blocks: * 4.4.4.4, from 1.1.1.1, 00:16:11 ago Route metric is 0, traffic share count is 1 AS Hops 0 那么到底到100.0.0.0/24有几条路呢?
答案是: 两条.
因为从R2到4.4.4.4的话不是直接可达,还需要进行路由的递归查找. 即查找到达4.4.4.4的下一条地址是哪里.
那么,因为R2到R4存在两条同类型同带宽的链路,所以,就会有两条到达4.4.4.4的路径.
R2#sh ip route 4.4.4.4
Routing entry for 4.4.4.4/32 Known via "isis", distance 115, metric 20, type level-2 Redistributing via isis Last update from 10.0.0.17 on FastEthernet0/1, 00:02:03 ago Routing Descriptor Blocks: 10.0.0.17, from 4.4.4.4, via FastEthernet0/1 Route metric is 20, traffic share count is 1 * 10.0.0.1, from 4.4.4.4, via FastEthernet0/0 Route metric is 20, traffic share count is 1 这样,到100.0.0.0/24同样也就得到了两条路径.
实际上,这个负载均衡是通过IGP来实现的. 因为对于iBGP来说只能看到一条路径.
在Cisco IOS实现中,在建立FIB的时候会自动对100.0.0.0/24做递归得到两条路径.
R2#sh ip cef
Prefix Next Hop Interface 100.0.0.0/24 10.0.0.17 FastEthernet0/1 10.0.0.1 FastEthernet0/0 R2#sh ip cef 100.0.0.0
100.0.0.0/24, version 24, epoch 0, per-destination sharing 0 packets, 0 bytes via 4.4.4.4, 0 dependencies, recursive next hop 10.0.0.1, FastEthernet0/0 via 4.4.4.4/32 valid adjacency Recursive load sharing using 4.4.4.4/32. 顺便再说一下.
在这个问题中, 同事另外的问题就是为什么一定是1.1.1.1反射过来的路由成为最佳路径.
那是因为在BGP Best Path Algorithm 中, 最后要比较通告的iBGP Peer的地址大小,
小的优先.
在这个RR的环境下,R2的Peer是R1和R3, 路由通告被RR反射过,上面就会携带RR的信息.
也就是show ip bgp 100.0.0.0中的from 1.1.1.1 (1.1.1.1)和from 3.3.3.3 (3.3.3.3)
括号外面的为建立iBGP Peer的地址, 括号里面为iBGP的router-id.
这样一比,自然1.1.1.1小, 所以也就成为了best path.
这个问题最后给我的启示就是,看问题不要被表面现象迷惑了. 要看到本质. 4/5/2007 连丢两个手机3月中旬丢了我的w810, 今天又把N73丢了.... 老天,我到底做错了什么???
重庆小偷的技术我太pf了. 我手机插了线控耳机, 虽然当时没有放音乐,但是手还放在兜里面的,
都能被偷走, 遇到高手了. 1/19/2007 3750升级IOS后CPU利用率高,并且出现Traceback报错去年记录的一个故障:
========phanx.com=========
Author: phanx Updated: 2006-5-10 ========================= 将3750/3750G从12.1升级IOS到 12.2(25)SEE.
升级完成后发现3750的CPU利用率在80%左右,较高。
并发现大量的报告错误信息如下:
*Mar 1 08:02:04.722: %PLATFORM_UCAST-3-ADJ: Invalid OCE type 33 for fib x.x.x.x/32 Tbl:0
-Traceback= 250D6C 9E1364 9F054C 9F2624 9E5470 9D437C 9D48A4 A566C8 A1D858 A31454 A20ACC A28360 A28470 A764D8 A77A4C AEBD80 更换其它12.2系列IOS为后故障依旧. 后经过配置比较发现故障设备有一句 ip cef accounting per-prefix,去掉后一切恢复正常.
暂时在Cisco 没有查到相关的说明和文档. WS-SUP720 引擎启动直接进入rommon状态的故障以前记录的一个故障: ========phanx.com========= WS-SUP720 引擎启动直接进入rommon状态的故障
相关硬件:
WS-SUP720-3A WS-SUP720-3B WS-SUP720-3BXL 故障现象:
config-register值为正常的 0x2102, IOS 也没有损坏。 但是7609的SUP720-3B引擎启动后直接停留在rommon状态,不引导IOS。 解决方法:
升级 Supervisor Engine 720 的SP(Switch Processor) 的ROMMON Image(Bootstrap)到 8.4(2)
升级方法:
1. 检查当前 SP 的 Bootstrap (示例中为7609双引擎)
Router-7609#sh rom-monitor slot 5 sp
Region F1: INVALID Region F2: INVALID Currently running ROMMON from S (Gold) region Router-7609#sh rom-monitor slot 6 sp Region F1: INVALID Region F2: INVALID Currently running ROMMON from S (Gold) region 2. 升级 SP 的 Bootstrap
Router-7609#upgrade rom-monitor slot 5 sp file tftp://x.x.x.x/c6ksup3-rm2.srec.8.4.2 Copying tftp://x.x.x.x/c6ksup3-rm2.srec.8.4.2 onto SP's bootdisk... Loading c6ksup3-rm2.srec.8.4.2 from 10.178.190.117 (via FastEthernet8/1): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 473563 bytes] Loading c6ksup3-rm2.srec.8.4.2 from 10.178.190.117 (via FastEthernet8/1): !
Oct 19 19:40:05.789 CCT: SP: ROMMON image upgrade in progress Oct 19 19:40:05.789 CCT: SP: Erasing flash Oct 19 19:40:08.572 CCT: SP: Programming flash Oct 19 19:40:10.863 CCT: SP: Verifying new image Oct 19 19:40:10.971 CCT: SP: ROMMON image upgrade complete, Supervisor engine must be reloaded. Router-7609#upgrade rom-monitor slot sp file tftp://x.x.x.x/c6ksup3-rm2.srec.8.4.2
Copying tftp://x.x.x.x/c6ksup3-rm2.srec.8.4.2 onto SP's bootdisk... Loading c6ksup3-rm2.srec.8.4.2 from 10.178.190.117 (via FastEthernet8/1): !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! [OK - 473563 bytes] Loading c6ksup3-rm2.srec.8.4.2 from 10.178.190.117 (via FastEthernet8/1): !
*Oct 19 19:40:29.494 CCT: SP-STDBY: ROMMON image upgrade in progress
*Oct 19 19:40:29.494 CCT: SP-STDBY: Erasing flash *Oct 19 19:40:32.082 CCT: SP-STDBY: Programming flash *Oct 19 19:40:34.006 CCT: SP-STDBY: Verifying new image *Oct 19 19:40:34.110 CCT: SP-STDBY: ROMMON image upgrade complete, Supervisor engine must be reloaded. 3. 确认 SP 的 Bootstrap 和 register 值
Router-7609#sh rom-monitor slot 5 sp Region F1: FIRST_RUN, preferred Region F2: INVALID Currently running ROMMON from S (Gold) region Router-7609#sh rom-monitor slot 6 sp Region F1: FIRST_RUN, preferred Region F2: INVALID Currently running ROMMON from S (Gold) region Router-7609#sh ver
Configuration register is 0x2102 4. 重启 Router-7609#reload Proceed with reload? [confirm]y 5. 重启后确认
Router-7609#sh rom-monitor slot 5 sp
Region F1: APPROVED, preferred Region F2: INVALID Currently running ROMMON from F1 region Router-7609#sh rom-monitor slot 6 sp Region F1: APPROVED, preferred Region F2: INVALID Currently running ROMMON from F1 region 注意事项: 在用upgrade命令升级Bootstrap后,需要使用reload命令重启。 不能使用hw-module module x reset命令进行重启或者进行online insertion and removal (OIR) 操作甚至断电。 必须要reload后用 show rom-monitor slot x sp 命令确认Bootstrap 状态为APPROVED, preferred 相关文档:
1/18/2007 Cisco路由器和交换机的Port-Channel做法区别========phanx.com=========
Author: phanx Updated: 2007-1-18 ========================= 路由器的Route Port以太口要做Port-Channel需要先在路由器上配置
interface Port-ChannelX (X为1-64)
然后才能到相应的端口上配置 channel-group X
这和交换机Switch Port以太口先在相应的端口下配置 channel-group X mode on 后
就会自动出现 interface Port-ChannelX 不同. 2960可以配置多个interface vlan并且都能UPinterface Vlan1
no ip address no ip route-cache shutdown ! interface Vlan100
ip address 1.1.1.1.1 255.0.0.0 no ip route-cache ! interface Vlan200 ip address 2.2.2.2 255.0.0.0 no ip route-cache Switch# show ip int b
Interface IP-Address OK? Method Status Protocol
Vlan1 unassigned YES unset administratively down down Vlan100 1.1.1.1 YES manual up up Vlan200 2.2.2.2 YES manual up up FastEthernet0/1 unassigned YES unset down down FastEthernet0/2 unassigned YES unset down down 到底能配几个UP几个,没试. 4500 引擎上的10/100 MGT 口只能在Rommon模式下使用========phanx.com=========
Author: phanx Updated: 2007-1-18 ========================= 4500 引擎上的10/100 MGT 口只能在Rommon模式下使用.
rommon 1 >unset boot
rommon 2 > set interface fa1 1.1.1.1 255.0.0.0
rommon 3 >boot tftp://1.1.1.2/cat4000-i5k91s-mz.122-25.EWA7.bin
更详细的我也不写了.请参考Cisco的文档吧:
1/11/2007 关于IP Source Guard的部署限制========phanx.com=========
Author: phanx Updated: 2007-1-11 ========================= 最近做一个工程,客户正好要部署 DHCP Snooping + IP Source Guard来防止IP地址盗用.
经过工程实施发现了一些问题. 用户的接入交换机是 2960 ,只支持 DHCP Snooping,不支持 IP Source Guard.
所以,需要在核心/汇聚交换机上去做. 但是发现IOS版本的6500 也是只支持 DHCP Snooping,不支持 IP Source Guard,
IP Source Guard 要在 CatOS 的 6500 才有. 问起为什么低端的45,35都有,65反而没有, 我只能说 65 是定位在核心的高速交换,
像 IP Source Guard 这种功能应该在接入上进行部署,而不是放到核心来做. 最后只能在4500/3560上做. 但是对于接入交换机双线上连核心交换机的情况有点问题.
一般双核心都会启用HSRP/VRRP这类冗余网关. DHCP Snooping 只能在Active网关上侦听 并记录相应的条目, Backup网关上没有任何的记录. 因为IP Source Guard的Binding表 是以 DHCP Snooping 的Binding表为基础形成的,这样, 一旦主用设备宕机,切换到 备用设备上的时候,由于备用设备上没有任何的DHCP Snooping Binding记录,这将导致 所有的用户都无法正常访问, 因为备用设备的 IP Source Guard 的Binding表中没有 任何用户的Binding记录. 还有, DHCP Snooping 的 Binding 表是需要保存的, 可以写到bootflash里面,或者是
tftp服务器上面, tftp要好一些. 因为保存到bootflash里面的话, 会产生很多文件碎片. 在配置Binding表保存到bootflash中的时候, 都会出现Warning提示. 后记:
关于IP Source Guard,另有一文简单介绍了一下 利用IP source guard 防止IP地址盗用
BTW:发现网上转载这两篇挺多的 -_-! 12/5/2006 Cisco IOS 处理 VTP 报文的漏洞以下引用自 NSFocus
Cisco IOS在处理特制VTP报文时存在多个漏洞,具体如下:
1 拒绝服务 如果向Cisco IOS设备发送了VTP version 1摘要帧并将VTP版本字段设置为2的话,VTP处理进程就会陷入循环,最终由系统watchdog进程终止,导致设备重载。 2 VTP修改版本整数回绕 如果攻击者能够向Cisco IOS或CatOS设备发送VTP更新(摘要和sub)的话,就可以自己选择VTP信息的修改版本号。IOS会接受0x7FFFFFFF这个版本号。当运算符更改交换机VLAN配置时,IOS就会将版本号增加为0x80000000,然后由有符整数变量内部追踪这个版本号。因此,这个修改版本号会被处理为很大的负值。从这时起交换机无法同更改的VLAN配置通讯,因为所有其他交换机都会拒绝这个生成的更新, 3 VLAN名称堆溢出 如果攻击者能够向Cisco IOS设备发送VTP更新的话,类型2帧包含有每个VLAN的记录。VTP记录的一个字段中包含有VLAN的名称,另一个字段为这个名称的长度。如果更新的VLAN名称大于100字节且VLAN名称长度字段正确的话,就会导致堆溢出,在接收的交换机上执行任意代码。 <*来源:FX (fx@phenoelit.de)
链接:http://marc.theaimsgroup.com/?l=bugtraq&m=115817075024127&w=2 http://www.cisco.com/warp/public/707/cisco-sr-20060913-vtp.shtml http://secunia.com/advisories/21902/ *> 思科官方的公告:
建议用VTP的改为transparent模式或者升级IOS吧。
相关BUG信息:
11/29/2006 Cisco Press Library0day eBooks
Warning: This is a PRIVATE site. Only use to private research, NOT for Commercial purpose!
思科出版社的电子图书
仅用于个人学习和研究,不得用于商业目的. 4+2条命令将 6500引擎 CatOS 转换为 NativeIOS========phanx.com=========
Author: phanx Updated: 2006-9-21 ========================= 前提,准备好需要使用的Native IOS.
具体方法如下: 插好引擎,开机. 看到如下信息以后 System Bo otstrap, Version 12.2(18r)SX2, RELEASE SOFTWARE (fc1) Technical Sup port: ht tp:/ /w w w.cisco.com/techsup port Copyright (c) 20 04 by cisco Systems, Inc. Cat6k-Sup32 platform with 524288 Kbytes of main memory Autoboot executing command: "boot bootdisk:cat6000-sup32pfc3k9.8-4-5.bin" 一阵猛按 Ctrl + Break 出现 monitor: command "boot" aborted due to user interrupt Exit at the end of BOOT string rommon 1 > 第一条命令 rommon 1 > CONFIG_FILE= 第二条命令 rommon 2 > BOOT=disk0:s3223-advipservicesk9_wan-mz.122-18.SXF5.bin 第三条命令 rommon 3 > sync 第四条命令 rommon 4 > reset Resetting ....... System Bo otstrap, Version 12.2(18r)SX2, RELEASE SOFTWARE (fc1) Technical Sup port: ht tp:/ /w w w.cisco.com/techsup port Copyright (c) 20 04 by cisco Systems, Inc. Cat6k-Sup32 platform with 524288 Kbytes of main memory Autoboot executing command: "boot disk0:s3223-advipservicesk9_wan-mz.122-18.SXF5.bin" Self extracting the image... [OK] Self decompressing the image : #################################################################################################### [OK] Restricted Rights Legend Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c) of the Commercial Computer Software - Restricted Rights clause at FAR sec. 52.227-19 and subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS sec. 252.227-7013. cisco Systems, Inc. 170 West Tasman Drive San Jose, California 95134-1706 Cisco Internetwork Operating System Software IOS (tm) s3223_sp Software (s3223_sp-ADVIPSERVICESK9_WAN-M), Version 12.2(18)SXF5, RELEASE SOFTWARE (fc3) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2006 by cisco Systems, Inc. Compiled Fri 07-Jul-06 21:54 by kellythw Image text-base: 0x4023105C, data-base: 0x4156C000 MAC based EOBC installed 00:00:04: %SYS-3-LOGGER_FLUSHING: System pausing to ensure console debugging output. 00:00:04: %PFREDUN-6-ACTIVE: Initializing as ACTIVE processor 00:00:05: %SYS-SP-3-LOGGER_FLUSHING: System pausing to ensure console debugging output. 00:00:04: %SYS-3-LOGGER_FLUSHED: System was paused for 00:00:00 to ensure console debugging output. 00:00:05: %OIR-SP-6-CONSOLE: Changing console ownership to route processor System Bootstrap, Version 12.2(17r)SX3, RELEASE SOFTWARE (fc1) Technical Sup port: ht tp:/ /w w w.cisco.com/techsup port Copyright (c) 2004 by cisco Systems, Inc. Cat6k-MSFC2A platform with 524288 Kbytes of main memory Download Start ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! Download Completed! Booting the image. Self decompressing the image : ######################################################################################################################################################################################################## [OK] Restricted Rights Legend Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c) of the Commercial Computer Software - Restricted Rights clause at FAR sec. 52.227-19 and subparagraph (c) (1) (ii) of the Rights in Technical Data and Computer Software clause at DFARS sec. 252.227-7013. cisco Systems, Inc. 170 West Tasman Drive San Jose, California 95134-1706 Cisco Internetwork Operating System Software IOS (tm) s3223_rp Software (s3223_rp-ADVIPSERVICESK9_WAN-M), Version 12.2(18)SXF5, RELEASE SOFTWARE (fc3) Technical Support: http://www.cisco.com/techsupport Copyright (c) 1986-2006 by cisco Systems, Inc. Compiled Fri 07-Jul-06 21:54 by kellythw Image text-base: 0x40101040, data-base: 0x42D20000 This product contains cryptographic features and is subject to United States and local country laws governing import, export, transfer and use. Delivery of Cisco cryptographic products does not imply third-party authority to import, export, distribute or use encryption. Importers, exporters, distributors and users are responsible for compliance with U.S. and local country laws. By using this product you agree to comply with applicable laws and regulations. If you are unable to comply with U.S. and local laws, return this product immediately. A summary of U.S. laws governing Cisco cryptographic products may be found at: http://www.cisco.com/wwl/export/crypto/tool/stqrg.html If you require further assistance please contact us by sending email to export@cisco.com. cisco WS-C6509 (R7000) processor (revision 2.0) with 458752K/65536K bytes of memory. Processor board ID SCAXXXXXXXX R7000 CPU at 300Mhz, Implementation 0x27, Rev 3.3, 256KB L2, 1024KB L3 Cache Last reset from power-on SuperLAT software (copyright 1990 by Meridian Technology Corp). X.25 software, Version 3.0.0. Bridging software. TN3270 Emulation software. 1 Virtual Ethernet/IEEE 802.3 interface 48 FastEthernet/IEEE 802.3 interfaces 89 Gigabit Ethernet/IEEE 802.3 interfaces 1915K bytes of non-volatile configuration memory. 65536K bytes of Flash internal SIMM (Sector size 512K). 等启动完成,进入配置模式: Router> Router> en Router# conf t Enter configuration commands, one per line. End with CNTL/Z. 第一条命令: Router(config)# config-register 0x2102 第二条命令: Router(config)# boot system flash disk0:s3223-advipservicesk9_wan-mz.122-18.SXF5.bin 然后退出,保存,重启. 转换完成! Router(config)# end Router#wr Building configuration... [OK] Router# reload Proceed with reload? [confirm]y 00:04:49: %SYS-5-RELOAD: Reload requested by console. Reload Reason: Reload Command. 00:04:52: %SYS-SP-3-LOGGER_FLUSHING: System pausing to ensure console debugging output. 00:04:52: %OIR-SP-6-CONSOLE: Changing console ownership to switch processor 00:04:52: %SYS-SP-3-LOGGER_FLUSHED: System was paus 00:04:55: %SYS-SP-3-LOGGER_FLUSHING: System pausing to ensure console debugging output. *** *** --- SHUTDOWN NOW --- *** 00:04:55: %SYS-SP-5-RELOAD: Reload requested 00:04:55: %OIR-SP-6-CONSOLE: Changing console ownership to switch processor ed for 00:00:00 to ensure console debugging output. 00:04:55: %SYS-SP-3-LOGGER_FLUSHED: System was paused for 00:00:00 to ensure console debugging output. Resetting ....... 注: 实际文件存放位置根据具体情况而定. 推荐放在外置 CF 或者 PCMCIA Flash 卡. 另外,最好把 sup-bootflash: 格式化一下,不然系统会有信息提示你sup-bootflash:的文件系统格式不对. 本方法在 转换过多块 SuperVisor Engine 2 / SuperVisor Engine 32 10/19/2006 PIX Software中的Syslog配置========phanx.com=========
Author: phanx Updated: 2006-10-18 ========================= Syslog默认采用 UDP的514端口。
PIX Software 6.3.x 中支持对 syslog 的协议的定制。
logging host x.x.x.x y/z
其中 x.x.x.x 为 syslog server的IP。 y 为协议号 6是 TCP, 17 是UDP, z 是端口号
也就是说PIX支持TCP方式的Syslog。 但是,需要特别注意的就是,如果采用 TCP Syslog的话一定要确保 syslog server工作正常,如果pix检测到 tcp syslog server异常, 那么pix就会中断现有的流量。 Cisco 配置手册中的原文:
--------------------------------------- Note: Because this traffic is TCP (that is, with acknowledgments), if the PFSS goes down, traffic through the PIX stops. For this reason, the tcp syslog command should not be implemented unless you need this kind of functionality. --------------------------------------- UDP/514 syslogging does not have this effect. --------------------------------------- PFSS - PIX Firewall Syslog Server
今天某一重要用户的PIX 520就出现了这种情况,由于 Syslog服务器被其它的原因弄崩溃了 导致PIX 520中断经过的所有流量。 当时PIX的show logging buffer 中全部是这个日志:
%PIX-3-201008: The PIX is disallowing new connections. Log 解释如下:
Error Message %PIX-3-201008: The PIX is disallowing new connections.
Explanation
This message occurs when you have enabled TCP system log messaging and the syslog server cannot be reached, or when using PIX Firewall Syslog Server (PFSS) and the disk on the Windows NT system is full. Recommended Action
Disable TCP system log messaging. If using PFSS, free up space on the Windows NT system where PFSS resides. Also, make sure that the syslog host is up and you can ping the host from the PIX Firewall console. Then restart TCP system message logging to allow traffic. 所以大家切记,没事别开 TCP Syslog。
6/14/2006 FIFA World CUP四年一度的世界杯终于来了。
熬夜看球ing.....
可惜总有文档写不完!
支持荷兰,支持Van Basten!
球星当然还是巴西的Ronaldinho! 4/16/2006 局域网对付网络执法官之类的ARP欺骗攻击的方法========phanx.com=========
Author: phanx Updated: 2006-4-16 ========================= 今天在studyboy的论坛上逛shusi老师的版看到一位叫julang3同学在讨论对付网络执法官
的ARP欺骗的方法. 我们先来看看他的意见: -------------------------------------------------------------------------------
ARP欺骗攻击的原理是通过快速发送大量伪造的ARP请求或是应答包来修改机器的ARP缓存,
达到欺骗的目的,要对付它,可以从两个方面入手,一是根本就不让这些包发出去, 这是最好的了。二是减慢其发包的速度。 我们知道,攻击包中的源MAC地址必定是一个伪造的MAC地址,一般情况下, 交换机收到这样的包后就会进行地址学习,将其加入到MAC地址表中。 通过配置端口安全,限制了每个端口上的最大MAC地址数目,比如限制为1。
交换机一旦学习到某个MAC地址之后,在这个端口上就会停止学习新的地址, 只到超时后才会学习新的MAC地址.而在超时的时间范围内, 交换机会比较从这个端口收到的帧的源MAC地址和先将学习到的MAC地址,如果不匹配, 这个端口将会被禁用,只到超时才会重新开户.这就极大的减慢了ARP攻击包的发送速度, 当包的发送速度减慢后,也就达不到攻击的效果了。此外交换机一旦学到了新的MAC地址后, 其原来的MAC地址也就丢掉了,攻击者自己就掉线。 所以我认为,这种方法可以有效的阻止ARP攻击。 另外一种解决方法就是限制ARP包的发送速度。将多余的ARP包丢弃掉。
通过适当的调整参数。不会对正常的通信造成影响。 -------------------------------------------------------------------------------
julang3同学分析不错,这个方法的确可以控制这样的ARP欺骗,但是,对于宿舍网这样的环境,
MAC地址不可能为1,因为一个寝室不可能就一台电脑嘛. 假设允许的的MAC为2,那么 网络执法官就可以正常的完成攻击. 因为只用伪造出一个MAC地址来进行IP冲突就行了. (phanx注: 关于网络执法官的具体原理请参考shusi的帖子) julang3同学提出的第二种方法正是下面要讲的方法的其中一个功能.
这里就需要使用Cisco交换机提供的一个特性,叫做 ARP Inspection(ARP检查).
先讲讲 ARP Inspection的原理:
ARP检查可分为DHCP环境下的动态ARP检查和非DHCP环境下的动态ARP检查两种情况。 ARP检查中,将交换机的端口分为两种口,可信任口(trust port)和非可信口(untrust port) 交换机通过检查非信任端口的ARP请求和应答,在它转发ARP包或者更新本地ARP缓存之前
先校验是否是合法的IP-MAC地址配对,并将非法的ARP包丢弃来确保ARP的安全性。 DHCP 环境下的ARP检查通过一个交换机上存放的一个可信任数据库---DHCP侦听绑定数据库
(DHCP snooping binding database)来校验ARP包的合法性。 DHCP侦听绑定数据库是通过在VLAN中开启DHCP Snooping功能后交换机自动建立的。 (phanx注: 关于DHCP Snooping,我在"采用IP source guard技术解决IP地址盗用的方法"一文中有讲到.) 非DHCP环境下的动态ARP检查是根据用户配置的ARP访问控制列表(ACLs)
来进行ARP包的合法性验证。 宿舍网就是一个DHCP环境,那么我们就可以采用DHCP snooping + ARP Inspection 来防止 网络执法官. 启用ARP检查的配置很简单:
Switch(config)# ip arp inspection vlan vlan-range
对于连接三层交换机的口要配置一句 trust. Switch(config-if)# interface GigaEthernet0/0 Switch(config)# ip arp inspection trust 另外,限制ARP包速率用这条命令. ip arp inspection limit {rate pps [burst interval seconds] | none} ARP Inspection还有一个好处就是对网关地址的保护. ----------------------------------------------------------------------------- 通过把交换机的连接用户的端口设为untrust端口,并设置ARP ACLs, 来阻止所有宣告自己为网关地址的MAC的ARP请求和应答, 从而保护了正确的网关IP-MAC地址配对。 对于交换机上联与交换机之间的端口需要设为trust端口允许真正的网关进行ARP请求和应答 |
|||||||||||
|
|