enable
configure terminal
! 配置设备IP地址(用于远程访问)
interface vlan 1
ip address 192.168.1.1 255.255.255.0
no shutdown
exit
! 启用Telnet服务
line vty 0 4
transport input telnet
login local
exit
! 创建本地用户
username admin privilege 15 secret yourpassword
system-view
interface Vlanif 1
ip address 192.168.1.1 24
quit
aaa
local-user admin password cipher yourpassword
local-user admin privilege level 15
local-user admin service-type telnet
quit
user-interface vty 0 4
authentication-mode aaa
protocol inbound telnet
quit
show running-config | include telnet
show line vty
show users
从客户端计算机测试:
telnet 192.168.1.1
如果连接失败,检查: - 网络连通性(ping测试) - 防火墙设置 - 设备上的ACL限制
使用Wireshark等工具捕获Telnet流量,验证: - 连接建立过程 - 认证过程 - 数据交互
使用SSH替代Telnet(Telnet传输明文不安全)
ip domain-name yourdomain.com
crypto key generate rsa general-keys modulus 2048
line vty 0 4
transport input ssh
配置访问控制列表(ACL)限制源IP
access-list 10 permit 192.168.1.100
line vty 0 4
access-class 10 in
设置空闲超时
line vty 0 4
exec-timeout 5 0
启用日志记录
logging buffered 16384
logging trap debugging
连接被拒绝
认证失败
连接后立即断开
如需更详细的特定厂商配置或有任何问题,请随时告知。