远程控制三层设备

一、三层设备配置IP

1、三层设备接口默认是关闭状态需要手动开启

在这里插入图片描述

2、给三层设备配置ip地址

Router(config)#int g0/1             切换到g0接口
Router(config-if)#ip add 192.168.0.254 255.255.255.0    配置ip+子网掩码
Router(config-if)#no shut           手动开启接口

3、查看接口状态

在这里插入图片描述

4、分别ping另一台PC和网关

在这里插入图片描述

二、远程控制三层设备(telnet)

1、路由器开启telnet服务

Router(config)#
Router(config)#line vty 0?    可以同时开启多少终端  最大连接数
<0-15>  
Router(config)#line vty 0 4   可以同时有5个人连接这台路由器
Router(config-line)#password 123456    设置telnet密码
Router(config-line)#login     开启验证
Router(config-line)#exit

2、远程PC通过telnet服务连接路由器

在这里插入图片描述

3、当远程控制路由器时必须配置特权密码

在这里插入图片描述

4、路由器上配置特权密码

Router(config)#enable password 123

5、远程pc连接时输入特权密码

Router>en
Password:123
Router#

telnet明文传输,不安全,容易截获

三、远程控制三层设备(SSH)

1、查看支持哪些传输方式

Router(config)#line vty 0 4
Router(config-line)#tran
Router(config-line)#transport in
Router(config-line)#transport input ?
  all     All protocols
  none    No protocols
  ssh     TCP/IP SSH protocol
  telnet  TCP/IP Telnet protocol

2、修改主机名并创建域名

用rsa密钥算法生成密钥对要求必须有主机名和域名(随便起)

Router(config)#ho r1
r1(config)#ip domain-name aa.bb.com

3、生成密钥对

r1(config)#crypto key generate rsa
The name for the keys will be: r1.aa.bb.com
Choose the size of the key modulus in the range of 360 to 2048 for your
  General Purpose Keys. Choosing a key modulus greater than 512 may take
  a few minutes.

How many bits in the modulus [512]: 
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]

4、pc端远程连接路由器

C:\>ssh -l r1 192.168.0.254
Open
Password:123456
r1>enable
Password:123
r1#configure terminal
Enter configuration commands,one per line. End with CNTL/Z.
r1(config)#

四、远程连接账户设置

1、创建主机名和域名

Router(config)#ho r1
r1(config)#ip doomain-name aa.bb.com

2、生成密钥对

ssh时需要此条配置

r1r1(config)#crypto key generate rsa
The name for the keys will be: r1.aa.bb.com
Choose the size of the key modulus in the range of 360 to 2048 for your
  General Purpose Keys. Choosing a key modulus greater than 512 may take
  a few minutes.

How many bits in the modulus [512]: 
% Generating 512 bit RSA keys, keys will be non-exportable...[OK]

3、终端设置最大连接数

r1(config)#line vty 0 4

4、开启服务

Router(config-line)#transport input ?
  all     All protocols
  none    No protocols
  ssh     TCP/IP SSH protocol
  telnet  TCP/IP Telnet protocol

5、开启本地身份验证

r1(config-line)#login local   开启本地数据库身份验证

6、在全局配置模式下设置账户

r1(config)#username xx password 123456
r1(config)#username oo password 654321

7、远程登陆验证需要输入用户名和密码

在这里插入图片描述

二层接口默认开启
三层接口默认管理down(人工关闭)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值