资源描述
《计算机网络》实训项目五
——路由器基本操作与配置
路由器工作在IP协议网络层,实现子网之间转发数据的设备。路由器的接口分为3种:
a. 串行接口(Serial):使用代号s,如s0/1, s0/2
b. 以太网接口:使用代号e,如e0/1,e0/2
c.Console配置口
路由器的常规配置包括主机名,特权模式密码,Console线路密码,vty远程登录密码,端口ip设置等。
实验线路图如下:
1)从PC机x3使用配置线连入路由器,完成路由器的基本配置
Router#conf t
Router(config)#hostname routerA
routerA(config)#enable pass txx %特权模式明文密码
routerA(config)#line console 0 %Console线路密码
routerA(config-line)#password txx1
routerA(config-line)#login
routerA(config-line)#line vty 0 4 %vty远程登录密码
routerA(config-line)#password txx2
routerA(config-line)#login
routerA(config-line)#exit
2)路由器端口IP地址配置
路由器是工作在网络层的设备,其每个端口有独立的IP地址。在实验线路中要求将f0/0口配置IP地址192.168.1.1,将f0/1口配置IP地址192.168.2.1,2个端口分属不同的子网。
routerA(config)#int f0/0
routerA(config-if)#ip address 192.168.1.1 255.255.255.0
routerA(config-if)#no shut
routerA(config-if)#int f0/1
routerA(config-if)#ip address 192.168.2.1 255.255.255.0
routerA(config-if)#no shut
routerA(config-if)#exit
3)路由器上设置路由协议RIP
只有一台路由器不需要设置路由协议,即直连网段间通信不需要在路由器上设置路由协议
4)主机IP的设定和网关的设定(网关即为主机下一站的IP地址)
将x1主机的IP地址设定为192.168.1.2(与路由器f0/0在同一子网),并设定网关为路由器f0/0(192.168.1.1)。
将x2主机的IP地址设定为192.168.2.2(与路由器f0/1在同一子网),并设定网关为路由器f0/1(192.168.2.1)。
5)探测网络连通情况
从主机x1使用ping命令连接其他IP地址,全部都连通。
ping 192.168.1.1 (路由器f0/0端口)
ping 192.168.2.1 (路由器f0/1端口)
ping 192.168.2.2 (主机x2)
同理可测试主机x2。
展开阅读全文