设为首页收藏本站language 语言切换
查看: 5255|回复: 12
收起左侧

Cisco路由器PPPOE拔号 实验 非常实用

[复制链接]
发表于 2011-10-27 11:12:31 | 显示全部楼层 |阅读模式
本帖最后由 Evan1987 于 2011-10-27 11:13 编辑

网络拓扑如图:

                               
登录/注册后可看大图


. server配置如下:

模拟ISP:
Server(config)#vpdn enable
启用vpdn
Server(config)#service dhcp
启用dhcp服务
Server(config)#ip dhcp pool test                           
Server(dhcp-config)#network 1.1.1.0 255.255.255.0
定义地址池test
Server(dhcp-config)#ip dhcp excluded-address 1.1.1.1
保留IP:1.1.1.1
Server(config)#interface virtual-template 1
定义虚拟模板
Server(config-if)#ip address 1.1.1.1 255.255.255.0
Server(config-if)#peer default ip address dhcp-pool test        
应用地址池test.让客户端从test中取IP
Server(config-if)#ppp ipcp dns 1.2.3.4                     
分配给客户端的DNS服务器地址    
Server(config-if)#ppp authentication chap
应用chap认证
Server(config-if)#no shutdown
Server(config-if)#exit
Server(config)#bba-group pppoe global(global名字可以改)
)
Server(config-bba-group)#virtual-template 1
套用虚拟模板1
Server(config-bba-group)#interface e0/0
进入ethernet 0/0
Server(config-if)#pppoe enable group global(对应上面的global)
启用pppoe 并套用group global
Server(config-if)#no shutdown
Server(config-if)#interface e0/1
Server(config-if)#pppoe enable group global
Server(config-if)#no shutdown
Server(config-if)#username user1 password 1111
Server(config-if)#username user2 password 2222
新建两个用户user1user2

. 验证server是否可以让客户端拔入:
windows拔号:

                               
登录/注册后可看大图


                               
登录/注册后可看大图
file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/ksohtml/wps_clip_image-1245.png

                               
登录/注册后可看大图

                               
登录/注册后可看大图

                               
登录/注册后可看大图

                               
登录/注册后可看大图

                               
登录/注册后可看大图




. Cisco拔号:
Router(config)#vpdn enable
Router(config)#interface dialer 1
进入拔号器1
Router(config-if)#encapsulation ppp
封装PPP协议
Router(config-if)#ip add negotiated
启用IP协商
Router(config-if)#ppp authentication chap
Router(config-if)#ppp authentication chap callin
封装chap认证
Router(config-if)#ppp chap hostname user1
输入用户名
Router(config-if)#ppp chap password 1111
输入密码
Router(config-if)#dialer pool 1
Router(config-if)#ip nat outside
确定为nat out
Router(config-if)#no shutdown
Router(config-if)#interface e0/1
Router(config-if)#pppoe-client dial-pool-number 1(对应dialer pool 1)
不知如何说明,望高人指点
Router(config-if)#ip nat inside
Router(config-if)#ip nat inside
确定为nat in
Router(config-if)#no shutdown
Router(config-if)#interface e0/0
Router(config-if)#ip add 192.168.0.254 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#do show ip int b

                               
登录/注册后可看大图

dialer1已经获取到IP:1.1.1.2,说明已经拔号成功
Router(config-if)#exit

. 让内网(192.168.0.0/24)主机可以与外网(1.1.1.0/24)通信
Router(config)#access-list 1 permit 192.168.0.0 0.0.0.255
Router(config)#ip nat inside source list 1 interface dialer1 overload
新建nat使192.168.0.0段主机转换成dialer1的地址出去
Router(config)#do debug ip nat
Debug IP地址转换
Router(config)#ip route 0.0.0.0 0.0.0.0 dia1
新建一个默认路由


模拟内网(192.168.0.0/24)PC
pc(config)#no ip routing
pc(config)#interface e0/0
pc(config)#ip add 192.168.0.1 255.255.255.0
pc(config)#no shutdown
pc(config)#do ping 192.168.0.254
pc(config)#do ping 1.1.1.1
pc(config)#do ping 1.1.1.6(windows拔号后得到的IP.每断开一次会换一个IP,刚刚是1.1.1.3因为我断开了3次)

                               
登录/注册后可看大图



router上查看debug

                               
登录/注册后可看大图


Windows ping serverrouter
  

                               
登录/注册后可看大图


五.查看server和router的配置
      server配置
Server(config-if)#do show run

                               
登录/注册后可看大图



                               
登录/注册后可看大图



                               
登录/注册后可看大图


路由器配置
Router(config-if)#do show run

         

                               
登录/注册后可看大图







                               
登录/注册后可看大图

      
 楼主| 发表于 2011-10-27 11:14:58 | 显示全部楼层
本帖最后由 Evan1987 于 2011-10-27 11:15 编辑

附上英文版命令诠释

