注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 获取当前页面路径,实现权..
 帮助

©:局域网通过PPP协议连接到Internet


2007-11-19 08:47:05
 标签:Internet PPP协议   [推送到技术圈]

版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://mengx.blog.51cto.com/157987/51100
设备及拓扑,如图所示:
   1:使得PC1可以访问Internet,PC2禁止访问Inernet..
   2:使Internet外的PC3能与局域网内部访问.
配置步骤:
PC1: 192.168.1.2/24  gw:192.168.1.1
PC2: 192.168.1.3/24  gw:192.168.1.1
PC3: 192.168.0.2/24  gw:192.168.0.1
R1:
Router>
Router>en
Router#confi t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#host  R1
R1(config)#username  R2  password  cisco
R1(config)#access-list 1 deny 192.168.1.3 0.0.0.0 
R1(config)#int s0
R1(config-if)#ip add 10.0.0.1 255.255.255.0
R1(config-if)#encap ppp
R1(config-if)#ppp auth chap
R1(config-if)#clock rate 6400
R1(config-if)#ip access 1 in
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#route rip
R1(config-router)#ip route 192.168.0.0 255.255.255.0 10.0.0.2
R1(config)#int e0
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#end
R1#
R2:
Router>
Router>en
Router#con t
Router(config)#ho R2
R2(config)#username R1 password cisco
R2(config)#int s0
R2(config-if)#ppp auth chap
R2(config-if)#encap ppp
R2(config-if)#clock rate 6400
R2(config-if)#ip add 10.0.0.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#end
R2#ping 10.0.0.1
Sending 5, 100-byte ICMP Echos to 10.0.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
R2#config t
R2(config)#int e0
R2(config-if)#ip add 192.168.0.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#route rip
R2(config-router)#ip route 192.168.1.0 255.255.255.0 10.0.0.1
R2(config)#end
运行结果:
PC1->PC3:
C:>ping 192.168.0.2
Pinging 192.168.0.1 with 32 bytes of data:
Reply from 192.168.0.1: bytes=32 time=60ms TTL=241
Reply from 192.168.0.1: bytes=32 time=60ms TTL=241
Reply from 192.168.0.1: bytes=32 time=60ms TTL=241
Reply from 192.168.0.1: bytes=32 time=60ms TTL=241
Reply from 192.168.0.1: bytes=32 time=60ms TTL=241
PC2->PC3:
C:>pin 192.168.0.2
Pinging 192.168.0.2 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.

本文出自 “成就梦想的快乐” 博客,请务必保留此出处http://mengx.blog.51cto.com/157987/51100





    文章评论
 
2007-11-19 22:48:42
图片没有显示出来哎

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: