路由器原理-实验

路由器

  • 原理:
    • 规划网段(路由是隔离网段的)
    • 思科路由器
      • 静态路由协议缺点:
        • 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值