在做ppp下面的封装的时候要按照以下几步的顺序来做:
一、按照最基本的要求给路由器配好模块。
就是我用的路由器是2811的,模块加的是第0个模块,记得在家模块之前要先关闭电源。这个属于physical子项。在配好模块之后就进行命令的输入。这是路由器A,路由器B也采取相同的方式进行模块的添加。
二、对两个路由器进行配置(命令),
A:
Continue with configuration dialog? [yes/no]: no (用 no 的话将会省去很多选择的麻烦,这样指自动的)
Press RETURN to get started!
Router>en (进入全局模式)
Router#conf t (进入配置模式)
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host A (对路由器进行重命名)
A(config)#int s0/0/0 (进入端口)
A(config-if)#ip add 192.168.1.1 255.255.255.0 (进行ip地址的添加)
A(config-if)#cl ra 64000 (配置时钟频率)
A(config-if)#no shut (激活端口)
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
B:
Continue with configuration dialog? [yes/no]: no (用no的话将会省去很多选择的麻烦,这样指自动的)
Press RETURN to get stBrted!
Router>en (进入全局模式)
Router#conf t (进入配置模式)
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host B (对路由器进行重命名)
B(config)#int s0/0/0 (进入端口)
B(config-if)#ip add 192.168.1.2 255.255.255.0 (进行ip地址的添加)
B(config-if)#cl rb 64000 (配置时钟频率)
B(config-if)#no shut (激活端口)
%LINK-5-CHANGED: Interface SeriBl0/0/0, changed state to down
三、在两方都配好的情况下二者已经可以ping通,
A#ping 192.168.1.2
Type escbpe sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
B#ping 192.168.1.1
Type escbpe sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
因为二者会自动运行cisco的默认协议:hdlc。但是我们要重新为其配置新的协议:chap。
A:
A#en
A#conf t
Enter configuration commands, one per line. End with CNTL/Z.
A(config)#username B password 12345 (对方的用户名和对方的密码)
A(config)#int s0/0/0
A(config-if)#encapsulation ppp
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to down (协议开始运行了)
A(config-if)#ppp authentication chap
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
B:
B#en
B#conf t
Enter configuration commands, one per line. End with CNTL/Z.
B(config)#username A password 12345 (对方的用户名和对方的密码)
B(config)#int s0/0/0
B(config-if)#encapsulation ppp
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to down (协议开始运行了)
B(config-if)#ppp authentication chap
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
总结:协议就这样就配好了,其实很简单的。在这个实验中要注意的配置命令就是no shutdown这一条。为了保证自己尽量少的出错,我们应该时常用show命令或者ping命令。
我之前有很多问题都不懂,然后到这上面看,还是不是很懂,就只好自己亲手做,然后就会懂了,为了帮助像我一样的新手多学一些东西,我会尽量详细的介绍自己懂的每一个东西。希望大家相互学习,共同进步!
转载于:https://blog.51cto.com/5090152/880707