在JUNOS中启用OSPF51CTO博客 - 超凡娱乐

在JUNOS中启用OSPF51CTO博客

2019年02月20日11时11分26秒 | 作者: 鸿畴 | 标签: 逻辑,路由器,试验 | 浏览: 2402

        最近在学习JUNOS,刚刚起步,感觉从IOS过渡仍是蛮快的,究竟原理性的东西相通,今日特意做了一下OSPF,试验环境是ITAA的JUNOS虚拟机(哈哈打一下小广告),从曾经不能辨认Intel网卡到不支持组播再到现在的根本OK,虚拟机的开展仍是挺敏捷的,这对咱们来讲无疑是极大的协助,好,不说这个,咱们来看看如安在JUNOS中装备OSPF。          试验中使用JUNOS的逻辑路由器特性起了3台Router,分别为R1,R2,R3 ,拓扑为(lo0.0 1.1.1.1)R1-12.1.1.0-R2(lo0.1 2.2.2.2)-23.1.1.0R3(lo0.2 3.3.3.3),由所以逻辑上的路由器,实践的物理接口只要FXP0到FXP3,所以要打上Vlan-tagging,事实上就是每台逻辑路由器的单臂路由。   详细装备如下:(我们不要以为是C++ , JUNOS的show可读性仍是很强的)   [edit]
root@Router1# show
Last changed: 2008-06-02 21:52:49 UTC
version 8.5R1.14;
system {
    host-name Router1;
    domain-name mynetwork.com;
    backup-router 192.168.15.2;
    root-authentication {
        encrypted-password "$1$rJIo5b.H$JOjbMEuowTG/IE1lh4Upo0"; SECRET-DATA
    }
    name-server {
        192.168.15.3;
    }
    services {
        web-management {
            http {
                port 80;
            }
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
logical-routers {
    R1 {
        interfaces {
            fxp1 {
                unit 10 {
                    vlan-id 10;
                    family inet {
                        address 12.1.1.1/30;
                    }
                }
            }
            lo0 {
                unit 0 {
                    family inet {
                        address 1.1.1.1/32;
                    }
                }
            }
        }
        protocols {
            ospf {
                area 0.0.0.0 {
                    interface fxp1.10;
                    interface lo0.0;
                }
            }
        }
        routing-options {
            router-id 1.1.1.1;
        }
    }
    R2 {
        interfaces {
            fxp2 {
                unit 20 {
                    vlan-id 10;
                    family inet {
                        address 12.1.1.2/30;
                    }
                }
                unit 30 {
                    vlan-id 20;
                    family inet {
                        address 23.1.1.2/24;
                    }
                }
            }
            lo0 {
                unit 1 {
                    family inet {
                        address 2.2.2.2/32;
                    }
                }
            }
        }
        protocols {
            ospf {
                area 0.0.0.0 {
                    interface fxp2.20;
                    interface lo0.1;
                    interface fxp2.30;
                }
            }
        }
        routing-options {
            router-id 2.2.2.2;
        }
    }
    R3 {
        interfaces {
            fxp3 {
                unit 30 {
                    vlan-id 20;
                    family inet {
                        address 23.1.1.3/24;
                    }
                }
            }
            lo0 {
                unit 2 {
                    family inet {
                        address 3.3.3.3/32;
                    }
                }  
            }
        }
        protocols {
            ospf {
                area 0.0.0.0 {
                    interface lo0.2;
                    interface fxp3.30;
                }
            }
        }
        routing-options {
            router-id 3.3.3.3;
        }
    }
}
interfaces {
    fxp0 {
        unit 0 {
            family inet {
                address 192.168.200.205/24;
            }
        }
    }              
    fxp1 {
        vlan-tagging;
    }
    fxp2 {
        vlan-tagging;
    }
    fxp3 {
        vlan-tagging;
    }
}
routing-options {
    static {
        route 192.168.0.0/16 {
            next-hop 192.168.200.1;
            active;
        }
    }
}
  然后在R1上检查路由表看是否学习到OSPF路由:   [edit]
root@Router1# run show route logical-router R1 inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
1.1.1.1/32         *[Direct/0] 00:27:16
                    > via lo0.0
2.2.2.2/32         *[OSPF/10] 00:26:27, metric 10
                    > to 12.1.1.2 via fxp1.10
3.3.3.3/32         *[OSPF/10] 00:13:33, metric 20
                    > to 12.1.1.2 via fxp1.10
12.1.1.0/30        *[Direct/0] 00:27:16
                    > via fxp1.10
12.1.1.1/32        *[Local/0] 00:27:16
                      Local via fxp1.10
23.1.1.0/24        *[OSPF/10] 00:13:38, metric 20
                    > to 12.1.1.2 via fxp1.10
224.0.0.5/32       *[OSPF/10] 00:27:21, metric 1
                      MultiRecv
  经过ping在R3上测验连通性:   root@Router1> ping 1.1.1.1 logical-router R3
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: icmp_seq=0 ttl=63 time=3.499 ms
64 bytes from 1.1.1.1: icmp_seq=1 ttl=63 time=4.611 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=63 time=4.507 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=63 time=4.489 ms

^C
- 1.1.1.1 ping statistics -
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max/stddev = 3.499/4.276/4.611/0.451 ms
  JUNOS的ping个人感觉比较怪异,就是不按Ctrl+C就不会中止,和IOS反差好大,一开始不知道这个键的时分,真是抑郁,ping死了给...   经过show在R2上检查OSPF街坊是否树立:   root@Router1> show ospf neighbor logical-router R2
Address          Interface              State     ID               Pri  Dead
12.1.1.1         fxp2.20                Full      1.1.1.1          128    39
23.1.1.3         fxp2.30                Full      3.3.3.3          128    37
 
版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表超凡娱乐立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章