计算机网络课程设计指导书 网络班
!配置IP 地址
Red-Giant(config-if)#ip address 1.1.1.2 255.255.255.0 !封装PPP 协议
Red-Giant(config-if)#encapsulation ppp Red-Giant(config-if)#clock rate 64000
!设置PAP 认证的用户名和密码Red-Giant(config-if)#ppp sent-username Red-Giant password 0 Router RouterB 配置:
Red-Giant#config terminal
Red-Giant(config)#username Red-Giant password 0 Router Red-Giant(config)#interface Serial0 !配置IP 地址
Red-Giant(config-if)#ip address 1.1.1.1 255.255.255.0 !封装PPP 协议
Red-Giant(config-if)#encapsulation ppp !设定PPP 的认证方式
Red-Giant(config-if)#ppp authentication pap 4、验证命令:
Show interface Serial0 Debug ppp authentication (九) 静态路由(可选) 1、网络拓扑
21
pap 计算机网络课程设计指导书 网络班
2、实验内容
通过静态路由,使路由器A,B 具有非直连子网的路由信息。 3、实验配置 A 路由器的配置: ① 配置路由器主机名
Red-Giant>enable(注:从用户模式进入特权模式)
Red-Giant#configure terminal(注:从特权模式进入全局配置模式) Red-Giant(config)#hostname A(注:将主机名配置为“A”) A(config)#
为路由器各接口分配IP 地址 A(config)#interface serial 0
A(config-if)#ip address 172.16.2.2 255.255.255.0
注:设置路由器serial 0 的IP 地址为172.16.2.2,对应的子网掩码为255.255.255.0
A(config)#interface fastethernet 0
A(config-if)#ip address 172.16.3.1 255.255.255.0
注:设置路由器fastethernet 0 的IP 地址为172.16.3.1,对应的子网掩码为 255.255.255.0
② 配置接口时钟频率(DCE):
22
计算机网络课程设计指导书 网络班
A(config)#interface serial 0 A(config-if)clock rate 64000 注:设置接口物理时钟频率为64Kbps ③ 配置静态路由:
A(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1 或:
A(config)#ip route 172.16.1.0 255.255.255.0 serial 0 B 路由器的配置: ① 配置路由器主机名
Red-Giant>enable(注:从用户模式进入特权模式)
Red-Giant#configure terminal(注:从特权模式进入全局配置模式) Red-Giant(config)#hostname B(注:将主机名配置为“B”) B(config)#
为路由器各接口分配IP 地址 B(config)#interface serial 0
B(config-if)#ip address 172.16.2.1 255.255.255.0 A(config)#interface fastethernet 0
A(config-if)#ip address 172.16.1.1 255.255.255.0 ② 配置静态路由:
B(config)#ip route 172.16.3.0 255.255.255.0 172.16.2.2 或:
B(config)#ip route 172.16.3.0 255.255.255.0 serial 0 4、验证命令:
23
计算机网络课程设计指导书 网络班
show ip int brief show ip route ping 5、实验结果
A,B 各路由器应该看到全网路由。主机172.16.3.2 能够访问主机172.16.1.2。 (十) 动态路由RIP 1、网络拓扑
2、实验内容
通过动态路由RIP,使路由器A,B 具有非直连子网的路由信息。 3、实验配置 A 路由器的配置: ① 配置路由器主机名
Red-Giant>enable(注:从用户模式进入特权模式)
Red-Giant#configure terminal(注:从特权模式进入全局配置模式) Red-Giant(config)#hostname A(注:将主机名配置为“A”) A(config)#
② 为路由器各接口分配IP 地址 A(config)#interface serial 0
A(config-if)#ip address 172.16.2.2 255.255.255.0
24
计算机网络课程设计指导书 网络班
注:设置路由器serial 0 的IP 地址为172.16.2.2,对应的子网掩码为255.255.255.0
A(config)#interface fastethernet 0
A(config-if)#ip address 172.16.3.1 255.255.255.0
注:设置路由器fastethernet 0 的IP 地址为172.16.3.1,对应的子网掩码为 255.255.255.0
③ 配置接口时钟频率(DCE): A(config)#interface serial 0 A(config-if)clock rate 64000 注:设置接口物理时钟频率为64Kbps ④ 配置RIP: A(config)#router rip 注:启用路由器A 的RIP 进程
A(config-router)#network 172.16.0.0
注:(1.公布属于172.16.0.0 主类的子网;2.包含在172.16.0.0 主类内的接口发送接收路由信息) B 路由器的配置: ① 配置路由器主机名
Red-Giant>enable(注:从用户模式进入特权模式)
Red-Giant#configure terminal(注:从特权模式进入全局配置模式) Red-Giant(config)#hostname B(注:将主机名配置为“B”) B(config)#
25