1. cisco packet tracer中建立图形
2.设置主机PC1的IP为192.168.1.2,子网掩码为255.255.255.0
3.打开主机PC0的终端
4.开始配置交换机
switch>enable //进入特权模式
switch#config t //进入全局配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface vlan 1 //进入vlan1
Switch(config-if)#ip address 192.16.1.3 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)#end
Switch#
%SYS-5-CONFIG_I: Configured from console by console
//验证交换机接口管理IP
Switch#show ip interface
Vlan1 is up, line protocol is up
Internet address is 192.16.1.3/24
Broadcast address is 255.255.255.255
Address determined by setup command
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Local Proxy ARP is disabled
Security level is default
Split horizon is enabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is disabled
IP fast switching on the same interface is disabled
IP Null turbo vector
IP multicast fast switching is disabled
IP multicast distributed fast switching is disabled
IP route-cache flags are None
--More—
设置远程登录密码
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname chenhan //设置主机名
chenhan(config)#enable secret 123456 //设置全局密码
chenhan(config)#line vty 0 4 //设置0-4 个用户可以telnet 远程登陆
chenhan(config-line)#login
% Login disabled on line 1, until 'password' is set
% Login disabled on line 2, until 'password' is set
% Login disabled on line 3, until 'password' is set
% Login disabled on line 4, until 'password' is set
% Login disabled on line 5, until 'password' is set
chenhan(config-line)#exit
chenhan(config)#line vty 0 4
chenhan(config-line)#password 123 //远程登录密码
chenhan(config-line)#login
chenhan(config-line)#exit
chenhan(config)#
chenhan#
%SYS-5-CONFIG_I: Configured from console by console
首先配置vlan