开始配置
1.配置好网络的畅通
2.假设自己的一般工作地点pc3这边,那么多层交换机0,则需要一个跨网段的远程配置。交换机1不需要进行一个跨网段的配置。
3.配置交换机1的远程访问,首先要给交换机配置一个管理员ip地址。
4。配置远程管理,并设置登录密码。
5.我们设置特权模式的密码。
6.进行登录。
7.配置三层交换机0,同理按照前面的6个步骤。
8,。完成跨网段的远程控制,还需要在配置一条默认网关。
ip default-gateway 192.168.10.254
在pc1尝试连接。(三层交换机这边网段为192.168.10.0网段,这里配置的管理员ip是192.168.10.4)
以上的配置命令整理如下:
Switch>
Switch>en
Switch#conf
Switch#configure t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
Switch(config)#int vlan 1 进入虚拟接口
Switch(config-if)#
Switch(config-if)#ip add 192.168.1.2 255.255.255.0 设置ip并启动生效
Switch(config-if)#
Switch(config-if)#no sh
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)#
Switch(config-if)#ex
Switch(config-if)#exit
Switch(config)#
Switch(config)#line vty 0 4 设置远程登录允许5个人同时在线
Switch(config-line)#
Switch(config-line)#passw
Switch(config-line)#password 123.com 设置登录密码
Switch(config-line)#
Switch(config-line)#login 表示下次登录需要密码验证
Switch(config-line)#
Switch(config-line)#exit
Switch(config)#en
Switch(config)#ena
Switch(config)#enable passw
Switch(config)#enable password 456.com 设置特权模式密码
Switch(config)#exit
Switch#
%SYS-5-CONFIG_I: Configured from console by console
Switch#
Switch#