Ethernet Switching
Ethernet Switching

BGP configuration

‎06-06-2019 10:10 PM

Referring to the Figure 1 diagram below, I don't actually understand what is meant by protocol direct? can someone please explain it to me with an example

set policy-options policy-statement send-direct term 1 from protocol direct

 

 

 

https://www.juniper.net/documentation/en_US/junos/topics/example/bgp-advertise-peer-as.html

5 REPLIES 5
Ethernet Switching

Re: BGP configuration

‎06-06-2019 10:18 PM

 

Protocol direct indicates that your  directly connected routes . In the below policy you are matching all your directly connected routes : 

set policy-options policy-statement send-direct term 1 from protocol direct

 

From the fig below address would match with this term 1 

192.168.0.1  << loopback address

10.0.0.0/30   <<< interface subnet

 

You can use the below command to see what all direct routes are there in your box 

 

<<< 

labroot@jtac-mx960-r2016-re0> show route protocol direct

inet.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.219.36.64/26 *[Direct/0] 1w3d 20:17:42
> via fxp0.0
10.220.1.1/32 *[Direct/0] 1w3d 20:17:42
> via lo0.0
10.220.12.0/30 *[Direct/0] 1w3d 20:13:59
> via ae0.0
10.220.51.0/30 *[Direct/0] 1w3d 20:13:57
> via xe-2/1/3.0

Ethernet Switching

Re: BGP configuration

[ Edited ]
‎06-06-2019 10:19 PM

from this doc

 

  • direct—Directly connected route

all networks configured in this RI localy on interfaces, at other verdors it is "connected"

 

Ethernet Switching

Re: BGP configuration

[ Edited ]
‎06-06-2019 10:21 PM

Hi,


When you configure an interface with an IP address, there will be two routes created automatically, one Direct/0 entry for the subnet ( in this example 10.0.0.0/24) and another for local IP address (self IP of the interface) - in this case 10.0.0.2/32


We could use show route protocol direct and show route protocol local to view local routes and their corresponding subnets.


root@juniper> show configuration interfaces ge-0/0/1
unit 0 {
family inet {
address 10.0.0.2/24;
}
}

root@juniper> show route protocol direct


inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.0.0/24 *[Direct/0] 3d 18:16:22
> via ge-0/0/1.0

 

root@juniper> show route protocol local

inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

10.0.0.2/32 *[Local/0] 3d 18:16:34
Local via ge-0/0/1.0
30.0.0.2/32 *[Local/0] 3d 18:16:34
Local via ge-0/0/7.0

 

Regards,
Pradeep 2xJNCIE(SEC/ENT)
Ethernet Switching

Re: BGP configuration

‎06-07-2019 04:35 AM
 
Ethernet Switching

Re: BGP configuration

‎06-07-2019 04:43 AM
Protocol direct is used for the directly connected prefixes. The policy which you have mentioned is one way to advertise directly connected prefixes, its just a way to make things simpler. The other way around to perform same task will be creating a policy to match the prefixes & advertise which would be a lengthy exercise.