交换机开启SSH远程登录

LSW1接入管理设备,LSW1为根桥,通过计算机远程登录到LSW1给SW1发送配置,然后LSW1进行管理LSW2、LSW3、LSW3

交换机之间的连接的接口全部为trunk接口,允许通过的vlan都为vlan100,LSW1连接管理设备的接口为access接口,并划分到vlan 100内

LSW1的管理IP地址为:192.168.100.1/24

LSW2的管理IP地址为:192.168.100.2/24

LSW3的管理IP地址为:192.168.100.3/24

LSW4的管理IP地址为:192.168.100.4/24

# 二层设备vlan的创建和Trunk的配置

LSW1的配置:

vlan batch 100

interface G0/0/1

port link-type trunk

port trunk allow-pass vlan 100

interface G0/0/2

port link-type trunk

port trunk allow-pass vlan 100

interface G0/0/24

port link-type trunk

port trunk allow-pass vlan 100

interface G0/0/3 

port link-type access

port default vlan 100

LSW2的配置:

vlan batch 100

interface G0/0/1

port link-type trunk

port trunk allow-pass vlan 100

interface G0/0/2

port link-type trunk

port trunk allow-pass vlan 100

interface G0/0/24

port link-type trunk

port trunk allow-pass vlan 100

LSW3的配置:

vlan batch 100

interface G0/0/1

port link-type trunk

port trunk allow-pass vlan 100

interface G0/0/2

port link-type trunk

port trunk allow-pass vlan 100

LSW4的配置:

vlan batch 100

interface G0/0/1

port link-type trunk

port trunk allow-pass vlan 100

interface G0/0/2

port link-type trunk

port trunk allow-pass vlan 100

#二层  STP的配置

#可以创建一个实例,进行STP的配置,也可以采用默认实例,这里在LSW1上使用了默认实例配置STP

stp enable

stp root primary

# 三层  IP地址  

LSW1:

interface vlanif 100

ip address 192.168.100.1 24

LSW2:

interface vlanif 100

ip address 192.168.100.2 24

LSW3:

interface vlanif 100

ip address 192.168.100.3 24

LSW4:
interface vlanif 100

ip address 192.168.100.4 24

# 在交换机LSW1上部署 SSH

ssh user username authentication-type password     #采用密码认证     username :用户名

ssh user username service-type stelnet       #登录的类型

stelnet server enable                                    #开启ssh的登录

dis current-configuration                              #查看全局所有的配置

# 开放 vty 端口,能被远程登录

# 开放 编号为 0 1 2 3 4 的 vty端口,同时支持五个远程用户连接

user-interface vty 0 4

authentication-mode aaa

 # 登录的协议是 ssh

protocol inbound ssh

 # 三A认证配置

 aaa

  local-user username password cipher abc@123

  local-user username privilege level 15   #用户的特权等价为15,最高级相当于root用户

  local-user username service-type ssh

# username:用户名 abc@123:密码

#在LSW2、LSW3、LSW4上可以采用相同的操作

此时,配置完成后可以采用远程终端设备进行远程连接,这里采用SecureCRT进行远程登录

点击连接后会有一个弹窗进行输入密码连接即可

 

 连接后,出现下面的界面就连接成功了

远程登录设置完成后,可以采用python脚本自动化运维网络设备

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值