Juniper Lab I part 3
In the previous posts we configured the interfaces, ospf, bgp, rsvp, mpls and mbgp. In this post we will configure a vrf (routing-instance) named VPNA.
Below is the lab topology again which we use for this lab :

As you can see the vrf VPNA resides on Router 1 and Router 4. For testing purposes I configured two interfaces in it which should be able to ping each other from within the routing-instance after we are finished.
Below is the configuration of VPNA on Router 1 :
Router 1 :
|
|
|
set policy-options community VPNA members target:65000:104
set routing-instances VPNA instance-type vrf
set routing-instances VPNA interface fxp1.10
set routing-instances VPNA route-distinguisher 65000:1
set routing-instances VPNA vrf-import import-VPNA
set routing-instances VPNA vrf-export export-VPNA
set routing-instances VPNA vrf-table-label
|
Although it would also be possible to control the import and export of routes by issuing the “set routing-instances VPNA vrf-target target:65000:104″ command we are not going to configure it like that because we want to exactly be in control what routes come in and go out of the routing-instance.
The import and export policies define what routes are getting imported and exported, below the policies specified :
Policies:
|
|
|
set policy-options policy-statement export-VPNA term 10 from protocol direct
set policy-options policy-statement export-VPNA term 10 from route-filter 11.11.11.0/24 exact
set policy-options policy-statement export-VPNA term 10 then community add VPNA
set policy-options policy-statement export-VPNA then accept
set policy-options policy-statement export-VPNA term REJECT then reject
set policy-options policy-statement import-VPNA term 10 from protocol bgp
set policy-options policy-statement import-VPNA term 10 from community VPNA
set policy-options policy-statement import-VPNA term 10 then accept
set policy-options policy-statement import-VPNA term REJECT then reject
|
Below is the configuration of VPNA on Router 4 :
Router 4 :
|
|
|
set policy-options community VPNA members target:65000:104
set routing-instances VPNA instance-type vrf
set routing-instances VPNA interface fxp3.30
set routing-instances VPNA route-distinguisher 65000:4
set routing-instances VPNA vrf-import import-VPNA
set routing-instances VPNA vrf-export export-VPNA
set routing-instances VPNA vrf-table-label
|
Policies:
|
|
|
set policy-options policy-statement export-VPNA term 10 from protocol direct
set policy-options policy-statement export-VPNA term 10 from route-filter 44.44.44.0/24 exact
set policy-options policy-statement export-VPNA term 10 then community add VPNA
set policy-options policy-statement export-VPNA term 10 then accept
set policy-options policy-statement export-VPNA term REJECT then reject
set policy-options policy-statement import-VPNA term 10 from protocol bgp
set policy-options policy-statement import-VPNA term 10 from community VPNA
set policy-options policy-statement import-VPNA term 10 then accept
set policy-options policy-statement import-VPNA term REJECT then reject
|
Below the route table of routing-instance VPNA on Router 1 :
Router 1 :
|
|
|
chris@IPLOGIC-1# run show route table VPNA
VPNA.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
11.11.11.0/24 *[Direct/0] 01:55:27
> via fxp1.10
11.11.11.1/32 *[Local/0] 01:55:27
Local via fxp1.10
44.44.44.0/24 *[BGP/170] 00:03:38, localpref 100, from 4.4.4.4
AS path: I
> to 10.0.12.2 via fxp3.120, label-switched-path R1-to-R4
to 10.0.13.3 via fxp2.130, label-switched-path R1-to-R4
|
Below the route table of routing-instance VPNA on Router 1 :
Router 4 :
|
|
|
chris@IPLOGIC-4# run show route table VPNA
VPNA.inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
11.11.11.0/24 *[BGP/170] 00:04:31, localpref 100, from 1.1.1.1
AS path: I
> to 10.0.24.2 via fxp1.240, label-switched-path R4-to-R1
to 10.0.34.3 via fxp2.340, label-switched-path R4-to-R1
44.44.44.0/24 *[Direct/0] 01:51:24
> via fxp3.30
44.44.44.4/32 *[Local/0] 01:51:24
Local via fxp3.30
|
Now let’s ping ip address 44.44.44.4 from source-address 11.11.11.1 from within routing-instance VPNA :
Router 1 :
|
|
|
chris@IPLOGIC-1# run ping routing-instance VPNA 44.44.44.4 source 11.11.11.1
PING 44.44.44.4 (44.44.44.4): 56 data bytes
64 bytes from 44.44.44.4: icmp_seq=0 ttl=64 time=4.680 ms
64 bytes from 44.44.44.4: icmp_seq=1 ttl=64 time=1.064 ms
64 bytes from 44.44.44.4: icmp_seq=2 ttl=64 time=1.122 ms
^C
--- 44.44.44.4 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 1.064/2.289/4.680/1.691 ms
|