Junos路由器静态路由及动态路由rip和ospf配置测试

简介:

一.测试拓扑:

wKioL1Ls1K-SwH1YAABW4dzX3A4810.jpg
二.基本配置:
A.R1:
interface Ethernet0/0
ip address 202.100.100.1 255.255.255.0
    no shut
interface Loopback0
    ip address 1.1.1.1 255.255.255.255
B.R2:
interface Ethernet0/0
    ip address 202.100.100.2 255.255.255.0
    no shut
interface Ethernet0/1
    ip address 202.100.1.2 255.255.255.0
    no shut
interface Loopback0
    ip address 2.2.2.2 255.255.255.255
C. JUNOS1:
set system root-authentication plain-text-password

set interfaces em0 unit 0 family inet address 202.100.1.10/24
set interfaces em1 unit 0 family inet address 10.1.1.10/24
D.R3:
interface Ethernet0/0
    ip address 10.1.1.3 255.255.255.0
    no shut
interface Loopback0
    ip address 3.3.3.3 255.255.255.255
三. JUNOS 静态路由配置:
A.配置方法:
set routing-options static route 0.0.0.0/0 next-hop 202.100.1.2
commit
B.测试:
root> ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: icmp_seq=0 ttl=255 time=51.869 ms
^C
--- 1.1.1.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max/stddev = 51.869/51.869/51.869/nan ms
四.RIP动态路由配置:
--junos如果不配置认证,不用配置策略,配置认证,如果不配置策略,接口发出的rip包不会带有认证信息,junos只能接收rip。
A.JUNOS:
①配置策略:
set policy-options policy-statement advertis-routers-through-rip term 1 from protocol direct
set policy-options policy-statement advertis-routers-through-rip term 1 from protocol rip
set policy-options policy-statement advertis-routers-through-rip term 1 then accept
②配置接口,将接口加入group
set protocols rip group rip-group neighbor em1.0
③group export策略
set protocols rip group rip-group export advertis-routers-through-rip
④配置认证
全局:
set protocols rip authentication-type md5
set protocols rip authentication-key  cisco
接口:
set protocols rip group rip-group neighbor em1.0 authentication-type md5
set protocols rip group rip-group neighbor em1.0 authentication-key  cisco
B.R2:
①基本配置:
router rip
version 2
network 10.0.0.0
network 192.168.1.0
②配置认证:
key chain rip
key 1
  key-string cisco
interface Ethernet0/0
    ip rip authentication mode md5
    ip rip authentication key-chain rip
备注:测试时发现用c2691-adventerprisek9-mz.124-15.T14.BIN的2691的路由器配置完rip认证后,rip包中不会有认证信息,可能是IOS的问题。
C.验证:
root# run show route 

inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

3.0.0.0/8          *[RIP/100] 00:09:09, metric 2, tag 0
                   > to 10.1.1.3 via em1.0
10.1.1.0/24        *[Direct/0] 00:28:05
                   > via em1.0
10.1.1.10/32       *[Local/0] 00:28:05
                     Local via em1.0
13.0.0.0/8         *[RIP/100] 00:09:09, metric 2, tag 0
                   > to 10.1.1.3 via em1.0
202.100.1.0/24     *[Direct/0] 00:28:05
                   > via em0.0
202.100.1.10/32    *[Local/0] 00:28:05
                     Local via em0.0
224.0.0.9/32       *[RIP/100] 00:01:10, metric 1
                     MultiRecv
R3#show ip route rip
R    202.100.1.0/24 [120/1] via 10.1.1.10, 00:00:19, Ethernet0/0

五.OSPF动态路由配置:

A.R1:
router ospf 1
    router-id 1.1.1.1
    network 202.100.100.1 0.0.0.0 area 0
    network 1.1.1.1 0.0.0.0 a 0
interface Ethernet0/0
    ip ospf authentication message-digest
    ip ospf message-digest-key 1 md5 cisco
---链路认证
B.R2:
router ospf 1
    router-id 2.2.2.2
    area 0 authentication message-digest
    network 202.100.1.2 0.0.0.0 area 0
    network 202.100.100.2 0.0.0.0 area 0
interface Ethernet0/0
    ip ospf message-digest-key 1 md5 cisco
interface Ethernet0/1
    ip ospf message-digest-key 1 md5 cisco
---区域认证
C.JUNOS:
set protocols ospf area 0.0.0.0 interface em0.0 authentication md5 1 key cisco
D:验证:
root# run show ospf neighbor
Address          Interface              State     ID               Pri  Dead
202.100.1.2      em0.0                  Full      2.2.2.2            1    32
root# run show route protocol ospf   

inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[OSPF/10] 00:00:04, metric 12
                   > to 202.100.1.2 via em0.0
202.100.100.0/24   *[OSPF/10] 04:48:10, metric 11
                   > to 202.100.1.2 via em0.0
224.0.0.5/32       *[OSPF/10] 04:48:22, metric 1
                     MultiRecv

六.OSPF和rip双向路由重分布配置:
A.RIP往OSPF:
①配置策略:
set policy-options policy-statement into-ospf term rip-to-ospf from protocol rip
set policy-options policy-statement into-ospf term rip-to-ospf from route-filter 3.0.0.0/8 exact
set policy-options policy-statement into-ospf term rip-to-ospf then accept
set policy-options policy-statement into-ospf term direct-to-ospf from protocol  direct
set policy-options policy-statement into-ospf term direct-to-ospf from route-filter 10.1.1.0/24 exact
set policy-options policy-statement into-ospf term direct-to-ospf then accept
set policy-options policy-statement into-ospf then reject
②调用策略:
set protocols ospf export into-ospf
③验证:
R1#show ip route ospf
O E2 3.0.0.0/8 [110/2] via 202.100.100.2, 00:07:57, Ethernet0/0
O    202.100.1.0/24 [110/20] via 202.100.100.2, 00:10:49, Ethernet0/0
    10.0.0.0/24 is subnetted, 1 subnets
O E2    10.1.1.0 [110/0] via 202.100.100.2, 00:00:04, Ethernet0/0
B. OSPF RIP
①配置策略:
set policy-options policy-statement into-rip term ospf-to-rip from protocol ospf
set policy-options policy-statement into-rip term ospf-to-rip from route-filter 202.100.100.0/24 exact
set policy-options policy-statement into-rip term ospf-to-rip from route-filter 1.1.1.1/32 exact
set policy-options policy-statement into-rip term ospf-to-rip then accept
set policy-options policy-statement into-rip term direct-to-rip from protocol direct
set policy-options policy-statement into-rip term direct-to-rip from route-filter 202.100.1.0/24 exact
set policy-options policy-statement into-rip term direct-to-rip then accept
set policy-options policy-statement into-rip then reject
②调用策略:
set protocols rip group rip-group export into-rip
③验证:
R3#show ip route rip
    1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 10.1.1.10, 00:00:24, Ethernet0/0
R    202.100.100.0/24 [120/1] via 10.1.1.10, 00:00:24, Ethernet0/0
R    202.100.1.0/24 [120/1] via 10.1.1.10, 00:00:24, Ethernet0/0




本文转自 碧云天 51CTO博客,原文链接:http://blog.51cto.com/333234/1355447,如需转载请自行联系原作者
相关文章
|
10月前
|
Java 测试技术 数据安全/隐私保护
通过yaml文件配置自动化测试程序
通过yaml文件可以将自动化测试环境,测试数据和测试行为分开,请看一下案例
383 4
|
11月前
|
XML Ubuntu Java
如何在Ubuntu系统上安装和配置JMeter和Ant进行性能测试
进入包含 build.xml 的目录并执行:
518 13
|
运维 关系型数据库 MySQL
os-copilot安装_配置_功能测试全集
我是一位中级运维工程师,我平时工作会涉及到 各类服务器的 数据库 与 java环境配置 操作。 我顺利使用了OS Copilot的 -t -f | 功能,我的疑惑是不能在自动操作过程中直接给与脚本运行权限,必须需要自己运行一下 chmod 这个既然有了最高的权限,为什么就不能直接给与运行权限呢。 我认为 -t 功能有用,能解决后台运行基础命令操作。 我认为 -f 功能有用,可以通过task文件中撰写连续任务操作。 我认为 | 对文件理解上有很直接的解读,可以在理解新程序上有很大帮助。
506 86
|
人工智能 Ubuntu Linux
os-copilot使用之全面配置与使用测试
作为一名个人开发者,我主要从事云服务器架设工作。近期,我成功使用了OS Copilot的 `-t -f |` 功能,解决了执行语句、连续提问及快速理解文件的问题。我发现这些功能非常实用,特别是在使用Workbench时能快速调用AI助手。此外,建议将AI功能与xShell工具联动,进一步提升效率。文中详细记录了购买服务器、远程连接、安装配置OS Copilot以及具体命令测试的过程,展示了如何通过快捷键和命令行操作实现高效开发。
592 67
|
域名解析 弹性计算 监控
slb测试基本配置检查
slb测试基本配置检查
431 60
|
缓存 Java 测试技术
【01】噩梦终结flutter配安卓android鸿蒙harmonyOS 以及next调试环境配鸿蒙和ios真机调试环境-flutter项目安卓环境配置-gradle-agp-ndkVersion模拟器运行真机测试环境-本地环境搭建-如何快速搭建android本地运行环境-优雅草卓伊凡-很多人在这步就被难倒了
【01】噩梦终结flutter配安卓android鸿蒙harmonyOS 以及next调试环境配鸿蒙和ios真机调试环境-flutter项目安卓环境配置-gradle-agp-ndkVersion模拟器运行真机测试环境-本地环境搭建-如何快速搭建android本地运行环境-优雅草卓伊凡-很多人在这步就被难倒了
2166 3
【01】噩梦终结flutter配安卓android鸿蒙harmonyOS 以及next调试环境配鸿蒙和ios真机调试环境-flutter项目安卓环境配置-gradle-agp-ndkVersion模拟器运行真机测试环境-本地环境搭建-如何快速搭建android本地运行环境-优雅草卓伊凡-很多人在这步就被难倒了
|
Dart 前端开发 Android开发
【02】写一个注册页面以及配置打包选项打包安卓apk测试—开发完整的社交APP-前端客户端开发+数据联调|以优雅草商业项目为例做开发-flutter开发-全流程-商业应用级实战开发-优雅草央千澈
【02】写一个注册页面以及配置打包选项打包安卓apk测试—开发完整的社交APP-前端客户端开发+数据联调|以优雅草商业项目为例做开发-flutter开发-全流程-商业应用级实战开发-优雅草央千澈
667 1
【02】写一个注册页面以及配置打包选项打包安卓apk测试—开发完整的社交APP-前端客户端开发+数据联调|以优雅草商业项目为例做开发-flutter开发-全流程-商业应用级实战开发-优雅草央千澈
|
数据可视化 前端开发 测试技术
接口测试新选择:Postman替代方案全解析
在软件开发中,接口测试工具至关重要。Postman长期占据主导地位,但随着国产工具的崛起,越来越多开发者转向更适合中国市场的替代方案——Apifox。它不仅支持中英文切换、完全免费不限人数,还具备强大的可视化操作、自动生成文档和API调试功能,极大简化了开发流程。
|
Java 测试技术 容器
Jmeter工具使用:HTTP接口性能测试实战
希望这篇文章能够帮助你初步理解如何使用JMeter进行HTTP接口性能测试,有兴趣的话,你可以研究更多关于JMeter的内容。记住,只有理解并掌握了这些工具,你才能充分利用它们发挥其应有的价值。+
1627 23
|
SQL 安全 测试技术
2025接口测试全攻略:高并发、安全防护与六大工具实战指南
本文探讨高并发稳定性验证、安全防护实战及六大工具(Postman、RunnerGo、Apipost、JMeter、SoapUI、Fiddler)选型指南,助力构建未来接口测试体系。接口测试旨在验证数据传输、参数合法性、错误处理能力及性能安全性,其重要性体现在早期发现问题、保障系统稳定和支撑持续集成。常用方法包括功能、性能、安全性及兼容性测试,典型场景涵盖前后端分离开发、第三方服务集成与数据一致性检查。选择合适的工具需综合考虑需求与团队协作等因素。
2193 24