Evil_TTL> show | s

Juniper SRX Static Route BGP Community Export

Category:Juniper -> Routing and Switching

vSRX configuration:

//Configure static route(-s) and set community
set policy-options community STATIC members 65000:3000
set routing
-options static route 8.8.8.8/32 qualified-next-hop 172.16.1.2 interface ge-0/0/3.100
set routing
-options static route 8.8.8.8/32 community 65000:3000

//Configure BGP import and export policies
set policy-options policy-statement LAN_EXPORT term 10 from community STATIC
set policy-options policy-statement LAN_EXPORT term 10 then accept
set policy
-options policy-statement LAN_EXPORT term 1000 then reject
set policy
-options policy-statement LAN_IMPORT term 10 from protocol bgp
set policy
-options policy-statement LAN_IMPORT term 10 then accept
set policy
-options policy-statement LAN_IMPORT term 1000 then reject

//Configure BGP protocol and neighbours
set routing-options autonomous-system 65000
set protocols bgp graceful
-restart
set protocols bgp group LAN type external
set protocols bgp group LAN hold
-time 21
set protocols bgp group LAN import LAN_IMPORT
set protocols bgp group LAN export LAN_EXPORT
set protocols bgp group LAN peer
-as 65001
set protocols bgp group LAN neighbor 10.0.0.2 

BGP neighbour PIV:

PRIVATE(config)#router bgp 65001
PRIVATE(config-router)#neighbor 10.0.0.1 remote-as 65000
PRIVATE(config-router)#
*Mar 24 22:23:36.824: %BGP-5-ADJCHANGEneighbor 10.0.0.1 Up 

PRIVATE#sh ip route bgp 
Codeslocalconnected- static, RIPmobileBGP
       D 
EIGRPEX EIGRP externalOSPFIA OSPF inter area 
       N1 
OSPF NSSA external type 1N2 OSPF NSSA external type 2
       E1 
OSPF external type 1E2 OSPF external type 2
       i 
IS-ISsu IS-IS summaryL1 IS-IS level-1L2 IS-IS level-2
       ia 
IS-IS inter area, * - candidate default, per-user static route
       o 
ODRperiodic downloaded static routeNHRPLISP
       a 
application route
       
+ - replicated route, % - next hop override

Gateway of last resort is 10.0.0.1 to network 0.0.0.0

      8.0.0.0
/32 is subnetted1 subnets
B        8.8.8.8 [20
/0] via 10.0.0.100:08:47


PRIVATE#sh ip bgp 8.8.8.8
BGP routing table entry for 8.8.8.8/32version 2
Paths
: (1 availablebest #1, table default)
  
Not advertised to any peer
  Refresh Epoch 1
  65000
    10.0.0.1 from 10.0.0.1 
(10.0.0.1)
      
Origin IGPlocalpref 100validexternalbest
      Community
65000:3000       // <----- tagged with community
      
rx pathid0tx pathid0x0 
By privilege15