路由器原理-實驗

路由器

  • 原理:
    • 規劃網段(路由是隔離網段的)
    • 思科路由器
      • 靜態路由協議缺點:
        • 1、配置麻煩
        • 2、在下一跳找不準
      • 靜態路由協議優點:
        • 不佔用CPU和內存資源
      • 靜態路由配置
        • 拓撲圖:
        • 1、配置每個節點的IP地址
          • R0:
            • Router(config)#interfacef0/0
            • Router(config-if)#noshutdown
            • Router(config-if)#ipaddress 192.168.10.1 255.255.255.0
            • Router(config-if)#exit
            • Router(config)#interfacef0/1
            • Router(config-if)#ipaddress 192.168.20.1 255.255.255.0
            • Router(config-if)#noshutdown
          • R1:
            • Router(config)#interfacef0/0
            • Router(config-if)#noshutdown
            • Router(config-if)#ipaddress 192.168.20.2 255.255.255.0
            • Router(config-if)#exit
            • Router(config)#interfacef0/1
            • Router(config-if)#noshutdown
            • Router(config-if)#ipaddress 192.168.30.1 255.255.255.0
            • Router(config-if)#exit
          • R2:
            • Router(config)#interfacef0/0
            • Router(config-if)#noshut
            • Router(config-if)#ipaddress 192.168.30.2 255.255.255.0
            • Router(config-if)#exit
            • Router(config)#interfacef0/1
            • Router(config-if)#noshutdown
            • Router(config-if)#ipaddress 192.168.40.1 255.255.255.0
        • 增加下一跳地址
          • R0:
            • ip route 192.168.30.0255.255.255.0 192.168.20.2
            • ip route 192.168.40.0 255.255.255.0 192.168.20.2
          • R1:
            • ip route 192.168.10.0255.255.255.0 192.168.20.1
            • ip route 192.168.40.0 255.255.255.0 192.168.30.2
          • R3:
            • ip route 192.168.10.0255.255.255.0 192.168.30.1
            • ip route 192.168.20.0 255.255.255.0 192.168.30.1
      • 動態路由協議(RIP)
        • 1、配置每個節點IP地址
          • 和靜態路由第一步一致
        • 2添加rip(查看自已的路由表,然後把自已帶C的網段添加rip就可以了)
          • R0:
            • Router#show ip route
            • C 192.168.10.0/24 isdirectly connected, FastEthernet0/0
            • C 192.168.20.0/24 isdirectly connected, FastEthernet0/1
            • Router#conf t
            • Router(config)#routerrip
            • Router(config-router)#network192.168.10.0
            • Router(config-router)#network192.168.20.0
          • R1:
            • Router#show ip route
            • C 192.168.20.0/24 isdirectly connected, FastEthernet0/0
            • C 192.168.30.0/24 isdirectly connected, FastEthernet0/1
            • Router#conf t
            • Router(config)#routerrip
            • Router(config-router)#network192.168.20.0
            • Router(config-router)#network192.168.30.0
          • R2:
            • Router#show ip route
            • C 192.168.30.0/24 isdirectly connected, FastEthernet0/0
            • C 192.168.40.0/24 isdirectly connected, FastEthernet0/1
            • Router#conf t
            • Router(config)#routerrip
            • Router(config-router)#network192.168.30.0
            • Router(config-router)#network192.168.40.0
    • 不管是靜路由協議還是動態路由協議最終的目的都是爲了讓每臺三層設備都有所有的網段
  • 華爲路由器
    • 拓撲圖:
    • 動態路由和靜態路由配置:
      • 配置節點IP
        • R2:
          • [Huawei]interface e0/0/0
          • [Huawei-Ethernet0/0/0]undo shutdown
          • [Huawei-Ethernet0/0/0]ip address 10.1.1.2 255.255.255.0
          • [Huawei-Ethernet0/0/0]quit
          • [Huawei]interface e0/0/1
          • [Huawei-Ethernet0/0/1]undo shutdown
          • [Huawei-Ethernet0/0/1]ip address 192.168.10.1 255.255.255.0
        • R3:
          • [Huawei]interface e0/0/1
          • [Huawei-Ethernet0/0/1]undo shutdown
          • [Huawei-Ethernet0/0/1]ip address 10.1.2.2 255.255.255.0
          • [Huawei-Ethernet0/0/1]quit
          • [Huawei]interface e0/0/0
          • [Huawei-Ethernet0/0/0]undo shutdown
          • [Huawei-Ethernet0/0/0]ip address 192.168.20.2 255.255.255.0
        • R1:
          • [Huawei]interface e0/0/0
          • [Huawei-Ethernet0/0/0]undo shutdown
          • [Huawei-Ethernet0/0/0]ip address 192.168.10.2 255.255.255.0
          • [Huawei-Ethernet0/0/0]quit
          • [Huawei]interface e0/0/1
          • [Huawei-Ethernet0/0/1]undo shutdown
          • [Huawei-Ethernet0/0/1]ip address 192.168.20.1 255.255.255.0
          • [Huawei-Ethernet0/0/1]quit
      • 添加靜態路由
        • R1:
          • ip route-static 10.1.1.0 255.255.255.0 192.168.10.1
          • ip route-static 10.1.2.0 255.255.255.0 192.168.20.2
        • R2:
          • ip route-static192.168.20.0 255.255.255.0 192.168.10.2
          • ip route-static 10.1.2.0 255.255.255.0 192.168.10.2
        • R3:
          • ip route-static192.168.10.0 255.255.255.0 192.168.20.1
          • ip route-static 10.1.1.0 255.255.255.0 192.168.20.1
      • 添加RIP(動態路由協議)
        • R1:
          • [Huawei]rip 1
          • [Huawei-rip-1]network192.168.10.0
          • [Huawei-rip-1]network192.168.20.0
        • R2:
          • [Huawei]rip 1
          • [Huawei-rip-1]network 192.168.10.0
          • [Huawei-rip-1]network 10.1.1.0
        • R3:
          • [Huawei]rip 1
          • [Huawei-rip-1]network192.168.20.0
          • [Huawei-rip-1]network 10.1.2.0
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章