靜態路由

 
route1的配置:
router>en
route#conf t
router(config)#interface s0                           //進入S0接口
router(config-if)#ip address 11.11.1.1 255.255.255.0  //設置S0接口的IP地址
router(config-if)#clock rate 64000                     //設置時鐘頻率
router(config-if)#no shutdown                         //開啓端口
router(config-if)#exit
router(config)#interface e0                          //進入LAN接口
router(config-if)#ip address 10.10.1.1 255.255.255.0 //設置LAN接口的IP地址與客戶機IP是同一段網
router(config-if)#no shutdown
router(config-if)#exit
router(config)#ip route 12.12.1.0 255.255.255.0 11.11.1.2 //手動設置下一跳網絡地址
router(config)#ip route 13.13.1.0 255.255.255.0 11.11.1.2  //手動設置下一跳網絡地址(因爲R1有二個不同的網段)
                           
Router2的配置:
router>en
router#conf t
router(config)#interface s0                      //進入S1(與R1的S0連接)接口
router(config-if)#ip address 11.11.1.2 255.255.255.0  //設置S1的IP地址(與R1的S0的IP是同一網段)
router(config-if)#no shutdown             //開啓S1的端口
router(config-if)#exit
router(config)#interface s1                          //進入S0的接口
router(config-if)#ip address 12.12.1.1 255.255.255.0  //設置S0的IP地址(這裏可以隨便設)
router(config-if)#clock rate 64000                   //設置時鐘頻率
router(config-if)#no shutdown                        //開啓S0的端口
router(config-if)#exit
router(config)#ip route 10.10.1.0 255.255.255.0 11.11.1.1 //手動設置下一跳網絡地址
router(config)#ip route 13.13.1.0 255.255.255.0 12.12.1.2 //手動設置下一跳網絡地址(因爲R2有二個不同的網段)
Router3的配置:
router>en
router#conf t
router(config)#interface s1                          //進入S1(與R2的S0連接)接口
router(config-if)#ip address 12.12.1.2 255.255.255.0  //設置S1的IP地址(與R2的S0的IP是同一網段)
router(config-if)#clock rate 64000                     //設置時鐘頻率
router(config-if)#no shutdown                         //開啓端口
router(config-if)#no shutdown                         //開啓S1的端口
router(config-if)#exit
router(config)#interface e0                            //進入LAN接口
router(config-if)#ip address 13.13.1.1 255.255.255.0   //設置IP地址(與客戶機的IP地址是同一網段)
router(config-if)#no shutdown                          //開啓端口
router(config)#ip route 11.11.1.0 255.255.255.0 12.12.1.1  //手動設置下一跳網絡地址
router(config)#ip route 10.10.1.0 255.255.255.0 12.12.1.1  //手動設置下一跳網絡地址(因爲R3有二個不同的網段)
 
兩個PC的IP分配在各自的網段
PC0 的IP可設爲10.10.1.2 255.255.255.0
PC1 的IP可設爲13.13.1.2 255.255.255.0
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章