相关学习推荐:
华为实验讲解:实验6-2 配置PPPOE客户端https://www.bilibili.com/video/BV18S4y1a7S7?spm_id_from=333.999.0.0
实验目的
1.理解PPPoE的原理
2.掌握PPPoE的配置
实验拓扑
实验需求
1.根据实验拓扑图,完成设备的基本配置;
2.R1是PPPoE服务器,R2是PPPoE客户端,R2去R1认证并获得IP地址。
实验步骤
步骤1:设备的基本配置
配置PC1:
VPCS> set pcname PC1 //设置主机名
PC1> ip 192.168.1.1/24 192.168.1.254 //设置IP地址与默认网关配置PC2:
VPCS> set pcname PC2 //设置主机名
PC2> ip 192.168.2.1/24 192.168.2.254 //设置IP地址与默认网关
配置R1:
Router>enable
Router#configure terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#exec-timeout 0 0
R1(config-line)#logging synchronous
R1(config-line)#end
R1#
配置R2:
Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#exec-timeout 0 0
R2(config-line)#logging synchronous
R2(config-line)#exit
R2(config)#interface Eth0/1
R2(config-if)#ip address 192.168.1.254 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface Eth0/2
R2(config-if)#ip address 192.168.2.254 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#end
R2#
步骤2:配置PPPoE
配置R1:
R1(config)#username xmws password wisdom
R1(config)#bba-group pppoe ToR2
R1(config-bba-group)#virtual-template 1
R1(config-bba-group)#exit
R1(config)#interface ethernet0/0
R1(config-if)#pppoe enable group ToR2
R1(config-if)#no shutdown
R1(config-if)#exit
R1(config)#interface virtual-template 1
R1(config-if)#ip address 12.1.1.1 255.255.255.252
R1(config-if)#ip mtu 1492
R1(config-if)#peer default ip address pool PoR2
R1(config-if)#ppp authentication chap
R1(config-if)#exit
R1(config)#ip local pool PoR2 12.1.1.2
R1(config)#end
R1#
配置R2:
R2(config)#interface ethernet0/0
R2(config-if)#pppoe enable
R2(config-if)#pppoe-client dial-pool-number 1
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface dialer 1
R2(config-if)#ip mtu 1492
R2(config-if)#dialer pool 1
R2(config-if)#ip address negotiated
R2(config-if)#encapsulation ppp
R2(config-if)#ppp ipcp route default
R2(config-if)#ppp chap hostname xmws
R2(config-if)#ppp chap password wisdom
R2(config-if)#end
R2#
步骤3:检查PPPoE
检查R2:
R2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0/0 unassigned YES unset up up
Ethernet0/1 192.168.1.254 YES manual up up
Ethernet0/2 192.168.2.254 YES manual up up
Ethernet0/3 unassigned YES unset administratively down down
Serial1/0 unassigned YES unset administratively down down
Serial1/1 unassigned YES unset administratively down down
Serial1/2 unassigned YES unset administratively down down
Serial1/3 unassigned YES unset administratively down down
Dialer1 12.1.1.2 YES IPCP up up
Virtual-Access1 unassigned YES unset up up
Virtual-Access2 unassigned YES unset up up R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2ia - IS-IS inter area, * - candidate default, U - per-user static routeo - ODR, P - periodic downloaded static route, H - NHRP, l - LISPa - application route+ - replicated route, % - next hop override, p - overrides from PfRGateway of last resort is 12.1.1.1 to network 0.0.0.0S* 0.0.0.0/0 [1/0] via 12.1.1.112.0.0.0/32 is subnetted, 2 subnets
C 12.1.1.1 is directly connected, Dialer1
C 12.1.1.2 is directly connected, Dialer1192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, Ethernet0/1
L 192.168.1.254/32 is directly connected, Ethernet0/1192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, Ethernet0/2
L 192.168.2.254/32 is directly connected, Ethernet0/2R2#show interfaces dialer 1
Dialer1 is up, line protocol is up (spoofing)Hardware is UnknownInternet address is 12.1.1.2/32MTU 1492 bytes, BW 56 Kbit/sec, DLY 20000 usec,reliability 255/255, txload 1/255, rxload 1/255Encapsulation PPP, LCP Closed, loopback not setKeepalive set (10 sec)DTR is pulsed for 1 seconds on resetInterface is bound to Vi2Last input never, output never, output hang neverLast clearing of "show interface" counters 00:20:57Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0Queueing strategy: fifoOutput queue: 0/40 (size/max)5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec6 packets input, 84 bytes250 packets output, 3500 bytes
Bound to:
Virtual-Access2 is up, line protocol is upHardware is Virtual Access interfaceMTU 1492 bytes, BW 56 Kbit/sec, DLY 20000 usec,reliability 255/255, txload 1/255, rxload 1/255--More--
步骤4:配置NAT上网
配置R2:
R2(config)#interface E0/1
R2(config-if)#ip nat inside
R2(config)#interface E0/2
R2(config-if)#ip nat inside
R2(config)#interface dialer 1
R2(config-if)#ip nat outside
R2(config)#ip nat inside source list 1 interface dialer 1 overloa