A-A+

思科模拟器的静态路由、动态路由和RIP配置的方法

2015年11月19日 站长资讯 暂无评论

这次介绍的是使用思科模拟器来完成静态路由、动态路由和RIP配置的具体方法。其中,动态路由协议和RIP的命令就两行比较简单。组网方式是三台cisco路由器连成线(分别为Router1、Router2和Router3),R1和R3分别有联了PC1和PC2客户端并要实现相互的通信,具体的ip地址和网段设置参加下图所示。

本次实验拓扑图如下:

要想实现pc1和pc2通讯,就要对R1、R2和R3进行如下配置:

1. 静态配置命令格式如下:

对于R1

  1. Router>en  
  2.   
  3. Router#conf  
  4.   
  5. Configuring from terminal, memory, or network [terminal]?   
  6.   
  7. Enter configuration commands, one per line.  End with CNTL/Z.  
  8.   
  9. Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2  

ip route +目的网段+目的网段的子网掩码+下一跳IP

查看配置情况 特权模式下 Router#show ip route

其他的路由同理配置。

2. RIP 动态路由配置命令 network +相邻网段

  1. Router#config  
  2. Configuring from terminal, memory, or network [terminal]?   
  3. Enter configuration commands, one per line.  End with CNTL/Z.  
  4. Router(config)#router rip  
  5. Router(config-router)#network 192.168.1.0  
  6. Router(config-router)#network 192.168.2.0  
  7.   
  8. Router#write  
  9. Building configuration...  
  10. [OK]  

查看命令

  1. Router#show ip route  
  2. Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP  
  3.        D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area  
  4.        N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2  
  5.        E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP  
  6.        i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area  
  7.        * - candidate default, U - per-user static route, o - ODR  
  8.        P - periodic downloaded static route  
  9.   
  10. Gateway of last resort is not set  
  11.   
  12. C    192.168.1.0/24 is directly connected, FastEthernet0/0  
  13. C    192.168.2.0/24 is directly connected, FastEthernet0/1  
  14. S    192.168.3.0/24 [1/0] via 192.168.2.2  
  15. R    192.168.4.0/24 [120/2] via 192.168.2.2, 00:00:19, FastEthernet0/1  

3.查看pc 互ping的情况

注意:在做的时候,动态配置的时候,只有全部路由都配置好以后,在查看的时候才能显示出来。

标签:

给我留言