Telnet

第一步:基本配置 R1和R2设备配置IP地址 检查网络连通性

第二步:开启telnet服务器的telnet服务 [R2]telnet server enable -----华为默认情况已经开启了 Error: TELNET server has been enabled [R2]

第三步:开启telnet服务器的VTY功能 开启远程功能 [R2]user-interface vty ? INTEGER<0-4,16-20> The first user terminal interface to be configured [R2]user-interface vty 0 4 -----0到4表示最多有5个同时登录到telnet服务器 [R2-ui-vty0-4]auth [R2-ui-vty0-4]authentication-mode ? -----选择认证模式 aaa AAA authentication password Authentication through the password of a user terminal interface [R2-ui-vty0-4]authentication-mode password Please configure the login password (maximum length 16):Huawei@123 ---输入密码Huawei@123

第四步:在客户端进行telnet远程测试 <R1>telnet 192.168.12.2 ------一定要在用户视图敲这条命令 Press CTRL_] to quit telnet mode Trying 192.168.12.2 ... Connected to 192.168.12.2 ...

Login authentication

Password: -----输入正确的密码 不显示密码 <R2>

权限问题: <R2>? ----默认telnet的权限级别为0 User view commands: display Display information hwtacacs-user HWTACACS user local-user Add/Delete/Set user(s) ping Ping function quit Exit from current mode and enter prior mode save Save file super Modify super password parameters telnet Open a telnet connection tracert <Group> tracert command group <R2>

在服务器端设备权限为级别1 [R2-ui-vty0-4]user privilege level 1

<R2>? ---------级别为1权限的配置命令 都是监控级别的权限 User view commands: arp-ping ARP-ping backup Backup information clear Clear cls Clear screen debugging <Group> debugging command group dialer Dialer display Display information help Description of the interactive help system hwtacacs-user HWTACACS user lldp Link Layer Discovery Protocol local-user Add/Delete/Set user(s) mtrace Trace route to multicast source ping <Group> ping command group quit Exit from current mode and enter prior mode reboot Reboot system reset <Group> reset command group return Enter the privileged mode save Save file send Send information to other user terminal interfaces super Modify super password parameters telnet Open a telnet connection terminal Set the terminal line characteristics tracert <Group> tracert command group undo Negate a command or set its defaults xdsl Display board temperature

[R1]user-interface console 0 -----进入到console接口 [R1-ui-console0]idle-timeout ? INTEGER<0-35791> Set the number of minutes before a terminal user times out [R1-ui-console0]idle-timeout 0 -----永不超时

密码模式 AAA和password

巡检一般给1级别

S

客户端 用户模式

查看

telent极不安全 抓包可以抓到密码

什么是路由 什么是路由表 路由器的认识 路由器的每一个接口处于在不同的网段里面

路由的概念: 就是描述到达目标一个路径

路由表的概念: 将很多条路由(路径)归纳起来的一张表格

通过命令行display ip routing-table 

[R1]display ip routing-table Route Flags: R - relay, D - download to fib

Routing Tables: Public Destinations : 7 Routes : 7

Destination/Mask Proto Pre Cost Flags NextHop Interface

  127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
  127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 192.168.12.0/24 Direct 0 0 D 192.168.12.1 GigabitEthernet 0/0/0 192.168.12.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 192.168.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

[R1]

路由表是怎么形成的? 通过直连路由和非直连路由进行构成

路由器当中默认的四条路由 [R1]display ip routing-table Route Flags: R - relay, D - download to fib

Routing Tables: Public Destinations : 4 Routes : 4

Destination/Mask Proto Pre Cost Flags NextHop Interface

  127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
  127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0

127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

什么是直连路由? 产生条件 1、接口配置IP地址(备注:接口指的是物理接口或者逻辑接口或者虚拟接口等) 2、并企这个接口的IP地址的物理和协议状态都得是UP的 两个条件同时满足的时候 才能产生直连路由

直连路由有啥作用? R1通过直连路由访问到R2设备 就是直连设备的通信

路由表当中字段讲解 <R1>display ip routing-table Route Flags: R - relay, D - download to fib

Routing Tables: Public Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.12.0/24 Direct 0 0 D 10.1.12.1 GigabitEthernet 0/0/0 10.1.12.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 10.1.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 10.1.23.0/24 Static 60 0 RD 10.1.12.2 GigabitEthernet 0/0/0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 Destination/Mask:目标网络:你想去往目标地的网络 Proto:路由来源:要么是通过直连学习到 要么是通过静态或者动态构建出来的 Pre:优先级:直连是0 OSPF是10和150 静态是60 rip是100 BGP是255 Cost:开销值(cost):可以理解为花销成本 Flags:标志位 NextHop:下一跳:你想要去往目标地的下一站 127.0.0.1表示的是抵达设备自身流量 Interface:出接口:数据包发送的接口 注意:一般来说 出接口和下一跳在同一个网段(也有不在一个网段的情况,比如BGP)

1、被转发的路由条路必须存在 2、根据最长匹配原则进行匹配 也就是掩码越长越好 3、当掩码一样 会比较优先级 优先级是最小最优先 4、当掩码一样 优先级一样的情况下 会比较开销 也就是cost值 这个数值越小越优先 5、当前面的所有原则是一样的情况 负载分担

负载分担

路由器转发路由的方式 (尽力而为)

有路由条目就帮你转发 没有就丢弃 优先级的数值 直连 direct 0 静态 static 60 RIP协议 100 OSPF 10

s