Thursday, September 2, 2010

Sample JunOS Policy Based Routing




interfaces {
/* outgoing Interface */
ge-0/0/0 {
unit 0 {
family inet {
filter {
input ipvpn-net;
}
address 192.168.1.31/24;
}
}
}
sp-0/0/0 {
unit 0 {
family inet;
}
}

/* Incoming Interface */
ge-0/0/1 {

unit 0 {
family inet {
filter {
input ipvpn-net;
}
address 212.103.93.42/30;
}
}
}
ge-0/0/2 {
unit 0 {
family inet {
address 10.1.1.1/30;
}
}
}
ge-0/0/3 {
unit 0 {
family inet {
address 10.1.2.1/30;
}
}
}
}
routing-options {
interface-routes {
rib-group inet ipvpn;
}
static {
route 0.0.0.0/0 next-hop 192.168.1.1;
route 192.196.1.0/24 next-hop 212.103.93.41;
route 192.197.1.0/24 next-hop 212.103.93.41;
}
rib-groups {
ipvpn {
import-rib [ inet.0 ipvpn.inet.0 ];
}
}
}
firewall {
family inet {
filter ipvpn-net {
term 1 {
from {
source-address {
172.197.1.0/24;
}
}
then {
routing-instance ipvpn;
}
}
term 2 {
then accept;
}
}
}
}
routing-instances {
ipvpn {
instance-type forwarding;
routing-options {
static {
route 0.0.0.0/0 next-hop 10.1.2.2;
}
}
}
}

No comments: