新链接打开留言者网站
分类:折腾日期:2011-07-08 - 10:56:42评论:0条作者:老谢
<!--新窗口弹出留言链接--> <script type="text/javascript"> function externallinks() { if (!document.getElementsByTagName) return; var anchors = document.getElementsByTagName("a"); for (var i=0; i<anchors.length; i++) { var anchor = anchors[i]; if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external nofollow") { anchor.target = "_blank"; } } } window.onload = externallinks; </script> <!--新窗口弹出留言链接_end--> |
PAP验证试验
在R1和R2上做相同的配置
R1(config)#int s 0/0
R1(config-if)#encapsulation ppp
在R1上配置用户名和密码和认证方式
R1(config)#username laoxie password 123
R1(config-if)#ppp authentication pap
被认证方上配置需要发送的密码
R2(config)#int s 0/0
R2(config-if)#ppp pap sent-username laoxie password 123
认证经历两次握手,由被认证方发起请求
——————————————–
CHAP认证试验
R1(config-if)#ppp authentication chap
R1(config-if)#exit
R1(config)#username user1 password 123
R1(config-if)#ppp chap hostname user2
R2(config)#username r2 password 123
R2(config)#int s 0/0
R2(config-if)#ppp chap hostname r1
PS:chap 如果没有指定发送用户名,发送路由器的名称
——————————————–
IP协商
R2(config-if)#ip add negotiated
R2在端口上配置协商模式
R1(config-if)#peer default ip address 192.168.1.10
——————————————–
压缩试验 | 命令如下
ip tcp header-compression //TCP头部压缩
compress stac //数据压缩
show一下效果
R1#show compress
Serial0/0
Software compression enabled
uncompressed bytes xmt/rcv 817/817
compressed bytes xmt/rcv 405/413
Compressed bytes sent: 405 bytes 0 Kbits/sec ratio: 2.017
Compressed bytes recv: 413 bytes 0 Kbits/sec ratio: 1.978
1 min avg ratio xmt/rcv 0.512/0.520
5 min avg ratio xmt/rcv 0.512/0.520
10 min avg ratio xmt/rcv 0.512/0.520
no bufs xmt 0 no bufs rcv 0
resyncs 0
Additional Stac Stats:
Transmit bytes: Uncompressed = 0 Compressed = 405
Received bytes: Compressed = 419 Uncompressed = 0
在Corp配置,因为要求不能访问web服务器,所以要用扩展访问列表,下面开始配置
注意:特权模式密码是cisco
Router>en Password: Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#access-list 100 permit tcp host 192.168.33.4 host 172.22.242.23 eq 80 Router(config)#access-list 100 deny tcp any host 172.22.242.23 eq 80 Router(config)#access-list 100 permit ip any any Router(config)#do show ip int b Interface IP-Address OK? Method Status Protocol FastEthernet0/0 192.168.33.254 YES manual up up FastEthernet0/1 172.22.242.30 YES manual up up Serial1/0 198.18.247.65 YES manual up up Serial1/1 unassigned YES unset administratively down down Serial1/2 unassigned YES unset administratively down down Serial1/3 unassigned YES unset administratively down down Vlan1 unassigned YES unset administratively down down Router(config)#int fa 0/1 Router(config-if)#ip access-group 100 out Router(config-if)#end Router# %SYS-5-CONFIG_I: Configured from console by console Router# Router#copy run start Destination filename [startup-config]? Building configuration... [OK] Router# Router# |
测试一下ACL是否正常,最后记得保存,一定要保存
最后发泄一句:尼玛的ACL,尼玛的OSPF,尼玛的EIGRP,尼玛的cisco,尼玛的英文考卷,尼玛的….题库看的抓狂….
首先说一点吧,犯了一个很白痴的错误,刚搭好拓扑,R1无法与内网通信,老谢居然在R1上做了条默认路由
NAT的作用就是把内网IP转换成外网IP,我这样一来试验没有一点效果,而且在真实环境中,ISP不可能收到私网地址
PC0 IP:192.168.1.2
PC1 IP:192.168.1.3
静态NAT
R2(config)#ip nat inside source static 192.168.1.2 200.200.200.1 R2(config)#int fa0/0 R2(config-if)#ip nat inside R2(config-if)#ip nat outside R2(config-if)#end |
动态NAT
注意:静态NAT配置clear不掉,必须no掉配置
步骤:定义ACL允许访问外网的地址、定义合法地址池、实现转换
R2(config)#access-list 1 permit 192.168.1.0 255.255.255.0 /*定义ACL*/ R2(config)#ip nat pool laoxie 200.200.200.1 200.200.200.1 netmask 255.255.255.0 /*pool名称laoxie后面为范围*/ R2(config)#ip nat inside source list 1 pool laoxie /*定义NAT使用list1的ACL和laoxie的pool*/ R2(config)#end |
PAT
R2(config)#access-list 1 permit 192.168.1.0 0.0.0.255 R2(config)#ip nat pool laoxie 200.200.200.1 200.200.200.1 netmask 255.255.255.0 R2(config)#ip nat inside source list 1 pool laoxie overload |
DZ x2.0伪静态规则 apache
分类:网站技术日期:2011-07-01 - 13:12:18评论:9条作者:老谢
# 将 RewriteEngine 模式打开 RewriteEngine On # 修改以下语句中的 /discuz 为你的论坛目录地址,如果程序放在根目录中,请将 /discuz 修改为 / RewriteBase / # Rewrite 系统规则请勿修改 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^topic-(.+)\.html$ portal.php?mod=topic&topic=$1&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^article-([0-9]+)-([0-9]+)\.html$ portal.php?mod=view&aid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^forum-(\w+)-([0-9]+)\.html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ forum.php?mod=viewthread&tid=$1&extra=page\%3D$3&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^group-([0-9]+)-([0-9]+)\.html$ forum.php?mod=group&fid=$1&page=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^space-(username|uid)-(.+)\.html$ home.php?mod=space&$1=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^blog-([0-9]+)-([0-9]+)\.html$ home.php?mod=space&uid=$1&do=blog&id=$2&%1 RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^archiver/(fid|tid)-([0-9]+)\.html$ archiver/index.php?action=$1&value=$2&%1 |
依旧是哥很雷人的拓扑
一、RIP是什么
RIP(Routing Information Protocols,路由信息协议)是使用最广泛的距离向量协议,它是由施乐(Xerox)在70年代开发的。当时,RIP是XNS(Xerox Network Service,施乐网络服务)协议簇的一部分。TCP/IP版本的RIP是施乐协议的改进版。RIP最大的特点是,无论实现原理还是配置方法,都非常简单。
度量方法
RIP的度量是基于跳数(hops count)的,每经过一台路由器,路径的跳数加一。如此一来,跳数越多,路径就越长,RIP算法会优先选择跳数少的路径。RIP支持的最大跳数是15,跳数为16的网络被认为不可达。
路由更新
RIP中路由的更新是通过定时广播实现的。缺省情况下,路由器每隔30秒向与它相连的网络广播自己的路由表,接到广播的路由器将收到的信息添加至自身的路由表中。每个路由器都如此广播,最终网络上所有的路由器都会得知全部的路由信息。正常情况下,每30秒路由器就可以收到一次路由信息确认,如果经过180秒,即6个更新周期,一个路由项都没有得到确认,路由器就认为它已失效了。如果经过240秒,即8个更新周期,路由项仍没有得到确认,它就被从路由表中删除。上面的30秒,180秒和240秒的延时都是由计时器控制的,它们分别是更新计时器(Update Timer)、无效计时器(Invalid Timer)和刷新计时器(Flush Timer)。
路由循环
距离向量类的算法容易产生路由循环,RIP是距离向量算法的一种,所以它也不例外。如果网络上有路由循环,信息就会循环传递,永远不能到达目的地。为了避免这个问题,RIP等距离向量算法实现了下面4个机制。
水平分割(split horizon)。水平分割保证路由器记住每一条路由信息的来源,并且不在收到这条信息的端口上再次发送它。这是保证不产生路由循环的最基本措施。
————————————————
基础实验:
R1上配置:
R1(config)#int s 0/0 R1(config-if)#ip add 192.168.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#router rip R1(config-router)#network 192.168.1.0 |
R2上配置:
R2(config)#int s 0/0 R2(config-if)#ip add 192.168.1.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#int s 0/01 Serial0/0, changed state to up R2(config-if)#int s 0/1 R2(config-if)#ip add 192.168.2.1 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#R2 rip R2(config-R2)#Serial0/1, changed state to up R2(config-R2)#net 192.168.1.0 R2(config-R2)#net 192.168.2.0 R2(config-R2)#end |
R3上配置:
R3(config)#int s 0/1 R3(config-if)#ip add 192.168.2.2 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#R3 rip R3(config-R3)# Serial0/1, changed state to up R3(config-R3)#net 192.168.2.0 R3(config-R3)#end |
最后用ping检查连通性,基础实验结束
6.27补充部分
被动接口 passive-interface 0/0 只接收rip更新,但不发送更新 --------------------------------------- rip v1和rip v2兼容性试验 no auto-summary 运行v2要关闭自动汇总 否则在边界自动汇总成有类 ip rip reveive version 1 2 同时支持v1和v2 |
RIP的防环机制
1.定义最大跳数 Maximum Hop Count (15跳)
2.水平分割 Split Horizon (默认所有接口开启,除了Frame-Relay的物理接口,可用sh ip interface 查看开启还是关闭)
3.毒化路由 Poizoned Route
4.毒性反转 Poison Reverse (RIP基于UDP,UDP和IP都不可靠,不知道对方收到毒化路由没有;类似于对毒化路由的Ack机制)
5.保持计时器 hold-down Timer (防止路由表频繁翻动)
6.闪式更新 Flash Update
7.触发更新 Triggered Update (需手工启动,且两边都要开 Router (config-if)# ip rip triggered )
当启用触发更新后,RIP不再遵循30s的周期性更新时间,这也是与闪式更新的区别所在。
RIP的4个计时器:
( 一个“└┘”代表30s)
更新计时器(update): └┘30
无效计时器(invalid):└┴┴┴┴┴┘180 (180s没收到更新,则置为possible down状态)
保持计时器(holddown): └┴╋┴┴┴┴┘180 (真正起作用的只有60s)
刷新计时器(flush): └┴┴┴┴┴┴┴┘ 240 (240s没收到更新,则删除这条路由)
如果路由变成possible down后,这条路由跳数将变成16跳,标记为不可达;这时holddown计时器开始计时。
在holddown时间内即使收到更优的路由,不加入路由表;这样做是为了防止路由频繁翻动。
什么时候启用holddown计时器: “当收到一条路由更新的跳数大于路由表中已记录的该条路由的跳数”
首先感谢@蓝色轨迹
教程非常简单,我在这里也发一篇教程,凑一个博文吧
首先下载到需要使用到的文件,然后上传到根目录下某个目录
然后去box.net注册一个ID,注册过程很简单,不废话了
重点来了,在box.net建一个文件夹,并获取分享链接
蓝色轨迹的文件名好像是中文,使用正常,我尝试几次中文名获取不到文件,最后换成英文名解决了问题
然后修改index.html文件,其他的不需要做任何改动
把链接换成获取到的分享链接即可,后面的文字换成你需要的文件夹名
ok,万事大吉了
补充:页面的框架调用代码
<iframe src="网盘绝对路径/index.html" height="1000px" width="650px" style="overflow:hidden" frameborder="0"></iframe> |
静态路由&默认路由试验笔记
分类:思科技术日期:2011-06-23 - 21:10:40评论:9条作者:老谢
R1:192.168.1.1 255.255.255.0 fa 0/0
R2:192.168.2.1 255.255.255.0 fa 0/0
R2:192.168.3.1 255.255.255.0 fa 1/0
R3:192.168.4.1 255.255.255.0 fa 0/0
R1(config)#ip route 192.168.2.0 255.255.255.0 fastEthernet 0/0 R1(config)#ip route 192.168.3.0 255.255.255.0 fastEthernet 0/0 R1(config)#ip route 192.168.4.0 255.255.255.0 fastEthernet 0/0 R2(config)#ip route 192.168.1.0 255.255.255.0 fastEthernet 0/0 R2(config)#ip route 192.168.4.0 255.255.255.0 fastEthernet 1/0 R3(config)#ip route 192.168.3.0 255.255.255.0 fastEthernet 0/0 R3(config)#ip route 192.168.1.0 255.255.255.0 fastEthernet 0/0 R3(config)#ip route 192.168.2.0 255.255.255.0 fastEthernet 0/0 |
此时R1 ping 192.168.2.1、192.168.3.1、192.168.4.1,均可正常通信
删除R1和R2上的静态路由,配置默认路由
R1(config)#ip route 0.0.0.0 0.0.0.0 fastEthernet 0/0 R3(config)#ip route 0.0.0.0 0.0.0.0 fastEthernet 0/0 |
此时R1 ping 192.168.2.1、192.168.3.1、192.168.4.1,此时也均可正常通信
最新评论
大峰:电车起步超级快,我油车反正是跟不上,...
Mr.Chou:电车高速上真120和油车120真的有区...
Mr.Chou:18 19年入手的房子现在死的心都有了...
老何:不至于跌得这么狠吧
Andy烧麦:这些大厂都能提供必要的售后
王光卫博客:小米生态还是比较丰富
空空裤兜:在天猫买的利维斯顿,阿里智能APP...
林羽凡:我突然发现,你也记录了很多博文了。
菊座:小米的东西还行
zwwooooo:一般电器产品都jd,就是想售后身心