1、网络拓扑图
2、详细配置步骤
2.1 PPPOE server配置
1)配置地址池
ip pool dhcpclient
network 100.1.1.0 mask 255.255.255.0
gateway 100.1.1.1
lease day 100
2)创建模板
int virtual-template 1 //可以创建模板数量1-1023
3)模板VT与地址池关联
int virtual-template 1
ip add 100.1.1.1 255.255.255.0
remote address pool dhcpclient // 终端获得地址的地址池
4)认证与VT绑定
aaa
local-user yhs password cipher huawei123
local-user yhs service-type PPP HTTP SSH //创建用户可以完成以上服务
local-user yhs privilege level 15 //设置访问等级0-15级
注意:
0级,参观级:网络诊断工具命令(ping、tracert)、从本设备出发访问外部设备的命令(Telnet客户端)等。
1级,监控级:用于系统维护,包括display等命令。
2级,配置级:业务配置命令,包括路由、各个网络层次的命令,向用户提供直接网络服务。
3级,管理级:用于系统基本运行的命令,对业务提供支撑作用,包括文件系统、FTP、TFTP、Xmodem下载、配置文件切换命令、备板控制命令、用户管理命令、命令级别设置命令、系统内部参数设置命令;用于业务故障诊断的debugging命令等。
int virtual-template 1
ppp authentication-mode pap //可以进行一下认证模式pap、chap
5)关联物理接口与VT(绑定虚拟模板)
int g0/0/0
pppoe-server bind virtual-template 1
2.2 PPPOE-CLIENT配置
1)创建虚拟接口:创建虚拟接口,并使用对端PPPOE服务器分配的IP地址
int dialer 1
ip address ppp-negotiate
启动DCC(Dial Control Center拨号控制中心):旨在使一个物理接口能够服务于多个Dialer接口,并指定对端用户名
dialer user yhs //对端的用户名为yhs
指定规则
dialer-group 1 //这个可以没有,通过访问控制列表+nat实现
指定捆绑号
dialer bundle 1//每个Dialer接口只能使用一个Dialer bundle
2)配置客户验证
ppp pap local-user yhs password cipher %$%$d{_1F0-j(I~~0yF"ljWQ,#ON%$%$
3)物理接口绑定dialer bundle 1
int g0/0/0
pppoe-client dial-bundle-number 1
4)在客户端配置acl
acl number 2000
rule 5 permit source any
5)NAT配置
int dialer 1
nat outbound 2000
6)配置默认路由
ip route-static 0.0.0.0 0 dialer 0
3、具体配置
R1:
[r1]display current-configuration
[V200R003C00]
#
sysname r1
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
dhcp enable
#
ip pool dhcpr2
gateway-list 100.1.1.1
network 100.1.1.0 mask 255.255.255.0
lease day 100 hour 0 minute 0
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user yhs password cipher %$%$%>8C7K!MkD\T!>>e9L,D<nY\%$%$
local-user yhs privilege level 15
local-user yhs service-type ssh ppp http
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface Virtual-Template1
ppp authentication-mode pap
remote address pool dhcpr2
ip address 100.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/0
pppoe-server bind Virtual-Template 1
#
interface GigabitEthernet0/0/1
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
[r1]
R2:
[r2]display current-configuration
[V200R003C00]
#
sysname r2
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
acl number 2000
rule 5 permit
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password cipher %$%$K8m.Nt84DZ}e#<0`8bmE3Uw}%$%$
local-user admin service-type http
#
firewall zone Local
priority 15
#
interface Dialer1
link-protocol ppp
ppp pap local-user yhs password cipher %$%$d{_1F0-j(I~~0yF"ljWQ,#ON%$%$
ip address ppp-negotiate
dialer user yhs
dialer bundle 1
nat outbound 2000
#
interface GigabitEthernet0/0/0
ip address 10.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
pppoe-client dial-bundle-number 1
mtu 1492
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
ip route-static 0.0.0.0 0.0.0.0 Dialer1
#
user-interface con 0
authentication-mode password
idle-timeout 0 0
user-interface vty 0 4
user-interface vty 16 20
#
wlan ac
#
return
[r2]