思科模拟器 - 广域网相关协议配置

admin 2022年6月14日08:39:27评论42 views字数 3343阅读11分8秒阅读模式

补坑,很早以前写的笔记,本篇文章还同步在:rce.iloli.moe

markdown已上传到Github仓库,欢迎fork

https://github.com/icecliffs/ciscn0note

注:如有错误内容(e.g: 配置错误,命令错误,思路错误)

可以电邮我,我改改,或提 issue(


HDLC协议

技术原理

HDLC(High level Data Link Control)高级数据链路层控制协议,是思科路由器默认的封装协议。

拓扑图

思科模拟器 - 广域网相关协议配置

配置命令

R0

配置IP然后
enc hdlc

R1

配置IP然后
enc hdlc

实验测试

路由器上ping通就可以了(那两台PC机是多余的(笑))

思科模拟器 - 广域网相关协议配置

PPP协议

PPP协议封装

协议原理

拓扑图

思科模拟器 - 广域网相关协议配置

配置命令

Router0

Router(config)#int s0/0/0
Router(config-if)#no shutdown
Router(config-if)#clock rate 64000
Router(config-if)#ip add 10.0.0.1 255.0.0.0
Router(config-if)#encapsulation ppp # 封装ppp协议

Router1

Router(config)#int s0/0/0
Router(config-if)#ip add 10.0.0.2 255.0.0.0
Router(config-if)#enc ppp # 封装ppp协议

CHAP认证

协议原理

CHAP(Challenge-Handshake Authentication Protocol)验证是要求握手验证方式,安全性较高,采用密文传送用户名。主验方和被验方两边都有数据库。要求双方的用户名互为对方的主机名,即本端的用户名等于对端的主机名,且口令相同。

[alert]两个路由都必须封装PPP协议,并要创建对方进行验证的用户名和密码,设置时用户名为对方设备的名称,密码必须相同。[/alert]

拓扑图

思科模拟器 - 广域网相关协议配置

配置命令

单向验证

Router0

Router>en
Router#conf
R0(config)#username R1 password 123456 # 对方的用户名及密码
Router(config)#hostname R0
Router(config)#int s0/0/0
Router(config-if)#no shutdown
Router(config-if)#clock rate 64000
Router(config-if)#ip add 10.0.0.1 255.0.0.0
R0(config-if)#encapsulation ppp
R0(config-if)#ppp authentication chap # 设置chap认证

Router1

Router>en
Router#conf
Router(config)#hostname R1
Router(config)#int s0/0/0
Router(config-if)#no shutdown
Router(config-if)#ip add 10.0.0.2 255.0.0.0
Router(config-if)#enc ppp
R1(config)#username R0 password 123456 # 只需要设置一个用户名及密码即可

[admonition]TIP: CHAP单向认证一方设置为chap即可ping通,双向认证只不过是在另外一台路由上在设置一边而已[/admonition]

双向验证

Router0

Router>en
Router#conf
R0(config)#username R1 password 123456 # 对方的用户名及密码
Router(config)#hostname R0
Router(config)#int s0/0/0
Router(config-if)#no shutdown
Router(config-if)#clock rate 64000
Router(config-if)#ip add 10.0.0.1 255.0.0.0
R0(config-if)#encapsulation ppp
R0(config-if)#ppp authentication chap # 设置chap认证

Router1

Router>en
Router#conf
Router(config)#hostname R1
Router(config)#int s0/0/0
Router(config-if)#no shutdown
Router(config-if)#ip add 10.0.0.2 255.0.0.0
Router(config-if)#enc ppp
R1(config)#username R0 password 123456
R1(config-if)#ppp authentication chap # 新加了这句

PAP认证

协议原理

PAP(Password Authentication Protocol)验证是简单认证方式,采用明文传输,验证只在开始连接时进行。被验方先发起连接,将username和Password一起发给主验方。主验方收到被验方username和Password后,在数据库中进行匹配,并回送ACK或NAK。

拓扑图

思科模拟器 - 广域网相关协议配置

配置命令

单向验证

Router0

Router>en
Router#conf
Router(config)#hostname R0
R0(config)#username admin password 123456 # 设置账号密码
R0(config)#int s0/0/0
R0(config-if)#ip add 10.0.0.1 255.0.0.0
R0(config-if)#no shutdown
R0(config-if)#encapsulation ppp
R0(config-if)#ppp authentication pap
R0(config-if)#clock rate 64000

Router1

Router>en
Router#conf
Router(config)#hostname R1
R1(config)#int s0/0/0
R1(config-if)#encapsulation ppp
R1(config-if)#ppp pap sent-username admin password 123456 # 对面的账号密码
R1(config-if)#ip add 10.0.0.2 255.0.0.0
R1(config-if)#no shutdown

双向验证

Router0

Router>en
Router#conf
Router(config)#hostname R0
R0(config)#int s0/0/0
R0(config-if)#no shutdown
R0(config-if)#ip add 10.0.0.1 255.0.0.0
R0(config-if)#clock rate 64000
R0(config-if)#exit
R0(config)#username R1 password pass.123 # 设置用户名和密码
R0(config)#int s0/0/0
R0(config-if)#enc ppp
R0(config-if)#ppp authentication pap # 设置PAP认证
R0(config-if)#ppp pap sent-username R0 password 123456 # 对方路由的账号密码

Router1

Router>en
Router#conf
Router(config)#hostname R1
R1(config)#username R0 password 123456 # 设置用户名和密码
R1(config)#int s0/0/0
R1(config-if)#ip add 10.0.0.2 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#encapsulation ppp
R1(config-if)#ppp authentication pap # 设置PAP认证
R1(config-if)#ppp pap sent-username R1 password pass.123 # 发送对方路由的账号密码

[alert]用户名和密码可以不一样[/alert]

我那时候好废物啊 T^T

原文始发于微信公众号(Gh0xE9):思科模拟器 - 广域网相关协议配置

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年6月14日08:39:27
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   思科模拟器 - 广域网相关协议配置http://cn-sec.com/archives/1110999.html

发表评论

匿名网友 填写信息