BGP syntax Communitites, DPA, and MED

The additional syntax for optional bgp attributes is included in the aspath-opt field of the following GateD statements:

The apath-opt attributes can contain statements for specifying

  1. Communities

    (Click here for more further explanation of Communities

  2. Destination Preference Attribute (DPA)

    (Click here for more further explanation of DPA

  3. MEDs (for testing only)

    (Click here for more further explanation of MED

forms For specifying these are:

  1. Community
  2. DPA

  3. MED - (testing only) forces MED into packet

BGP Group syntax


group type [internal | external] peeras 185 
	aspath-opt {
	[comm-split as-number community-id] 
	[community no-export]
	[community no-advertise]
	[community no-export-sub-confed]
	[dpa] [value] [as [as-value]
	MED [value] 
	}
	{
	peer host-addr;
	}



Examples of this code are:

group type internal peeras 185
	aspath-opt {
	comm-split 3552 90
	community no-export
	community no-advertise
	community no-export-sub-confed
	dpa 20
	MED 30
	}
	{
	peer 198.108.60.43;
	}

group type external peeras 186
	aspath-opt {
	comm-split 20 3552
	community no-export
	community no-advertise
	community no-export-sub-confed
	dpa 20 as 3552
	}
	{
	peer 198.108.60.43;
	}

group type external peeras 65 
	aspath-opt {
	comm-split 3552 20 
	comm-split 3552 21 
	comm-split 3552 22 
	comm-split 3552 23 
	comm-split 3552 24 
	comm-split 3552 25 
	comm-split 3552 26 
	comm-split 3552 27 
	comm-split 3552 28 
	comm-split 3552 29 
	dpa 3552 20
	}
	{
	peer 198.108.60.43;
	}

import syntax


import proto bgp as as-id 
	aspath-opt {
		comm-split as-number community-id
		[community no-export]
		[community no-advertise]
		[community no-export-sub-confed]
		[dpa] [value] [as [as-value]
		MED [value] 
		}
		
	  } [pref [number]]
        {
        route-filter;
        };

Example of this code is:

import proto bgp as 185 
	aspath-opt
		{ 
		comm-split 3552 90
		community no-export
		dpa 20
		}
	{
	128.2 restrict;
	all;
	}

import proto bgp as 186 
	aspath-opt
		{
		dpa 20
		MED 30 
		}
	{
	all;
	}

import proto bgp as 187 
	aspath-opt
		{ 
		dpa 20
		}
	{
	all;
	}



export syntax


export proto bgp as 2750
        {
        proto bgp as 2704 
	aspath-opt {
		[comm-split as-number community-id] 
		[community no-export]
		[community no-advertise]
		[community no-export-sub-confed]
		[dpa] [value] [as [as-value]
		MED [value] 
		}   
		 {
                route-filter
                }
        }

An example of this format is:


export proto bgp as 2750
	{
	proto bgp as 2704
	aspath-opt {
		comm-split 3552 200
		comm-split 3552 100
		dpa 20
		MED 30
		}
	{
	all;
	}; 
	

 
  • This export statement adds the dpa value to a set of routes. export proto bgp as 2750 mod-aspath { [comm-split as-number community-id] [community no-export] [community no-advertise] [community no-export-sub-confed] [dpa] [value] [as [as-value] MED [value] } { proto bgp as 2704 { route-filter; } proto bgp aspath any { route-filter; } }; An example of this format is: export proto bgp as 2750 mod-aspath { comm-split 3552 100 comm-split 3552 101 comm-split 3552 102 dpa 20 } { proto bgp as 2704 { 206.6 masklen 16; 206.20 masklen 16; } proto bgp aspath / .* 2552 .* / { all; } };