ICMP
ICMP(Internet Control Message Protocol)Internet控制消息协议
Internet控制消息协议ICMP(Internet Control Message Protocol)是网络层的一个重要协议。
ICMP协议用来在网络设备间传递各种差错和控制信息,并对于收集各种网络信息、诊断和排除各种网络故障等方面起着至关重要的作用。使用基于ICMP的应用时,需要对ICMP的工作原理非常熟悉。
ICMP的应用场景
ICMP用来传递差错、控制、查询等信息。
ICMP用于重定向
重定向就是通过各种方法将各种网络请求重新定个方向转到其它位置
ICMP用于差错检测,ICMP Echo Request和ICMP Echo Reply分别用来查询和响应某些信息,进行差错检测。
当网络设备无法访问目标网络时,会自动发送ICMP目的不可达报文到发送端设备。
常见的ICMP报文类型
Type表示ICMP消息类型,Code表示同一消息类型中的不同信息
ICMP消息类型和编码类型
Ping和Tracert的应用
Ping
STRING<1-255> IP address or hostname of a remote system
-a Select source IP address, the default is the IP address of the output interface
-c Specify the number of echo requests to be sent, the default is 5
-d Specify the SO_DEBUG option on the socket being used
-f Set Don’t Fragment flag in packet (IPv4-only)
-h Specify TTL value for echo requests to be sent, the default is 255
-i Select the interface sending packets
Tracert
STRING<1-255> IP address or hostname of a remote system
-a Set source IP address, the default is the IP address of the output interface
-f First time to live, the default is 1
-m Max time to live, the default is 30
-name Display the host name of the router on each hop
-p Destination UDP port number, the default is 33434
-q Number of probe packet, the default is 3
-s Specify the length of the packets to be sent. The default length is 12 bytes
Telnet 远程登录
Telnet可以通过终端对本地和远程的网络设备进行集中管理。
Telnet提供了一个交互式操作界面,允许终端远程登录到任何可以充当Telnet服务器的设备。
Telnet用户可以像通过Console口本地登录一样对设备进行操作。远端Telnet服务器和终端之间无需直连,只需保证两者之间可以互相通信即可。通过使用Telnet,用户可以方便的实现对设备进行远程管理和维护。
Telnet基于TCP协议,服务器端口号默认是23,服务器通过该端口与客户端建立Telnet连接。
认证模式
认证模式 | 描述 |
---|---|
AAA | AAA认证 |
password | 登录时只通过密码实现认证 |
user-interface vty 0 4
authentication-mode password
set authentication password cipher xxx
telnet 10.1.1.1
网络设备作为Telnet服务器,通常使用密码认证机制来认证连接到VTY接口的用户。
VTY(Virtual Type Terminal)是网络设备用来管理和监控通过Telnet方式登录的用户的界面。
网络设备为每个Telnet用户分配一个VTY界面。缺省情况下,ARG3系列路由器支持的Telnet用户最大数目为5个,VTY 0 4的含义是VTY0,VTY1,VTY2,VTY3,VTY4。
如果需要增加Telnet用户的登录数量,可以使用user-interface maximum-vty命令来调整VTY界面的数量。
执行authentication-mode password命令,可以配置VTY通过密码对用户进行认证。
注:不同VRP版本执行set authentication password cipher命令有差异:有些平台需要回车后输入密码,另外一些平台可直接在命令后输入密码。
mac地址的概念
1.单播:通信形式上,点对点,单对单的通信,类似于qq私聊数据封装时,源mac和目的mac都是单播mac,则为单播通信。
单播mac地址:从高位向低位(从左往右)第8位为0,且一定为0, 其他任意。
2.组播:通信形式上,点对多点,单对多的通信,类似于qq群聊组播mac地址:从高位向低位(从左往右)第8位为1,且- -定为1,其他任意。
数据封装时,因为组播代表的是一组的集合,面向-组的通信,此时组播mac不能成为数据的源地址,仅能充当目的地址。
3.广播:通信形式上,点对所有,单对所有的通信。广而播之/强制的接受处理。
数据封装时,因为广播代表的是所有人集合,面向所有人的通信,此时广播mac不能成为数据的源地址,仅能充当目的地址。
广播mac地址:从高位向低位48位全部为1,且-定为1.