Skip to content

JUNOS config cheat sheat#

interface#

  • sub-if の作成には物理に vlan-tagging を付けること
  • family mpls はLDP用設定
set interfaces et-1/1/1 vlan-tagging 
set interfaces et-1/1/1 unit 100 description sample_interface
set interfaces et-1/1/1 unit 100 vlan-id 100
set interfaces et-1/1/1 unit 100 family inet no-redirects
set interfaces et-1/1/1 unit 100 family inet address 1.1.1.1/30
set interfaces et-1/1/1 unit 100 family inet6 no-redirects
set interfaces et-1/1/1 unit 100 family inet6 address 1:1:1:1::1/64

# set interfaces et-1/1/1 unit 100 family mpls maximum-labels 16

OSPF#

set protocols ospf area 0.0.0.0 interface et-1/1/1.100 interface-type p2p
set protocols ospf area 0.0.0.0 interface et-1/1/1.100 metric 60000
set protocols ospf area 0.0.0.0 interface et-1/1/1.100 bfd-liveness-detection minimum-interval 150
set protocols ospf area 0.0.0.0 interface et-1/1/1.100 bfd-liveness-detection multiplier 3

RSVP#

set protocols rsvp interface et-1/1/1.100

static v4#

set routing-options static route 199.9.9.0/30 discard
set routing-options static route 199.9.9.0/30 tag 184

static v6#

set routing-options rib inet6.0 static route dead:4:1::/64 discard
set routing-options rib inet6.0 static route dead:4:1::/64 tag 184

Explicit-path#

set protocols mpls path Primary-Epath-head 10.10.10.2 strict
set protocols mpls path Primary-Epath-head 1.1.1.1 strict

Tunnel IF#

set protocols mpls label-switched-path sample_tunnel_1 from 1.1.1.1
set protocols mpls label-switched-path sample_tunnel_1 to 2.2.2.2
set protocols mpls label-switched-path sample_tunnel_1 priority 7 7
set protocols mpls label-switched-path sample_tunnel_1 record
set protocols mpls label-switched-path sample_tunnel_1 no-self-ping
set protocols mpls label-switched-path sample_tunnel_1 description sample_tunnel_1
set protocols mpls label-switched-path sample_tunnel_1 node-link-protection
set protocols mpls label-switched-path sample_tunnel_1 track-igp-metric install-v4-prefixes
set protocols mpls label-switched-path sample_tunnel_1 primary Stress-Epath-head

VRF#

set routing-instances sample_1 instance-type vrf
set routing-instances sample_1 route-distinguisher 65000:0
set routing-instances sample_1 vrf-target import target:65000:50
set routing-instances sample_1 vrf-target export target:65000:50

Explicit target LDP#

set protocols mpls path sample_tLDP 10.10.10.2 strict
set protocols mpls path sample_tLDP 1.1.1.1 strict

Targeted LDP interface#

set interfaces et-10/7/3 unit 100 description sample_tLDP
set interfaces et-10/7/3 unit 100 vlan-id 100
set interfaces et-10/7/3 unit 100 family inet no-redirects
set interfaces et-10/7/3 unit 100 family inet address 10.10.10.1/30 broadcast 10.10.10.3
set interfaces et-10/7/3 unit 100 family inet6 address 10:10::1/64
set interfaces et-10/7/3 unit 100 family mpls maximum-labels 16

label-switched-path#

set protocols mpls label-switched-path sample_tLDP from 2.2.2.2
set protocols mpls label-switched-path sample_tLDP to 1.1.1.1
set protocols mpls label-switched-path sample_tLDP ldp-tunneling
set protocols mpls label-switched-path sample_tLDP priority 7 7
set protocols mpls label-switched-path sample_tLDP record
set protocols mpls label-switched-path sample_tLDP description sample_tLDP
set protocols mpls label-switched-path sample_tLDP node-link-protection
set protocols mpls label-switched-path sample_tLDP track-igp-metric install-v4-prefixes
set protocols mpls label-switched-path sample_tLDP primary Primary-Epath-head

connected ldp#

set protocols ldp interface et-10/7/4.400
set protocols ldp interface et-10/7/4.401
set protocols ldp interface et-10/7/4.402
set protocols ldp interface et-10/7/4.403

STRESS DDoS#

