路由器的基本配置

1、通过telnet访问路由器

要通过telnet访问路由器,需要先通过console口对路由器进行基本配置,例如:IP地址、密码等。
实验拓扑图如图1所示。
路由器的基本配置——通过telnet访问路由器_路由器
1、通过telnet访问路由器拓扑图
路由器的配置:
Router>enable                    ...................................进入路由器的特权模式
Router#configure terminal            ................................进入路由器的全局配置模式
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface f0/0         ...............................进入路由器的f0/0端口
Router(config-if)#ip address 192.168.1.1 255.255.255.0   ...配置路由器f0/0端口的Ip地址
Router(config-if)#no shutdown             .......................启用f0/0端口
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#end          ..............................退出配置模式
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#configure terminal               
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#line vty 0 4        ...................进入路由器的VTY虚拟终端
Router(config-line)#password homechen
Router(config-line)#login     .....................以上两行配置VTY(即telent)的密码
Router(config-line)#exit
Router(config)#enable password homechen   ..............配置进入路由器特权模式的密码
Router(config)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#
PC上测试是否可以和路由器连通:
C:\>ipconfig
IP Address......................: 192.168.1.100
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 0.0.0.0
C:\>>ping 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=21ms TTL=255
Reply from 192.168.1.1: bytes=32 time=8ms TTL=255
Reply from 192.168.1.1: bytes=32 time=8ms TTL=255
Reply from 192.168.1.1: bytes=32 time=8ms TTL=255
Ping statistics for 192.168.1.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 8ms, Maximum = 21ms, Average = 11ms
以上可以看出计算机和路由器能够连通了。
使用telent登录的路由器上
C:\>telnet 192.168.1.1          ..............远程登录到路由器上
Trying 192.168.1.1 ...Open
User Access Verification
Password:             .........................输入telent密码
Router>enable
Password:              .........................输入进入特权模式的密码
Router#show interface f0/0  ........................查看路由器f0/0端口的信息(注意红色的up
FastEthernet0/0 is up, line protocol is up (connected)
  Hardware is Lance, address is 0001.96b9.6501 (bia 0001.96b9.6501)
  Internet address is 192.168.1.1/24