packet tracer中交换机的基本配置以及使用telnet方式链接交换机

管理交换机的两种方式

带内管理shell

网络的管理控制信息与用户网络的承载业务信息经过同一个逻辑信道传输,也就是占用业务带宽;安全

例子:网络

经过telnet方式管理交换机。实现了远程管理交换机;ui

带外管理spa

网络的管理控制信息与用户网络的承载业务信息在不一样的逻辑通道,是交换机提供专门用于管理的宽带;命令行

例子:debug

使用console口链接交换机;PC串口链接交换机;能够经过PC机上的超级终端链接到交换机;code

交换机基本信息的配置

交换机的命令行模式有:blog

Switch> #用户模式
Switch# #特权模式
Switch(config)# #全局配置模式
Switch(config-if)# #端口模式 if是interface的缩写;

交换机的命令行:接口

进入特权模式(en/enable)
进入全局配置模式(conf t)config terminal
进入交换机端口视图模式int f 0/1
返回到上级模式(exit)
从全局如下模式返回到特权模式(end)

使用telnet方式配置交换机的实验相关

技术原理

  • 配置交换机的管理ip地址(设置计算机的ip地址与交换机管理IP地址在同一个网段)
  • 在二层交换机中,IP 地址仅用于登陆管理交换机,若是没有配置管理IP地址,交换机只能采用控制端口console进行本地配置和管理;
  • 在默认状况下,交换机的全部端口均属于vlan1,它是交换机自动建立和官吏的。每个vlan只有一个活动的管理地址,所以对二层交换机设置管理地址以前,首先应该选择vlan1接口,而后利用IP address配置命令设置IP管理地址。
  • 为telnet用户设置用户名和登陆口令;
  • 设置交换机特权模式密码和登录模式密码;能够提升交换机的安全性;
siwtch(config)#line vty 0 4 配置远程登录的线路;

siwtch(config-line)#login 用于打开登陆认证

siwtch(config-line)#password  ** //设置远程登录的密码

步骤

新建packet Tracer拓扑图

配置交换机管理ip地址

Switch(config)# int vlan 1  #登陆到vlan1的接口模式
Switch(config)# ip address **IP** **submask** #ip地址后面加子网掩码

配置用户登陆密码

Switch(config)# enable password ****** //设置进入特权模式的密码
Switch(config)# line vty 0 4
Switch(config-line)# password ******   #远程登陆密码
Switch(config-line)# login

<br> ## packet tracer的实验操做

1,打开packet tracer,选择一个2960的交换机,一个pc机;

2,首先选中配置线,将配置线的"rs-232"端口链接交换机的”console“口,同时经过直连线链接pc和路由器

75616212-61f03200-5b89-11ea-9e78-6b56a6532de5

3,经过PC终端对交换机进行配置;

  • 找到终端配置窗口:

75616287-2c981400-5b8a-11ea-8db4-dd0ce5c536f2

4,命令配置(经过console口配置)

Switch>enable		#进特权模式
Switch#conf t		#进入全局配置模式
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface vlan 1		#设置默认接口
Switch(config-if)#ip address 192.168.1.1 255.255.255.0	#配置管理ip地址
Switch(config-if)#no shutdown		#开启端口

Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

Switch(config-if)#exit 
Switch(config)#enable password 123456
Switch(config)#line vty 0 4
Switch(config-line)#password lhy
Switch(config-line)#login
Switch(config-line)#end

Switch#show run
Building configuration...

Current configuration : 1089 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
enable password 123456		#特权模式密码
!
!
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
!

......

interface Vlan1
 ip address 192.168.1.1 255.255.255.0
!
!
line con 0
!
line vty 0 4
 password lhy   #远程登陆密码
 login
line vty 5 15
 login
!
!
end

5,设置PC端的静态ip:

  • 设置ip,子网掩码,网关;

75616311-54877780-5b8a-11ea-95a1-0eed98356efb

6,使用pc端命令行链接(找到pc的command promnt)(使用telnet方式链接交换机):

PC>ping 192.168.1.1		#首先ping一下交换机

Pinging 192.168.1.1 with 32 bytes of data:

Request timed out.
Reply from 192.168.1.1: bytes=32 time=0ms TTL=255
Reply from 192.168.1.1: bytes=32 time=0ms TTL=255
Reply from 192.168.1.1: bytes=32 time=1ms TTL=255

Ping statistics for 192.168.1.1:
    Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 1ms, Average = 0ms

PC>telnet 192.168.1.1		#使用telnet链接交换机
Trying 192.168.1.1 ...Open

User Access Verification 	#用户接入验证,输入远程登陆的密码

Password: 
Switch>enable		#进入特权模式
Password: 
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#end

Switch#show run
Building configuration...

Current configuration : 1089 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
enable password 123456
!
!
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
!
......
!
interface GigabitEthernet1/1
!
interface GigabitEthernet1/2
!
interface Vlan1
 ip address 192.168.1.1 255.255.255.0
!
!
line con 0
!
line vty 0 4
 password lhy
 login
line vty 5 15
 login
!
!
end
相关文章
相关标签/搜索