Command  Description  
hostname PPPoE-Client
!
Set the router’s name (optional)  
bba-group pppoe global
!
Create a global PPPoE group  
interface FastEthernet0/0
description Inside interface
ip address 10.0.0.5 255.255.255.0
no ip redirects
!
Inside interface configuration  
interface FastEthernet0/1
description PPPoE interface
no ip address
pppoe enable group global
pppoe-client dial-pool-number 1
!
Enable PPPoE in group global on the outside interface. Add the interface into a dialer pool (1) that can be used in Dialer interfaces.  
interface Dialer0
description PPPoE dialer interface
!
Create the dialer interface  
ip address negotiated
!
IP address will be negotiated with the PPPoE server  
ip mtu 1492
!
MTU size has to be reduced on the PPPoE interfaces due to PPPoE framing overhead  
encapsulation ppp
!
Specify the encapsulation type (PPP is required for PPPoE)  
dialer pool 1
!
Associate the dialer interface with a dial pool (configured on the Fast Ethernet interface)  
dialer-group 1
!
Associate the dialer interface with a dial-on-demand group  
ppp authentication chap callout optional
ppp chap hostname test
ppp chap password 0 test
!
PPP will use CHAP authentication with username=test and password=test. Authentication will be used only on outgoing calls, the remote end does not need to authenticate.  
ip route 0.0.0.0 0.0.0.0 Dialer0
!
Static default route points to the PPPoE interface  
dialer-list 1 protocol ip permit
The dialer list object is required to complete the dial-on-demand configuration.  

Server configuration
The server configuration is similar to the client configuration; the major differences are:

A virtual template used for incoming PPPoE requests is configured within the bba-group.
A VirtualTemplate interface is used instead of the Dialer interface.
A local IP address pool is defined for the clients that request an IP address from the server.
Command  Description  
Hostname PPPoE-Client
!
Set the router’s name (optional)  
Username test password 0 test
!
Define the username and password used by the PPPoE client.  
bba-group pppoe global
virtual-template 1
!
Create the global PPPoE group that uses virtual-template 1 for incoming PPPoE requests.  
interface Loopback0
ip address 172.16.0.12 255.255.255.255
!
The Loopback0 interface is used as the source IP address for virtual access interfaces.  
interface FastEthernet0/0
ip address 10.0.0.6 255.255.255.0
pppoe enable group global
!
PPPoE group global is enabled on the FastEthernet interface. Since this group specifies a virtual template for incoming PPPoE sessions, the router becomes a PPPoE server.  
interface Virtual-Template1
ip unnumbered Loopback0
ip mtu 1492
!
Virtual template for incoming PPPoE sessions. The interface is unnumbered and has MTU set to 1492 (see above).  
peer default ip address pool PPPoE
!
The IP addresses for remote PPPoE clients will be taken from the PPPoE address pool  
ppp authentication chap callin
!
Incoming calls use CHAP authentication  
ppp chap refuse callin
!
The PPPoE server refuses to authenticate on incoming calls, preventing potential authentication failures on clients that have not configured a username for the the PPPoE server’s hostname.  
ip local pool PPPoE 172.16.0.20 172.16.0.29

Address pool for PPPoE clients  
沙发 2011-10-27 11:14:58 回复 收起回复
回复 支持 1 反对 0

使用道具 举报

发表于 2011-10-27 11:31:05 | 显示全部楼层
很好,很强大
板凳 2011-10-27 11:31:05 回复 收起回复
回复 支持 1 反对 0

使用道具 举报

 成长值: 60625
发表于 2011-10-27 12:43:34 | 显示全部楼层
确实不错,支持你~
地板 2011-10-27 12:43:34 回复 收起回复
回复 支持 1 反对 0

使用道具 举报

发表于 2011-10-27 12:49:26 | 显示全部楼层
haohaoxuexia   
5# 2011-10-27 12:49:26 回复 收起回复
回复 支持 1 反对 0

使用道具 举报

发表于 2011-10-27 14:52:47 | 显示全部楼层
谢谢 老总
6# 2011-10-27 14:52:47 回复 收起回复
回复 支持 1 反对 0

使用道具 举报

发表于 2012-1-31 14:11:27 | 显示全部楼层
谢谢分享
7# 2012-1-31 14:11:27 回复 收起回复
回复 支持 1 反对 0

使用道具 举报

发表于 2012-6-1 15:21:15 | 显示全部楼层
8# 2012-6-1 15:21:15 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2013-6-8 14:56:35 | 显示全部楼层
楼主真厉害。顶!!!!!!!!!!!!!111
9# 2013-6-8 14:56:35 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2013-6-8 22:06:41 | 显示全部楼层
大神,你太好咯。
10# 2013-6-8 22:06:41 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2013-7-20 00:19:25 | 显示全部楼层
看了LZ的帖子,我只想说一句很好很强大!
11# 2013-7-20 00:19:25 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2014-8-26 15:52:55 | 显示全部楼层
看不到图片
12# 2014-8-26 15:52:55 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-5 22:01 , Processed in 0.060106 second(s), 12 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表