Friday, September 20, 2013

Mini Lab OSPF with Juniper Virtual-Router

Good Friday, Today I will setup mini lab with one Juniper device. That is one reason why JunOS is cool, We can setup one Juniper router/firewall/switch for mini lab and create many scenario for practice and practice, That is cool .. yeah.

We can create so many simple scenario, like for find packet exchange between routing-protocols, test filter, create policy, and other features.


Before prepare and set configuration, connect physical cable between port/interface ge-0/0/0 and ge-0/0/1.



#### Simple Connectivity R0 and R1
#### R0
user@JunOS> show configuration routing-instances R0  
instance-type virtual-router;
interface ge-0/0/0.0;

user@JunOS> show configuration interfaces ge-0/0/0  
unit 0 {
    description "to R1 ge-0/0/1";
    family inet {
        address 172.16.1.10/24;
    }
}

#### R1
user@JunOS> show configuration routing-instances R1 
instance-type virtual-router;
interface ge-0/0/1.0;

user@JunOS> show configuration interfaces ge-0/0/1  
unit 0 {
    description "to R0 ge-0/0/0";
    family inet {
        address 172.16.1.11/24;
    }
}

#### Verify and Ping Test
user@JunOS> ping routing-instance R0 172.16.1.11 source 172.16.1.10 rapid 
PING 172.16.1.11 (172.16.1.11): 56 data bytes
!!!!!
--- 172.16.1.11 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 2.709/3.806/5.937/1.107 ms

user@JunOS> ping routing-instance R1 172.16.1.10 source 172.16.1.11 rapid    
PING 172.16.1.10 (172.16.1.10): 56 data bytes
!!!!!
--- 172.16.1.10 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/stddev = 3.044/4.342/8.891/2.277 ms

user@JunOS> show arp 
MAC Address       Address         Name                      Interface     Flags
b0:c6:9a:xx:yy:zz 172.16.1.10     172.16.1.10               ge-0/0/1.0    none
b0:c6:9a:xx:yy:zz 172.16.1.11     172.16.1.11               ge-0/0/0.0    none
Total entries: 2


#### OSPF between R0 and R1
user@JunOS> configure 
Entering configuration mode

[edit]
user@JunOS# set routing-instances R0 protocols ospf area 0.0.0.0 interface ge-0/0/0.0 

[edit]
user@JunOS# set routing-instances R1 protocols ospf area 0.0.0.0 interface ge-0/0/1.0    

[edit]
user@JunOS# show | compare 
[edit routing-instances R0]
+    protocols {
+        ospf {
+            area 0.0.0.0 {
+                interface ge-0/0/0.0;
+            }
+        }
+    }
[edit routing-instances R1]
+    protocols {
+        ospf {
+            area 0.0.0.0 {
+                interface ge-0/0/1.0;
+            }
+        }
+    }

[edit]
user@JunOS# commit 
commit complete

[edit]
user@JunOS# 

#### Verify OSPF
user@JunOS> show ospf neighbor instance all 
Instance: R0
Address          Interface              State     ID               Pri  Dead
172.16.1.11      ge-0/0/0.0             Full      172.16.1.11      128    33

Instance: R1
Address          Interface              State     ID               Pri  Dead
172.16.1.10      ge-0/0/1.0             Full      172.16.1.10      128    35

user@JunOS> show route table R0 

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

172.16.1.0/24      *[Direct/0] 00:14:12
                    > via ge-0/0/0.0
172.16.1.10/32     *[Local/0] 00:14:12
                      Local via ge-0/0/0.0
224.0.0.5/32       *[OSPF/10] 00:04:07, metric 1
                      MultiRecv

user@JunOS> show route table R1    

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

172.16.1.0/24      *[Direct/0] 00:14:23
                    > via ge-0/0/1.0
172.16.1.11/32     *[Local/0] 00:14:23
                      Local via ge-0/0/1.0
224.0.0.5/32       *[OSPF/10] 00:04:18, metric 1
                      MultiRecv

2 comments:

Unknown said...

Never read the concept of virtual routers.What are the benefits of using these type of routers?

Thanks
Silvester Norman

Change MAC Address

Hermawan Widiyanto said...

Basicly virtual-router is divide routing table, but some of other feature can also separated. The other great way to really separate is logical-system, next time I will compare with that. Thanks.