【实验】PPPoE

【实验】PPPoE
【实验】PPPoE

实验环境:

操作系统:Mac OS X 10.11.5 beta 3(当时最新测试版),模拟器:GNS3 for Mac 1.4.6(当时最新版本)
注:本实验需要使用 12.4 的 IOS 镜像才可以进行实验,新版的 IOS 15.4 已经删除了 “ protocol pppoe ” 这条命令。

实验需求:

GW 通过 PPPoE 拨号上网;PC1 能访问互联网( Google :8.8.8.8 ,Baidu :61.1.1.1 )。

实验步骤:

GW :

!1、vpdn 虚拟线路启用

en
conf t

vpdn enable

vpdn-group PPPoE
request-dialin
protocol pppoe

!2、物理口开启

interface FastEthernet0/1
pppoe enable
pppoe-client dial-pool-number 1
no shutdown

!3、创建虚拟拨号口

interface Dialer1
ip address dhcp
encapsulation ppp
dialer pool 1
ppp chap hostname HTPC
ppp chap password 0 HTPC

!4、给内网做 DHCP

int e 4/0
ip add 192.168.1.254 255.255.255.0
no sh

ip dhcp pool PC
network 192.168.1.0 255.255.255.0
default-router 192.168.1.254
dns-server 114.114.114.114

!5、给内网做 PAT

access-list 1 per any
ip nat inside source list 1 interface dialer 1 overload

int e 4/0
ip nat inside

int dial 1
ip nat outside

ISP-DSLAM :

en
conf t

int l 1
ip add 8.8.8.8 255.255.255.255

int l 2
ip add 61.1.1.1 255.255.255.255

!1、vpdn 虚拟线路启用

vpdn enable

vpdn-group PPPoE
accept-dialin
protocol pppoe

bba-group pppoe global
virtual-template 1

!2、物理口开启

interface FastEthernet0/1
pppoe enable
no shutdown

!3、建立虚拟接收终端口

interface Virtual-Template1
ip address 59.1.1.2 255.255.255.252
en ppp
ppp authentication chap
no sh

!4、创建 PPP 验证的用户名和密码

username HTPC password HTPC

!5、使用 DHCP 分配 IP 地址

ip dhcp pool ADSL
network 59.1.1.0 255.255.255.252
default-router 59.1.1.2
dns-server 114.114.114.114
lease 3

测试:

Welcome to Virtual PC Simulator, version 0.8c
Dedicated to Daling.
Build time: Feb 25 2016 00:35:23
Copyright (c) 2007-2015, Paul Meng (mirnshi@gmail.com)
All rights reserved.VPCS is free software, distributed under the terms of the 
"BSD" licence.
Source code and license can be found at vpcs.sf.net.
For more information, please visit wiki.freecode.com.cn.Press '?' to get help.

VPCS> show ip

NAME : VPCS[1]
 IP/MASK : 0.0.0.0/0
 GATEWAY : 0.0.0.0
 DNS :
 MAC : 00:50:79:66:68:00
 LPORT : 10001
 RHOST:PORT : 192.168.69.1:10002
 MTU : 1500

VPCS> ip dhcp ?

ip dhcp [OPTION]
Attempt to obtain IPv4 address, mask, gateway and DNS via DHCP
OPTION:
-d Show DHCP packet decode
-r Renew DHCP lease
-x Release DHCP lease

VPCS> ip dhcp -r
 DORA IP 192.168.1.1/24 GW 192.168.1.254

VPCS> show ip

NAME : VPCS[1]
IP/MASK : 192.168.1.1/24
 GATEWAY : 192.168.1.254
 DNS : 114.114.114.114
DHCP SERVER : 192.168.1.254
DHCP LEASE : 86398, 86400/43200/75600
MAC : 00:50:79:66:68:00
LPORT : 10001
RHOST:PORT : 192.168.69.1:10002
MTU : 1500

VPCS> p 192.168.1.254

 84 bytes from 192.168.1.254 icmp_seq=1 ttl=255 time=15.258 ms
 84 bytes from 192.168.1.254 icmp_seq=2 ttl=255 time=7.105 ms
 84 bytes from 192.168.1.254 icmp_seq=3 ttl=255 time=9.511 ms
 84 bytes from 192.168.1.254 icmp_seq=4 ttl=255 time=9.907 ms
 84 bytes from 192.168.1.254 icmp_seq=5 ttl=255 time=10.895 ms

VPCS> p 8.8.8.8

 84 bytes from 8.8.8.8 icmp_seq=1 ttl=254 time=29.187 ms
 84 bytes from 8.8.8.8 icmp_seq=2 ttl=254 time=14.659 ms
 84 bytes from 8.8.8.8 icmp_seq=3 ttl=254 time=35.580 ms
 84 bytes from 8.8.8.8 icmp_seq=4 ttl=254 time=17.853 ms
 84 bytes from 8.8.8.8 icmp_seq=5 ttl=254 time=21.825 ms
打赏作者
这里是 “ CCIE 工程师社区 ” 官方的捐款通道,您是否可以考虑请我们喝杯咖啡呢?

您的支持将鼓励我们继续创作!

[微信] 扫描二维码打赏

[支付宝] 扫描二维码打赏

Was this article helpful?

Related Articles

Leave A Comment?

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据