![]() |
交换机与计算机:
交换机实际的访问与配置方法:
一种:console线配置:
交换机用console接口 计算机用RS232接口连接,用专门的console线
一般用于交换机的初始化接口或不能远程时使用此方法
二种:远程telnet登录配置
前提:交换机上已经配置远程登录设置控制台设置:
1.允许远程登录
2.设置允许同时登录的数量: 0 4::指定最多五个
3.设置 密码
4设置远程登录IP(管理IP) //远程登录目标,与计算机位于同一VLAN,一般指定特定VLAN用来管理,所以给这个VLAN特定的IP,用于远程访问
Switch>
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#en
Switch(config)#ena
Switch(config)#enable ?
password Assign the privileged level password
secret Assign the privileged level secret
Switch(config)#enable pass aaa //设置全局模式密码为aaa,但是明文显示
Switch(config)#exit
Switch#
sh run显示:
hostname Switch
!
enable password aaa //明码显示
%SYS-5-CONFIG_I: Configured from console by console
Switch(config)#enable secr aaa //设置全局模式密码为aaa,但为加密模式,不用明码
Switch(config)#^Z
Switch#
Switch#exit
sh run显示:
hostname Switch
!
enable secret 5 $1$mERr$0qc4f9z9UYCi6V2sVqpTi. //密文显示,优先级高
enable password aaa //明文显示,优先级低
!Switch>en
Password: //这里需要输入前面设置的密码
Switch#sh run
Building configuration...Current configuration : 993 bytes
!
version 12.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryptionSwitch#
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#line vty 0 4 //设置允许远程登录的用户数量为0-4共计五个
Switch(config-line)#pa
Switch(config-line)#pas
Switch(config-line)#password bbb //设置远程登录的密码为bbb
Switch(config-line)#exit
Switch(config)#vlan 100 //建立专门用于管理的VLAN100
Switch(config-vlan)#int vlan 100 //打开VLAN100接口,设置IP,用于远程登录的目标IP
Switch(config-if)#
%LINK-5-CHANGED: Interface Vlan100, changed state to upSwitch(config-if)#ip addr 192.168.1.200 255.255.255.0 //设置IP,用于远程登录的目标IP192.168.1.200 255.255.255.0
Switch(config-if)#exit
Switch(config)#ip default-gateway 10.10.10.100 //设置默认网关192.168.1.100,不用输入掩码
Switch(config)#
Switch(config)#int f0/1 //选择相应接口(此接口用于连接远程登录的计算机)
Switch(config-if)#sw acc vlan 100 //必须将其放入VLAN100,才能远程登录访问
Switch(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan100, changed state to up%SYS-5-CONFIG_I: Configured from console by console
Switch(config)#service password-encryption //交换机设置,所有密码以密文显示
Switch(config-if)#
设置计算机IP为同一组可以为192.168.1.1 255.255.255.0
打开CMD:telnet 192.168.1.200
下面要求输入远程登录密码为bbb
再进入全局模式时又要输入前面设置的密码aaa用console连接的电脑:
交换机用console接口,计算机用RS232连接
直接打开计算机的TERMINAL就可以登录了,但是本地登录,只需要输入全局模式密码