You are on page 1of 8

---------------------------------------------------------------------------------------------IOS configuration

------------------------------------------------------------------------------------------------------------------------R1 configuration.
---------------------------!
! Interface under ospf process 2
!
interface fastethernet 0/0
ip add 192.168.1.1 255.255.255.0
!
! Interface under ospf process 1
!
interface fastethernet 0/1
ip add 10.1.1.1 255.255.255.0
!
! Interface under ospf process 1
!
interface loopback 0
ip add 10.10.10.1 255.255.255.0
!
! Interface under ospf process 2
!
interface loopback 1
ip add 192.168.10.1 255.255.255.0
!
! ospf instance 1
!
router ospf 1
router-id 10.10.10.1
network 10.1.1.0 0.0.0.255 area 1.1.1.1
network 10.10.10.0 0.0.0.255 area 1.1.1.1
!
! ospf instance 2
!
router ospf 2
router-id 192.168.10.1
network 192.168.1.0 0.0.0.255 area 0.0.0.0
network 192.168.10.0 0.0.0.255 area 0.0.0.0

---------------------------R2 configuration.
---------------------------!
! Interface under ospf process 2

!
interface fastethernet 0/0
ip add 192.168.1.2 255.255.255.0
!
! Interface under ospf process 1
!
interface fastethernet 0/1
ip add 172.16.1.2 255.255.255.0
!
! Interface under ospf process 1
!
interface loopback 0
ip add 172.16.16.1 255.255.255.0
!
! Interface under ospf process 2
!
interface loopback 1
ip add 192.168.10.2 255.255.255.0
!
! ospf instance 1
!
router ospf 1
router-id 172.16.16.2
network 172.16.1.0 0.0.0.255 area 2.2.2.2
network 172.16.16.0 0.0.0.255 area 2.2.2.2
!
! ospf instance 2
!
router ospf 2
router-id 192.168.10.2
network 192.168.1.0 0.0.0.255 area 0.0.0.0
network 192.168.10.0 0.0.0.255 area 0.0.0.0

---------------------------------------------------------------------------------------------JunOS configuration
---------------------------------------------------------------------------------------------/*
Router 1 configuration.
*/
interfaces {
/* Interface under OSPF 2 */
ge-0/0/0 {
unit 0 {
family inet {
address 192.168.1.1/24;

}
}
}
/* Interface under OSPF 1 */
ge-0/0/1 {
unit 0 {
family inet {
address 10.1.1.1/24;
}
}
}
/* Interface under OSPF 1 */
lo0 {
unit 1 {
family inet {
address 10.10.10.1/24;
}
}
}
/* Interface under OSPF 2 */
lo0 {
unit 2 {
family inet {
address 192.168.10.1/24;
}
}
}
}

/*
RIB Groups configuration. Mutual rib import. will also import to default globa
l table inet.0
For OSPF-1 group, R1-OSPF-1 instance is the main table. Wil flood information
to R1-OSPF-2 and default inet.0.
For OSPF-2 group, R1-OSPF-2 instance is the main table. Wil flood information
to R1-OSPF-1 and default inet.0.
*/
routing-options {
rib-groups {
OSPF-1 {
import-rib [ R1-OSPF-1.inet.0 R1-OSPF-2.inet.0 inet.0 ];
}
OSPF-2 {
import-rib [ R1-OSPF-2.inet.0 R1-OSPF-1.inet.0 inet.0 ];
}
}
}

/*

Routing instance OSPF-1, equivalent to router ospf 1.


*/
routing-instances {
R1-OSPF-1 {
instance-type virtual-router;
interface ge-0/0/1.0;
interface lo0.1;
routing-options {
/* Directly connected interfaces will populate this RIB Group */
interface-routes {
rib-group inet OSPF-1;
/* Needed for lan and ptp interfaces. */
family inet {
export {
point-to-point;
lan;
}
}
}
router-id 10.10.10.1;
}
protocols {
ospf {
/* OSPF learned routes will populate this RIB Group */
rib-group OSPF-1;
area 1.1.1.1 {
interface ge-0/0/1.0;
interface lo0.1;
}
}
}
}
}

/*
Routing instance OSPF-2, equivalent to router ospf 2.
*/
routing-instances {
R1-OSPF-2 {
instance-type virtual-router;
interface ge-0/0/0.0;
interface lo0.2;
routing-options {
/* Directly connected interfaces will populate this RIB Group */
interface-routes {

rib-group inet OSPF-2;


/* Needed for lan and ptp interfaces. */
family inet {
export {
point-to-point;
lan;
}
}
}
router-id 192.168.10.1;
}
protocols {
ospf {
/* OSPF learned routes will populate this RIB Group */
rib-group OSPF-2;
area 0.0.0.0 {
interface ge-0/0/0.0;
interface lo0.2;
}
}
}
}
}

/*
Router 2 configuration.
*/
interfaces {
/* Interface under OSPF 2 */
ge-0/0/0 {
unit 0 {
family inet {
address 192.168.1.2/24;
}
}
}
/* Interface under OSPF 1 */
ge-0/0/1 {
unit 0 {
family inet {
address 172.16.1.1/24;
}
}
}
/* Interface under OSPF 1 */
lo0 {
unit 1 {

family inet {
address 172.16.16.1/24;
}
}
}
/* Interface under OSPF 2 */
lo0 {
unit 2 {
family inet {
address 192.168.10.2/24;
}
}
}
}

/*
RIB Groups configuration. Mutual rib import. will also import to default globa
l table inet.0
For OSPF-1 group, R2-OSPF-1 instance is the main table. Wil flood information
to R2-OSPF-2 and default inet.0.
For OSPF-2 group, R2-OSPF-2 instance is the main table. Wil flood information
to R2-OSPF-1 and default inet.0.
*/
routing-options {
rib-groups {
OSPF-1 {
import-rib [ R2-OSPF-1.inet.0 R2-OSPF-2.inet.0 inet.0 ];
}
OSPF-2 {
import-rib [ R2-OSPF-2.inet.0 R2-OSPF-1.inet.0 inet.0 ];
}
}
}
/*
Routing instance R2-OSPF-1, equivalent to router ospf 1.
*/
routing-instances {
R2-OSPF-1 {
instance-type virtual-router;
interface ge-0/0/1.0;
interface lo0.1;
routing-options {
/* Directly connected interfaces will populate this RIB Group */
interface-routes {
rib-group inet OSPF-1;

/* Needed for lan and ptp interfaces. */


family inet {
export {
point-to-point;
lan;
}
}
}
router-id 172.16.16.2;
}
protocols {
ospf {
/* OSPF learned routes will populate this RIB Group */
rib-group OSPF-1;
area 2.2.2.2 {
interface ge-0/0/1.0;
interface lo0.1;
}
}
}
}
}

/*
Routing instance R2-OSPF-2, equivalent to router ospf 2.
*/
routing-instances {
R2-OSPF-2 {
instance-type virtual-router;
interface ge-0/0/0.0;
interface lo0.2;
routing-options {
/* Directly connected interfaces will populate this RIB Group */
interface-routes {
rib-group inet OSPF-2;
/* Needed for lan and ptp interfaces. */
family inet {
export {
point-to-point;
lan;
}
}
}
router-id 192.168.10.2;
}
protocols {
ospf {

/* OSPF learned routes will populate this RIB Group */


rib-group OSPF-2;
area 0.0.0.0 {
interface ge-0/0/0.0;
interface lo0.2;
}
}
}
}
}

You might also like