set interfaces et-10/7/4 unit 100 description IXIA_stress_vrf_DDoS
set interfaces et-10/7/4 unit 100 vlan-id 100
set interfaces et-10/7/4 unit 100 family inet address 219.52.1.1/30
set interfaces et-10/7/4 unit 100 family inet6 address 219:52:1::1/64

set policy-options prefix-list DDoS_Stress_BGP-PEERS apply-path "routing-instances DDoS protocols bgp group <*> neighbor <*>"
set policy-options prefix-list DDoS_Stress_BGP-PEERS-v6 apply-path "routing-instances DDoS protocols bgp group <*> neighbor <*:*>"
set routing-instances DDoS protocols bgp group DDoS_Stress type external
set routing-instances DDoS protocols bgp group DDoS_Stress import PERMIT
set routing-instances DDoS protocols bgp group DDoS_Stress export Filter
set routing-instances DDoS protocols bgp group DDoS_Stress peer-as 65200
set routing-instances DDoS protocols bgp group DDoS_Stress neighbor 219.52.1.2 description IXIA_Stress_vrf_DDoS
set routing-instances DDoS protocols bgp group DDoS_Stress neighbor 219:52:1::2 description IXIA_Stress_vrf_DDoS

BGP neibor group#

set protocols bgp group sample_iBGP type internal
set protocols bgp group sample_iBGP description stress_iBGP
set protocols bgp group sample_iBGP import PERMIT
set protocols bgp group sample_iBGP export DENY
set protocols bgp group sample_iBGP neighbor 100.52.0.1 local-address 10.90.133.221
set protocols bgp group sample_iBGP neighbor 100.52.0.1 peer-as 65000
set protocols bgp group sample_iBGP neighbor 100:52::1 local-address 200:26:1:200::1001
set protocols bgp group sample_iBGP neighbor 100:52::1 peer-as 65000

set protocols bgp group sample_iBGP type internal
set protocols bgp group sample_iBGP description sample_iBGP
set protocols bgp group sample_iBGP import PERMIT
set protocols bgp group sample_iBGP family inet unicast
set protocols bgp group sample_iBGP family inet6 labeled-unicast
set protocols bgp group sample_iBGP export DENY

iBGPv4#

set protocols bgp group sample_iBGP neighbor 160.52.0.1 local-address 10.90.133.221
set protocols bgp group sample_iBGP neighbor 160.52.0.1 peer-as 65000
set protocols bgp group sample_iBGP neighbor 160.52.0.2 local-address 10.90.133.221
set protocols bgp group sample_iBGP neighbor 160.52.0.2 peer-as 65000
set protocols bgp group sample_iBGP neighbor 160.52.0.3 local-address 10.90.133.221
set protocols bgp group sample_iBGP neighbor 160.52.0.3 peer-as 65000

iBGPv6#

set protocols bgp group sample_iBGP_IPv6 type internal
set protocols bgp group sample_iBGP_IPv6 import PERMIT
set protocols bgp group sample_iBGP_IPv6 export Filter
set protocols bgp group sample_iBGP_IPv6 neighbor 160:52::1 local-address 10:10:10:200::1005
set protocols bgp group sample_iBGP_IPv6 neighbor 160:52::1 peer-as 65000
set protocols bgp group sample_iBGP_IPv6 neighbor 160:52::2 local-address 10:10:10:200::1005
set protocols bgp group sample_iBGP_IPv6 neighbor 160:52::2 peer-as 65000
set protocols bgp group sample_iBGP_IPv6 neighbor 160:52::3 local-address 10:10:10:200::1005
set protocols bgp group sample_iBGP_IPv6 neighbor 160:52::3 peer-as 65000

eBGP v4 v6#

set protocols bgp group sample_eBGP type external
set protocols bgp group sample_eBGP description sample_eBGP
set protocols bgp group sample_eBGP import PERMIT
set protocols bgp group sample_eBGP export DENY
set protocols bgp group sample_eBGP neighbor 170.52.0.2 peer-as 65100
set protocols bgp group sample_eBGP neighbor 170.52.0.6 peer-as 65100
set protocols bgp group sample_eBGP neighbor 170.52.0.10 peer-as 65100

set protocols bgp group sample_eBGP neighbor 170:52:0:1::2 peer-as 65100
set protocols bgp group sample_eBGP neighbor 170:52:0:2::2 peer-as 65100
set protocols bgp group sample_eBGP neighbor 170:52:0:3::2 peer-as 65100

