实验:PPPoE服务器/客户端基础配置

大家使用ADSL上网,我们与电话局之间的物理连接为:网线----电话线-----网线,建立链路使用的技术是PPPoE(PPP帧封装在以太网帧中,PPoE为服务器/客户端模式运行)。今天的实验将本地路由器(客户端)与局端路由器(服务器)最基本的配置呈现给大家(该实验的目的就是实现二层链路的建立,为三层通信创造条件,故不涉及DHCP以及PPP验证等内容)。
实验拓扑图:
Router1 F0/0 <----> Router2 F0/0
该实验客户端(R1)使用思科路由器3640,服务器端(R2)使用思科路由器7200。
 
实验配置:
1.客户端(Client):
Router>en
Router#conf t
Router(config)#hostname Client
Client(config)#vpdn enable (启用VPDN)
Client(config)#int f0/0
Client(config-if)#pppoe enable (在以太网接口上启动PPPoE)
Client(config-if)#no shutdown
Client(config-if)#pppoe-client dial-pool-number 1(将该接口与dialer 0关联)
Client(config-if)#exit
Client(config)#int dialer 0
Client(config-if)#ip mtu 1492 (数据净荷1452+TCP头20+IP头20)
Client(config-if)#encapsulation ppp
Client(config-if)#dialer pool 1(将该虚拟接口通过dialer pool 1 与f0/0关联)
Client(config-if)#ip address 192.168.1.2 255.255.255.0
Client(config-if)#no shu
Client(config-if)#no shutdown
Client(config-if)#end
 
2.服务器端(Server):
Router>en
Router#conf  t
Router(config)#hostname Server
Server(config)#int virtual-template 1 (创建虚拟模板)
Server(config-if)#exit
Server(config)#vpdn enable (启用VPDN)
Server(config)#vpdn-group 1 (创建VPDN组)
Server(config-vpdn)#accept-dialin (允许拨入)
Server(config-vpdn-acc-in)#protocol pppoe
Server(config-vpdn-acc-in)#virtual-template 1(与虚拟模板接口关联起来)
Server(config-vpdn-acc-in)#end
Server(config)#int virtual-template 1
Server(config-if)#encapsulation ppp (将虚拟模板接口封装为PPP)
Server(config-if)#ip address 192.168.1.1 255.255.255.0
Server(config-if)#no shutdown
Server(config)#int f0/0
Server(config-if)#pppoe enable (以太网接口启用PPPOE)
Server(config-if)#no shutdown
Server(config-if)#end
 
测试:
1.客户端ping服务器端
2.在客户端查看接口信息 sh ip int bri
可以看出,启用VPDN后路由器自动创建了虚拟接入接口
3.在客户端查看dialer 0具体信息,看看dialer 0具体和那个虚拟接口关联,show int dialer 0
Client#sh int dialer 0
Dialer0 is up, line protocol is up (spoofing)
  Hardware is Unknown
  Internet address is 192.168.1.2/24
  MTU 1500 bytes, BW 56 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP, loopback not set
  Keepalive set (10 sec)
  DTR is pulsed for 1 seconds on reset
  Interface is bound to Vi2
  Last input never, output never, output hang never
  Last clearing of "show interface" counters 00:51:57
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: weighted fair
  Output queue: 0/1000/64/0 (size/max total/threshold/drops)
     Conversations  0/0/16 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 42 kilobits/sec
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     621 packets input, 10718 bytes
     619 packets output, 11042 bytes
Bound to:
Virtual-Access2 is up, line protocol is up
  Hardware is Virtual Access interface
  MTU 1500 bytes, BW 56 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP, LCP Open
  Listen: CDPCP
  Open: IPCP
  PPPoE vaccess, cloned from Dialer0
  Vaccess status 0x44, loopback not set
  Keepalive set (10 sec)
  DTR is pulsed for 5 seconds on reset
  Interface is bound to Di0 (Encapsulation PPP)
  Last input 00:04:12, output never, output hang never
  Last clearing of "show interface" counters 00:51:23
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue: 0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     634 packets input, 10892 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     633 packets output, 11216 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
可以看出dialer 0与virtual-access 2关联了起来。
4.查看服务器端接口 sh ip int bri
5.查看virtual-access1.1接口信息 sh int virtual-access 1.1
可以看出,服务端路由器是通过virtual-access1.1与客户端路由器建立ppp二层链路的。virtual-access1.1为虚拟模板virtual-template 1的克隆。
 
实验结束。
大家可以在这个实验的基础上进行扩展,如加入DHCP和PPP验证等功能。
本实验的主要目的就是为了理解PPPoE是怎么实现的。侧重理解虚拟接口的应用。很好玩,是吧?
不早了,睡!

你可能感兴趣的:(职场,路由,休闲)