您的位置:首页 > 其它

【思科珍藏】PPPoE实验(模拟小区用户拨号上网)

2014-09-22 19:00 295 查看
实验拓扑:



像以前做的大部分实验,都是以大客户或者数据中心的形式,直接拉一根网线,配好网线就能上网。但是在现实生活中,大部分用户(比如小区)都是采用拨号上网的形式,通过验证用户账号及密码的方式上网,这样也方便运营商区分不同用户的业务类型以及计费方式。
如图,将在C1与R1之间通过拨号的方式上网(而非通过配置网关的方式)。
首先进行基本配置

R1#conf t
R1(config-if)#int f0/0
R1(config-if)#ip add 12.0.0.1 255.255.255.252
R1(config-if)#no sh
R1(config-if)#ex
R1(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.2

R2#conf t
R2(config)#int f0/0
R2(config-if)#ip add 12.0.0.2 255.255.255.252
R2(config-if)#no sh
R2(config-if)#int f0/1
R2(config-if)#ip add 192.168.90.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#ex
R2(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.1

R3#conf t
R3(config)#no ip routing

2.进行PPPoE配置

PPPoE有2种身份验证方式,一种是本地验证(在R1上验证),第二种是运用专门的验证服务器验证(在C2上验证)
C1我绑定的网卡的是V1网卡,用真机来模拟,而C2我用一台模拟机来模拟。

(1)首先进行本地验证的演示
在R1上配置
R1(config)#vpdn enable //开启虚拟拨号功能
R1(config)#bba-group pppoe global
R1(config-bba-group)#virtual-template 1 //绑定虚模板
R1(config-bba-group)#sessions max limit 200 //最大允许的会话数
R1(config-bba-group)#ex

R1(config)#ip dhcp pool pppoe //建立地址池
R1(dhcp-config)#network 112.1.1.0 255.255.255.0
R1(dhcp-config)#dns-server 1.1.1.1

R1(dhcp-config)#int f0/1
R1(config-if)#pppoe enable group global //开启接口下pppoe
R1(config-if)#no sh

R1(config-if)#interface Virtual-Template1
R1(config-if)# ip address 112.1.1.1 255.255.255.0 //设置BARS下行口IP地址
R1(config-if)# peer default ip address dhcp-pool pppoe
R1(config-if)#ppp authentication pap //使用PAP方式验证
R1(config-if)#username test pass abc123 //用户名、密码
R1(config)#end

这样就配置完成了,这里我配置的用户名为test ,密码为abc123
直接用宽带连接就可以拨号登录了。



R1上show ip route
R1#show ip route
.....

112.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 112.1.1.0/24 is directly connected, Virtual-Access1.1
C 112.1.1.2/32 is directly connected, Virtual-Access1.1
12.0.0.0/30 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 12.0.0.2
可以发现有一个32位的IP地址已经分配出去了,即V1网卡的地址。

(2)服务器身份验证

由于路由器的资源有限,现网中很少用本地验证的方式,去承载大量的拨号用户名及密码的匹配条目,而是采用专门的服务器去做身份验证。
这里我用C2作为服务器,首先对C2的网卡参数进行配置。



网关设为R2的f0/1口,首先在R1上测试一下连通性
R1(config)#do ping 192.168.90.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.90.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 36/52/60 ms
没问题。
下面需要应用一款很实用的小软件WinRadius




将WinRadius共享进虚拟机C2,进行一些配置
设置——数据库,设为自动配置。





操作——添加账号,新建jack用户,密码abc123,还可以修改预付金额、形式等。





设置——多重秘钥,设置IP为R1的f0/0口地址、密码。




还可以对设置里的认证方式、计费方式进行设置。

下面,对R1进行配置,在本地验证的基础上

R1(config)#vpdn enable //开启虚拟拨号功能R1(config)#bba-group pppoe globalR1(config-bba-group)#virtual-template 1 //绑定虚模板R1(config-bba-group)#sessions max limit 200 //最大允许的会话数R1(config-bba-group)#ex

R1(config)#aaa new-model //3a认证
R1(config)#!
R1(config)#!
R1(config)#aaa group server radius radius-groups //设置使用服务器验证
R1(config-sg-radius)# server 192.168.90.11 auth-port 1812 acct-port 1813

R1(config-sg-radius)#aaa authentication ppp test group radius group radius-groups
R1(config)#aaa accounting network test start-stop group radius group radius-groups

R1(config)#radius-server host 192.168.90.11 auth-port 1812 acct-port 1813 key abc123
//绑定服务器的IP地址、端口和密码

R1(config)#interface Virtual-Template1
R1(config-if)# ip address 112.1.1.1 255.255.255.0
R1(config-if)# peer default ip address dhcp-pool pppoe
R1(config-if)#no ppp authentication pap //去掉刚才配置的PAP

R1(config-if)#ppp authentication pap chap test //使用PAP、CHAP方式验证
R1(config-if)#ppp accounting test

R1(config-if)#int f0/1
R1(config-if)#pppoe enable group global
R1(config-if)# no shut
R1(config-if)#end
这样,就设置好了。
可以进行拨号登录了,用户名jack,密码abc123



R1#show ip route
.....
112.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 112.1.1.0/24 is directly connected, Virtual-Access1.1
C 112.1.1.3/32 is directly connected, Virtual-Access1.1
12.0.0.0/30 is subnetted, 1 subnets
C 12.0.0.0 is directly connected, FastEthernet0/0
S* 0.0.0.0/0 [1/0] via 12.0.0.2
又分配出去一个32位的IP地址 112.1.1.3

同时WinRadius上也有相应的登录成功日志了



实验完毕。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  PPPoE