Flow#

set chassis fpc 0 inline-services flow-table-size ipv4-flow-table-size 4
set chassis fpc 0 inline-services flow-table-size ipv6-flow-table-size 4
set chassis fpc 0 inline-services flow-table-size mpls-flow-table-size 4
set chassis fpc 1 sampling-instance monitor-map
set chassis fpc 1 inline-services flow-table-size ipv4-flow-table-size 4
set chassis fpc 1 inline-services flow-table-size ipv6-flow-table-size 4
set chassis fpc 1 inline-services flow-table-size mpls-flow-table-size 4
set chassis fpc 10 sampling-instance monitor-map
set chassis fpc 10 inline-services flow-table-size ipv4-flow-table-size 4
set chassis fpc 10 inline-services flow-table-size ipv6-flow-table-size 4
set chassis fpc 10 inline-services flow-table-size mpls-flow-table-size 4

set services flow-monitoring version9 template flow_ipv4 flow-active-timeout 60
set services flow-monitoring version9 template flow_ipv4 ipv4-template
set services flow-monitoring version9 template flow_ipv6 flow-active-timeout 60
set services flow-monitoring version9 template flow_ipv6 ipv6-template
set services flow-monitoring version9 template flow_mpls flow-active-timeout 60
set services flow-monitoring version9 template flow_mpls mpls-template
set services flow-monitoring version9 template flow_mpls tunnel-observation ipv6

set forwarding-options sampling instance monitor-map family inet output flow-server 1.1.135.35 port 9996
set forwarding-options sampling instance monitor-map family inet output flow-server 1.1.135.35 dscp 48
set forwarding-options sampling instance monitor-map family inet output flow-server 1.1.135.35 version9 template flow_ipv4
set forwarding-options sampling instance monitor-map family inet output flow-server 1.1.195.76 port 9703
set forwarding-options sampling instance monitor-map family inet output flow-server 1.1.195.76 dscp 48
set forwarding-options sampling instance monitor-map family inet output flow-server 1.1.195.76 version9 template flow_ipv4
set forwarding-options sampling instance monitor-map family inet output flow-server 1.1.43.132 port 9996
set forwarding-options sampling instance monitor-map family inet output flow-server 1.1.43.132 dscp 48
set forwarding-options sampling instance monitor-map family inet output flow-server 1.1.43.132 version9 template flow_ipv4


set forwarding-options sampling instance monitor-map family inet6 output flow-server 1.1.135.35 port 9996
set forwarding-options sampling instance monitor-map family inet6 output flow-server 1.1.135.35 dscp 48
set forwarding-options sampling instance monitor-map family inet6 output flow-server 1.1.135.35 version9 template flow_ipv6
set forwarding-options sampling instance monitor-map family inet6 output flow-server 1.1.195.76 port 9703
set forwarding-options sampling instance monitor-map family inet6 output flow-server 1.1.195.76 dscp 48
set forwarding-options sampling instance monitor-map family inet6 output flow-server 1.1.195.76 version9 template flow_ipv6
set forwarding-options sampling instance monitor-map family inet6 output flow-server 1.1.43.132 port 9996
set forwarding-options sampling instance monitor-map family inet6 output flow-server 1.1.43.132 dscp 48
set forwarding-options sampling instance monitor-map family inet6 output flow-server 1.1.43.132 version9 template flow_ipv6

set forwarding-options sampling instance monitor-map family mpls output flow-server 1.1.135.35 port 9996
set forwarding-options sampling instance monitor-map family mpls output flow-server 1.1.135.35 dscp 48
set forwarding-options sampling instance monitor-map family mpls output flow-server 1.1.135.35 version9 template flow_mpls
set forwarding-options sampling instance monitor-map family mpls output flow-server 1.1.195.76 port 9703
set forwarding-options sampling instance monitor-map family mpls output flow-server 1.1.195.76 dscp 48
set forwarding-options sampling instance monitor-map family mpls output flow-server 1.1.195.76 version9 template flow_mpls
set forwarding-options sampling instance monitor-map family mpls output flow-server 1.1.43.132 port 9996
set forwarding-options sampling instance monitor-map family mpls output flow-server 1.1.43.132 dscp 48
set forwarding-options sampling instance monitor-map family mpls output flow-server 1.1.43.132 version9 template flow_mpls