• About

blog.alam.rocks

blog.alam.rocks

Tag Archives: junos

Analyse JunOS XML output using PHP

07 Tuesday Jul 2015

Posted by Fakrul Alam in My Work

≈ 1 Comment

Tags

junos, PHP, XML

In JunOS you can export any output in XML. For example you can try:

show route protocol bgp | display xml

This will show you all the BGP routing table but in XML format. Which will look like:

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/12.3R4/junos">
<route-information xmlns="http://xml.juniper.net/junos/12.3R4/junos-routing">
<!-- keepalive -->
<route-table>
<table-name>inet.0</table-name>
<destination-count>547112</destination-count>
<total-route-count>547137</total-route-count>
<active-route-count>547112</active-route-count>
<holddown-route-count>0</holddown-route-count>
<hidden-route-count>1</hidden-route-count>
<rt junos:style="brief">
<rt-destination>0.0.0.0/0</rt-destination>
<rt-entry>
<active-tag> </active-tag>
<protocol-name>BGP</protocol-name>
<preference>170</preference>
<age junos:seconds="106012">1d 05:26:52</age>
<local-preference>100</local-preference>
<as-path>10102 9498 I
</as-path>
<validation-state>unknown</validation-state>
<nh>
<selected-next-hop/>
<to>103.4.109.169</to>
<via>ge-1/0/0.0</via>
</nh>
</rt-entry>
</rt>

Continue reading →

traceroute follow MPLS label (inet.3)

06 Sunday Apr 2014

Posted by Fakrul Alam in Uncategorized

≈ Leave a comment

Tags

junos, mpls

inet.0 is the route table used for regular IGP recursion. Inet.3 is only used by BGP to resolve next-hops by default. This means that only traffic sent to destinations learned by BGP will be label-switched.

If you have a requirement that all traffic uses labeled next-hops you can move routes from inet.3 into inet.0

set protocols mpls traffic-engineering bgp-igp-both-ribs

Before

dhakacom@rt-01-mx.dhakacom.com> show route 118.179.191.6
inet.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
118.179.191.6/32 *[OSPF/10] 3d 02:49:03, metric 2
 > to 202.4.100.21 via ge-1/0/0.0
inet.3: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
118.179.191.6/32 *[LDP/9] 08:40:00, metric 1> to 202.4.100.21 via ge-1/0/0.0, Push 299936

After

dhakacom@rt-01-mx.dhakacom.com> show route 118.179.191.6
inet.0: 20 destinations, 26 routes (20 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
118.179.191.6/32 *[LDP/9] 00:05:42, metric 1
 > to 202.4.100.21 via ge-1/0/0.0, Push 299936
 [OSPF/10] 00:06:34, metric 2
 > to 202.4.100.21 via ge-1/0/0.0
inet.3: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
118.179.191.6/32 *[LDP/9] 00:02:37, metric 1
 > to 202.4.100.21 via ge-1/0/0.0, Push 299936

VPLS (Juniper)

06 Sunday Apr 2014

Posted by Fakrul Alam in Uncategorized

≈ Leave a comment

Tags

junos, MPLS L2VPN, VPLS

Configure Interface for VPLS

set interfaces ge-1/0/9 encapsulation ethernet-vpls
set interfaces ge-1/0/9 unit 0 family vpls

Enable l2vpn singaling for BGP 

set protocols bgp group INTERNAL_ROUTER family l2vpn signaling

Create VRF for CUSTOMER

set routing-instances CUSTOMER instance-type vpls
set routing-instances CUSTOMER interface ge-1/0/9.0
set routing-instances CUSTOMER route-distinguisher 100:1
set routing-instances CUSTOMER vrf-target target:100:1
set routing-instances CUSTOMER protocols vpls no-tunnel-services
set routing-instances CUSTOMER protocols vpls site R6 site-identifier 3
set routing-instances CUSTOMER protocols vpls site R6 interface ge-1/0/9.0

For other site only site-identifier will be different. Check the connection status:

fakrulm@rt-3-mx.dhakacom.com> show vpls connections 
Instance: CUSTOMER 
 Local site: R6 (3) 
 connection-site Type St Time last up # Up trans 
 2 rmt Up Apr 6 13:25:06 2014 1 
 Remote PE: 118.179.191.2, Negotiated control-word: No 
 Incoming label: 262146, Outgoing label: 262147 
 Local interface: lsi.1048577, Status: Up, Encapsulation: VPLS 
 Description: Intf - vpls CUSTOMER local site 3 remote site 2

Social

  • View rapappu’s profile on Twitter
  • View fakrulalam’s profile on LinkedIn
  • View fakrul’s profile on GitHub
  • View FakrulAlamPappu’s profile on Google+
  • View fakrulalam’s profile on Flickr

Twitter Updates

  • #sydeny #summer https://t.co/4FhMTbgG1g 1 week ago
  • RT @protocoljournal: The August 2022 issue of IPJ is ready. Head over to protocoljournal.org for your copy! https://t.co/c0dfwBQAuu 3 weeks ago
  • RT @teamcymru: Take The first step toward clarity, visibility, and reducing external asset related risks With our free Attack Surface Asses… 3 weeks ago
  • RT @akanygren: Have you been working with tech for years and want an overview of #IPv6? I've been working on an open source "Inessential I… 1 month ago
  • blog.lastpass.com/2022/11/notice… 2 months ago
  • #bdnog15 CfP is now open bdnog.org/bdnog15/cfp.php #bdnog #bangladesh #nog #networkoperatorsgroup 2 months ago
  • RT @Cloudflare: Today we’re introducing Cloudflare Radar’s route leak data and API so that anyone can get information about route leaks acr… 2 months ago
  • Battling Zimbabwe fall short as Bangladesh win in chaotic final-over finish espncricinfo.com/series/icc-men… #t20 #worldcup #bangladeh 3 months ago
  • RT @vince2_: With the team @Free_1337, we have developed a Netflow/IPFIX collector and visualizer. It is available at https://t.co/6XtpOtm9… 6 months ago
  • RT @openbsdnow: Effective Shell effective-shell.com 7 months ago
  • RT @nocontextfooty: https://t.co/PU0JeRSrbD 7 months ago
  • smallstep.com/blog/if-openss… 7 months ago
  • github.com/tldr-pages/tldr 9 months ago
  • How to properly interpret a traceroute or MTR | APNIC Blog blog.apnic.net/2022/03/28/how… 9 months ago
  • #dayandnight #Newcastle #beachlife https://t.co/LaKATcEsFY 10 months ago
Follow @rapappu

Tags

antismap antivirus automation Azure bangladesh BASH BASH Script BDCERT bgp bind ccsp centos CentOS mirror CERT CISA cisco Cyber Security ddos dhaka dhakacom DNS DNSSEC GSM intrusion detectoin system Intrusion prevention system ips IPv6 ISACA junos linux Looking Glass lxc lxc profile lxd mailqueue mailscanner Mail Server mailwatch Meraki mikrotik monitor mpls MPLS L3 VPN mysql My Work network network management nginx NSD observium OpenVPN perl PHP ping postfix Proxy PTA python RANCID Reading RPKI Shell Script sms sms server SNMP SSH Tutorial ubuntu Ubuntu Mirror Server Virtual Box vispan vmware websvn Youtube hack খামাখা

Blog at WordPress.com.

  • Follow Following
    • blog.alam.rocks
    • Join 27 other followers
    • Already have a WordPress.com account? Log in now.
    • blog.alam.rocks
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar