• OSPF单区域配置


    OSPF单区域配置

    实验环境:华为模拟器eNSP
    现在有这样一个拓扑图:

    我想要让R1可以pingR3,显然目前是不行的:

    <R1>ping 192.168.2.2
    PING 192.168.2.2: 56  data bytes, press CTRL_C to break
        Request time out
        Request time out
        Request time out
        Request time out
        Request time out
    
    --- 192.168.2.2 ping statistics ---
        5 packet(s) transmitted
        0 packet(s) received
        100.00% packet loss
    

    查看一下路由器R1的路由表:

    <R1>dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
            Destinations : 4        Routes : 4        
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
        127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
        127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
        192.168.1.0/24  Direct  0    0           D   192.168.1.1     Ethernet0/0/0
        192.168.1.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/0
    

    发现只有自己的IP地址,说明ping不通是正常的,现在我们来配置OSPF来让R1可以pingR3

    <R1>sy
    [R1]ospf    //启用ospf进程
    [R1-ospf-1]area 0	  //区域号
    [R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255   //宣告路由
    

    <R2>sy
    [R2]ospf
    [R2-ospf-1]area 0	
    [R2-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
    [R2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
    

    <R3>sy
    [R3]ospf
    [R3-ospf-1]area 0	
    [R3-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
    

    这样就配好了,去R1上查看一下路由表:

    <R1>dis ip routing-table 
    Route Flags: R - relay, D - download to fib
    ------------------------------------------------------------------------------
    Routing Tables: Public
            Destinations : 5        Routes : 5        
    
    Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface
    
        127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
        127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
        192.168.1.0/24  Direct  0    0           D   192.168.1.1     Ethernet0/0/0
        192.168.1.1/32  Direct  0    0           D   127.0.0.1       Ethernet0/0/0
        192.168.2.0/24  OSPF    10   2           D   192.168.1.2     Ethernet0/0/0
    

    可以看到已经通过OSPF学到了路由器R3的路由,再来ping一下R3试试:

    <R1>ping 192.168.2.2
    PING 192.168.2.2: 56  data bytes, press CTRL_C to break
        Reply from 192.168.2.2: bytes=56 Sequence=1 ttl=254 time=60 ms
        Reply from 192.168.2.2: bytes=56 Sequence=2 ttl=254 time=30 ms
        Reply from 192.168.2.2: bytes=56 Sequence=3 ttl=254 time=80 ms
        Reply from 192.168.2.2: bytes=56 Sequence=4 ttl=254 time=60 ms
        Reply from 192.168.2.2: bytes=56 Sequence=5 ttl=254 time=50 ms
    
    --- 192.168.2.2 ping statistics ---
        5 packet(s) transmitted
        5 packet(s) received
        0.00% packet loss
        round-trip min/avg/max = 30/56/80 ms
    

    可以看到,已经能ping通了,说明配置没有问题。
    再来看一下OSPF状态信息:

    <R1>dis ospf peer brief 
    
        OSPF Process 1 with Router ID 192.168.1.1
            Peer Statistic Information
    ----------------------------------------------------------------------------
    Area Id          Interface                        Neighbor id      State    
    0.0.0.0          Ethernet0/0/0                    192.168.1.2      Full        
    ----------------------------------------------------------------------------
  • 相关阅读:
    我对IOC控制反转,依赖注入原理的理解
    .net带事件的对象BinaryFormatter 序列化失败
    (维权成功,链接已经被删除了)如何防止自己的原创文章被垃圾站IT165采集和盗用
    浅谈.net多线程机制
    给现下流行的打车软件的一点小建议
    C#应用MemoryStream提高File读取速度
    微软真的要抛弃Silverlight了吗?
    C# File.Copy 实现磁盘间文件备份
    遮罩層 日曆效果
    GridView導出Excel
  • 原文地址:https://www.cnblogs.com/Timesi/p/9374416.html
Copyright © 2020-2023  润新知