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-ADJCHANGE: neighbor 10.0.0.1 Up
PRIVATE#sh ip route bgp
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
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 subnetted, 1 subnets
B 8.8.8.8 [20/0] via 10.0.0.1, 00:08:47
PRIVATE#sh ip bgp 8.8.8.8
BGP routing table entry for 8.8.8.8/32, version 2
Paths: (1 available, best #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 IGP, localpref 100, valid, external, best
Community: 65000:3000 // <----- tagged with community
rx pathid: 0, tx pathid: 0x0