一、实验目标
- 掌握采用telnet方式配置交换机的方法
二、技术原理
- 配置交换机的管理IP地址(计算机的IP地址与交换机管理IP地址在同一网段);
- 为telnet用户配置用户名和登录口令:
enable --进入特权模式 conf t --进入全局配置模式 enable password 1234 --进入特权模式的密码 line console 0 --设置通过console端口连接设备的密码(进入用户命令模式用的密码) password 4321 login line vty 0 4 --用Telnet远程登录时,用的密码 password 12345 login --配置交换机ip地址 interface vlan1 ip adress 192.168.1.1 255.255.255.0 no shutdown --这个可千万不能少!!!!!! 开启Interface Vlan1
--查看配置情况
show running-config
- 给PC机配置IP地址和网关 (注意,之前的 交换机的 ip 地址和 PC机的网关是一样的)
--打开PC 命令行
telnet 192.168.1.1
--输入登录密码等等.........
问题:
下面 PC1 和 PC2 的网关都是 192.168.1.1, PC为什么不能ping通网关(192.168.1.1)
答:需要设置与PC相连接的交换机的ip地址为192.168.1.1,此时可以ping通。