PPPoE配置
思科:
R1連線R2
R1是客戶端,R2是伺服器端
R2
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R2
R2(config)#vpdn enable(開啟虛擬撥號的功能)
R2(config)#interface ethernet 0/0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#username admin password cisco
R2(config)#service dhcp (建立一個撥號分發的地址池)
R2(config)#ip dhcp pool client
R2(dhcp-config)#network 100.1.1.0 255.255.255.0
R2(dhcp-config)#default-router 100.1.1.254
R2(dhcp-config)#dns-server 114.114.114.114
R2(dhcp-config)#domain-name cisco.com
R2(dhcp-config)#exit
R2(config)#Interface virtual-template 1(客戶端撥號的模板)
R2(config-if)#encapsulation ppp(PPP的封裝)
R2(config-if)#ppp authentication chap (用chap做認證)
R2(config-if)#peer default ip address dhcp-pool client
R2(config-if)#ip mtu 1492(建議把報文改為1492,PPPoE會有8位元組的開銷)
R2(config-if)#no shutdown
R2(config-if)#ip address 100.1.1.254 255.255.255.0
R2(config-if)#exit
R2(config)#bba-group pppoe global (使用的組)
R2(config-bba-group)#virtual-template 1
R2(config-bba-group)#exit
R2(config)#interface ethernet 0/0
R2(config-if)#pppoe enable group global
R2(config-if)#end
R1:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#vpdn enable
R1(config)#interface dialer 1
R1(config-if)#dialer pool 100(設定撥號池)
R1(config-if)#encapsulation ppp
R1(config-if)#ppp chap hostname admin
R1(config-if)#ppp chap password cisco
R1(config-if)#ip address negotiated (撥號後請求地址)
R1(config-if)#ppp ipcp route default (當DHCP獲取的東西沒閘道器,會指定一條預設閘道器)
R1(config-if)#ip mtu 1492(mtu的大小)
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface ethernet 0/0
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config-if)#pppoe-client dial-pool-number 100(指定撥號的地址池)
R1(config-if)#exit
R1(config)#
檢視是否獲取IP
R1#show ip interface b
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset up up
Ethernet0/1 unassigned YES unset administratively down down
Ethernet0/2 unassigned YES unset administratively down down
Ethernet0/3 unassigned YES unset administratively down down
Dialer1 100.1.1.1 YES IPCP up up
Virtual-Access1 unassigned YES unset up up
R1#
R1#show running-config interface dialer 1
Building configuration...
Current configuration : 173 bytes
!
interface Dialer1
ip address negotiated
ip mtu 1492
encapsulation ppp
dialer pool 100
ppp chap hostname admin
ppp chap password 0 cisco
ppp ipcp route default
end
華為:
PPPoE伺服器配置:
R2:
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR2
[AR2]ip pool pool1
Info: It's successful to create an IP address pool.
[AR2-ip-pool-pool1]network 119.84.111.0 mask 255.255.255.0
[AR2-ip-pool-pool1]gateway-list 119.84.111.254
[AR2-ip-pool-pool1]quit
[AR2]interface Virtual-Template 1
Mar 11 2018 13:32:49-08:00 AR2 %%01IFPDT/4/IF_STATE(l)[1]:Interface Virtual-Temp
late1 has turned into UP state.
[AR2-Virtual-Template1]ppp au
[AR2-Virtual-Template1]ppp authentication-mode chap
[AR2-Virtual-Template1]ip address 119.84.111.254 255.255.255.0
[AR2-Virtual-Template1]remote address pool pool1
[AR2-Virtual-Template1]quit
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]pppoe-server bind virtual-template 1 (繫結虛擬模板)
[AR2-GigabitEthernet0/0/0]quit
[AR2]aaa
[AR2-aaa]local-user huawei1 password cipher huawei123
Info: Add a new user.
[AR2-aaa]local-user huawei1 service-type ppp
[AR2-aaa]local-user huawei2 password cipher huawei123
Info: Add a new user.
[AR2-aaa]local-user huawei2 service-type ppp
[AR2-aaa]quit
[AR2]
R1&R3:
[AR1]dialer-rule
[AR1-dialer-rule]dialer-rule 1 ip permit
[AR1-dialer-rule]quit
[AR1]interface Dialer 1
Mar 11 2018 13:39:45-08:00 AR1 %%01IFPDT/4/IF_STATE(l)[0]:Interface Dialer1 has
turned into UP state.
[AR1-Dialer1]dialer user user1
[AR1-Dialer1]dialer-group 1
[AR1-Dialer1]dialer bundle 1
[AR1-Dialer1]ppp chap user huawei1
[AR1-Dialer1]ppp chap password cipher huawei123
[AR1-Dialer1]dialer timer idle 300
INFO: The configuration will become effective after link reset.
[AR1-Dialer1]dialer queue-length 8
[AR1-Dialer1]ip address ppp-negotiate
[AR1-Dialer1]quit
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]pppoe-client dial-bundle-number 1
[AR1-GigabitEthernet0/0/0]quit
[AR1]ip route-static 0.0.0.0 0.0.0.0 Dialer 1
[AR1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 D 119.84.111.253 Dialer1
119.84.111.253/32 Direct 0 0 D 127.0.0.1 Dialer1
119.84.111.254/32 Direct 0 0 D 119.84.111.254 Dialer1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
R3同R2的配置
[Huawei]sysname AR3
[AR3]dialer-rule
[AR3-dialer-rule]dialer-rule 1 ip permit
[AR3-dialer-rule]quit
[AR3]interface Dialer 1
Mar 11 2018 13:50:30-08:00 AR3 %%01IFPDT/4/IF_STATE(l)[1]:Interface Dialer1 has
turned into UP state.
[AR3-Dialer1]dialer user user2
[AR3-Dialer1]dialer-group 1
[AR3-Dialer1]dialer bundle 1
[AR3-Dialer1]ppp chap user huawei2
[AR3-Dialer1]ppp chap password cipher huawei123
[AR3-Dialer1]dialer timer idle 300
INFO: The configuration will become effective after link reset.
[AR3-Dialer1]dialer queue-length 8
[AR3-Dialer1]ip address ppp-negotiate
[AR3-Dialer1]quit
[AR3]interface GigabitEthernet 0/0/0
[AR3-GigabitEthernet0/0/0]pppoe-client dial-bundle-number 1
[AR3-GigabitEthernet0/0/0]quit
[AR3]
Mar 11 2018 13:51:53-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol PP
P on the interface Dialer1:0 has entered the UP state.
[AR3]
Mar 11 2018 13:51:53-08:00 AR3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol PP
P IPCP on the interface Dialer1:0 has entered the UP state.
[AR3]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 2
The number of interface that is DOWN in Protocol is 3
Interface IP Address/Mask Physical Protocol
Dialer1 119.84.111.252/32 up up(s)
GigabitEthernet0/0/0 unassigned up down
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
[AR3]ip route-static 0.0.0.0 0.0.0.0 Dialer 1
[AR3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 7 Routes : 7
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 D 119.84.111.252 Dialer1
119.84.111.252/32 Direct 0 0 D 127.0.0.1 Dialer1
119.84.111.254/32 Direct 0 0 D 119.84.111.254 Dialer1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[AR3]