| 用的是qemu,junos7.2。其他的版本还没有测试过。root# show
 version 7.2R4.2;
 system {
 syslog {
 user * {
 any emergency;
 }
 file messages {
 any notice;
 authorization info;
 }
 file interactive-commands {
 interactive-commands any;
 }
 }
 }
 logical-routers {
 r1 {
 interfaces {
 fxp1 {
 unit 12 {
 vlan-id 12;
 family inet {
 address 133.10.12.1/24;
 }
 }
 }
 lo0 {
 unit 1 {
 family inet {
 address 133.10.1.1/32;
 }
 }
 }
 }
 routing-options {
 static {
 route 133.10.4.4/32 next-hop 133.10.12.2;
 }
 router-id 133.10.1.1;
 }
 }
 r2 {
 interfaces {
 fxp2 {
 unit 12 {
 vlan-id 12;
 family inet {
 address 133.10.12.2/24;
 }
 family mpls;
 }
 unit 23 {
 vlan-id 23;
 family inet {
 address 133.10.23.2/24;
 }
 family mpls;
 }
 }
 lo0 {
 unit 2 {
 family inet {
 address 133.10.2.2/32;
 }
 }
 }
 }
 protocols {
 mpls {
 interface fxp2.23;
 }
 bgp {
 group to-r3 {
 type internal;
 local-address 133.10.2.2;
 family inet-vpn {
 unicast;
 }
 neighbor 133.10.3.3 {
 peer-as 65000;
 }
 }
 }
 ospf {
 area 0.0.0.0 {
 interface fxp2.23;
 interface lo0.2;
 }
 }
 ldp {
 interface fxp2.23;
 }
 }
 policy-options {
 policy-statement bgp-ospf {
 from {
 protocol bgp;
 neighbor 133.10.3.3;
 }
 then accept;
 }
 community vpn-comm members target:100:1;
 }
 routing-instances {
 vpn-provider {
 instance-type vrf;
 interface fxp2.12;
 route-distinguisher 100:1;
 vrf-target target:100:1;
 vrf-table-label;
 routing-options {
 static {
 route 133.10.1.1/32 next-hop 133.10.12.1;
 }
 }
 }
 }
 routing-options {
 router-id 133.10.2.2;
 autonomous-system 65000;
 }
 }
 r3 {
 interfaces {
 fxp1 {
 unit 23 {
 vlan-id 23;
 family inet {
 address 133.10.23.3/24;
 }
 family mpls;
 }
 unit 34 {
 vlan-id 34;
 family inet {
 address 133.10.34.3/24;
 }
 family mpls;
 }
 }
 lo0 {
 unit 3 {
 family inet {
 address 133.10.3.3/32;
 }
 }
 }
 }
 protocols {
 mpls {
 interface fxp1.23;
 }
 bgp {
 group to-r2 {
 type internal;
 local-address 133.10.3.3;
 family inet-vpn {
 unicast;
 }
 neighbor 133.10.2.2 {
 peer-as 65000;
 }
 }
 }
 ospf {
 area 0.0.0.0 {
 interface fxp1.23;
 interface lo0.3;
 }
 }
 ldp {
 interface fxp1.23;
 }
 }
 policy-options {
 policy-statement bgp-ospf {
 from {
 protocol bgp;
 neighbor 133.10.2.2;
 }
 then accept;
 }
 community vpn-comm members target:100:1;
 }
 routing-instances {
 vpn-provider {
 instance-type vrf;
 interface fxp1.34;
 route-distinguisher 100:1;
 vrf-target target:100:1;
 vrf-table-label;
 protocols {
 ospf {
 export bgp-ospf;
 area 0.0.0.0 {
 interface fxp1.34;
 }
 }
 }
 }
 }
 routing-options {
 router-id 133.10.3.3;
 autonomous-system 65000;
 }
 }
 r4 {
 interfaces {
 fxp2 {
 unit 34 {
 vlan-id 34;
 family inet {
 address 133.10.34.4/24;
 }
 }
 }
 lo0 {
 unit 4 {
 family inet {
 address 133.10.4.4/32;
 }
 }
 }
 }
 protocols {
 ospf {
 area 0.0.0.0 {
 interface all;
 }
 }
 }
 routing-options {
 router-id 133.10.4.4;
 }
 }
 }
 interfaces {
 fxp0 {
 unit 0 {
 family inet {
 address 192.68.0.117/24;
 }
 }
 }
 fxp1 {
 vlan-tagging;
 }
 fxp2 {
 vlan-tagging;
 }
 fxp3 {
 vlan-tagging;
 }
 }
 |