Exa-Networks/exabgp — pull request #134 by tehnerd (2014-06-11 12:26:16+00:00)
Title: L2VPN VPLS support

what had been done:
i have added initial support for the l2vpn vpls address-family (AFI 25, SAFI 65)
now exabgp can parse received routes as well as generate it
this implementation is highly untested (i'm using it in the lab; so it's not a problem for us).
i've tested this with Juniper Junos13.2 as a peer router: it was able to receive, accept, readvertise routes from exabgp. as well as bring up vpls connection

NOTE: it seems that your were using instead of <4 spaces> for the indentation. i have "ratabbed" files, which i've edited

example of parsing received routes:
```sh
ExaBGP: Wed, 11 Jun 2014 9:31:15 INFO 27232 neighbor 192.168.201.2 announced route l2vpn:ve:3:base:262145:offset:1:size:8: route-distinguisher 172.30.5.3:49 next-hop 172.30.5.3 origin igp local-preference 100 originator-id 172.30.5.3 cluster-list [ 172.30.0.1 1.1.1.1 ] extended-community [ target:54591:0.0.0.6 L2info:encaps:19:flag:0:mtu:0:site-pref:100 ]
```

example of configuration file (i've added it to the etc/exabgp/ibgp4-l2vpn.txt):
```sh
neighbor 192.168.201.2 {
process parsed-route-backend {
receive-routes;
run etc/exabgp/processes/syslog-1.py;
}

description "parsing l2vpn vpls routes";
router-id 192.168.201.1;
local-address 192.168.201.1;
local-as 54591;
peer-as 54591;
hold-time 180;

l2vpn {
route site4 {
next-hop 192.168.201.1;
origin igp;
as-path [ 30740 30740 30740 30740 30740 30740 30740 ];
local-preference 1;
med 2000;
rd 192.168.201.1:123;
community [ 54591:123];
extended-community [ target:54591:6 l2info:encaps:19:control_flag:0:mtu:1500:site_preference:111];
originator-id 192.168.22.1;
cluster-list [ 3.3.3.3 192.168.201.1 ];
#l2vpn part
ve 5;
block_offset 1;
block_size 8;
label_base 10702;
}
}
}

```

output from Juniper:
```sh
tehnerd@mx240-test> show route receive-protocol bgp 192.168.201.1 extensive table bgp.l2vpn.0

bgp.l2vpn.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
* 192.168.201.1:123:5:1/96 (1 entry, 1 announced)
Accepted
Route Distinguisher: 192.168.201.1:123
Label-base: 10702, range: 8
Nexthop: 192.168.201.1
MED: 2000
Localpref: 1
AS path: 30740 30740 30740 30740 30740 30740 30740 I (Originator)
Cluster list: 3.3.3.3 192.168.201.1
Originator ID: 192.168.22.1
Communities: 54591:123 target:54591:6 Layer2-info: encaps: VPLS, control flags:[0x0] , mtu: 1500, site preference: 111

tehnerd@mx240-test>

```
output from vpls connection:
```sh
Instance: CE3-VPLS
Remote site: 5
Number of local interfaces: 0
Number of local interfaces up: 0
IRB interface present: no
Label-base Offset Size Range Preference
10702 1 0 8 1
connection-site Type St Time last up # Up trans
2 (2) rmt Up Jun 11 15:42:51 2014 1
Remote PE: 192.168.201.1, Negotiated control-word: No
Incoming label: 262149, Outgoing label: 10703
Local interface: lsi.68157449, Status: Up, Encapsulation: VPLS
Description: Intf - vpls CE3-VPLS local site 2 remote site 5

```