-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjuniper-junos-command-reference.html
183 lines (138 loc) · 6.82 KB
/
juniper-junos-command-reference.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Juniper JunOS command reference - kb.haeringer.org</title>
<link href="http://fonts.googleapis.com/css?family=Arimo:400,700|Inika" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/theme/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="/theme/pastie.css" />
<link href="/" type="application/atom+xml" rel="alternate" title="kb.haeringer.org Atom Feed" />
</head>
<body>
<div class="container">
<div class="row">
<div class="span10">
<div id="content">
<div class="header">
<h1>Juniper JunOS command reference</h1>
</br>
</div>
<p class="meta"><small><span><a href="/author/ben/">ben</a> - </span><span>So 03 Juni 2012</span> - <span class="tags"><a href="/tag/Cisco IOS/">Cisco IOS</a>, <a href="/tag/Command reference/">Command reference</a>, <a href="/tag/Juniper/">Juniper</a>, <a href="/tag/JunOS/">JunOS</a></span></small></p>
<div class="entry-content">
<p>When it comes to CLI syntax and handling, some network hardware vendors
more or less try to copy or at least lean on Cisco's IOS. Some may call
it lame, but it definitely makes life easier, because you get on an
unknown device and the chance to just guess the right commands is pretty
high. Juniper is different. Being mainly used to Cisco and Enterasys, I
was pretty much lost - although there are still similarities. Here's an
overview of some basic commands for Juniper's JunOS, especially for
people coming from Cisco IOS ;)<br />
First Hint: Auto-completion is done with Space instead of Tab.</p>
<p>Show complete configuration in JunOS hierarchy style:</p>
<div class="highlight"><pre><span class="o">></span> <span class="n">show</span> <span class="n">configuration</span>
</pre></div>
<p>A more IOS-like <code>show run</code> without the hierarchy structure:</p>
<div class="highlight"><pre><span class="o">></span> <span class="n">show</span> <span class="n">configuration</span> <span class="o">|</span> <span class="n">display</span> <span class="n">set</span>
</pre></div>
<p>Go into config mode (<code>conf t</code>):<!--more--></p>
<div class="highlight"><pre><span class="o">></span> <span class="n">configure</span>
</pre></div>
<p>Go into subcategory, e.g. interfaces:</p>
<div class="highlight"><pre><span class="c"># edit interfaces fe-1/0/0 unit 0</span>
</pre></div>
<p>Three levels/categories up:</p>
<div class="highlight"><pre><span class="c"># up 3</span>
</pre></div>
<p>Equivalents to IOS pipe commands <code>.. | include</code> and <code>.. | exclude</code>:</p>
<div class="highlight"><pre><span class="c"># .. | match</span>
<span class="c"># .. | except</span>
</pre></div>
<p>The following is a very cool feature of JunOS that IOS doesn't offer.
Commands are not transfered to the running configuration immediately,
but are saved to a temporary storage. You can verify a set of commands
before commiting and you can set an automatic rollback in the event you
messed up something and cannot access the device anymore. So no need to
restart the device for a rollback like on IOS with <code>reload in ..</code></p>
<p>Verify commands:</p>
<div class="highlight"><pre><span class="c"># commit check</span>
</pre></div>
<p>Commit the commands and transfer them to the running config:</p>
<div class="highlight"><pre><span class="c"># commit</span>
</pre></div>
<p>Commit the commands and set automatic rollback if the change was not
confirmed after 1 minute:</p>
<div class="highlight"><pre><span class="c"># commit confirmed 1</span>
</pre></div>
<p>Show all uncommited commands:</p>
<div class="highlight"><pre><span class="c"># show | compare</span>
</pre></div>
<p>Delete all uncommited commands:</p>
<div class="highlight"><pre><span class="c"># rollback</span>
</pre></div>
<p>Equivalent to IOS <code>show ip interface brief</code>:</p>
<div class="highlight"><pre><span class="c"># show interfaces terse</span>
</pre></div>
<p>IOS <code>show interface fe1/0/1</code> & plus L2 error output:</p>
<div class="highlight"><pre><span class="c"># show interfaces fa-1/0/1 detail</span>
<span class="c"># show interfaces fa-1/0/1 extensive</span>
</pre></div>
<p>VLAN overview (note: interfaces without descriptions are not
displayed!):</p>
<div class="highlight"><pre><span class="c"># show interfaces descriptions</span>
</pre></div>
<p>VLAN configuration:</p>
<div class="highlight"><pre><span class="c"># show conf interface xe-2/2/0.2</span>
</pre></div>
<p>STP config:</p>
<div class="highlight"><pre><span class="c"># show 802</span>
</pre></div>
<p>Configure VLAN tagging for VLAN 150, a logical interface 150 (IOS
subinterface = JunOS logical interface unit!) + IP adress in subnet
.150:</p>
<div class="highlight"><pre><span class="c"># edit interfaces fe-1/0/1</span>
<span class="c"># set vlan-tagging</span>
<span class="c"># set unit 150 vlan-id 150</span>
<span class="c"># set unit 150 family inet address 192.168.150.1/24</span>
</pre></div>
<p>IOS <code>show ip route</code>; set static + default route:</p>
<div class="highlight"><pre><span class="c"># show route</span>
<span class="c"># set static route 10.11.0.0/24 next-hop 10.210.8.190</span>
<span class="c"># set static route default next-hop 10.210.8.190</span>
</pre></div>
<p>Routing troubleshooting - show unused routes etc.:</p>
<div class="highlight"><pre><span class="c"># show route hidden (extensive)</span>
<span class="c"># show route 172.16.24.0/21 (exact) (detail/extensive)</span>
</pre></div>
<p>OSPF:</p>
<div class="highlight"><pre><span class="c"># edit protocols ospf</span>
<span class="c"># set area 2 interface fe-0/0/0.0</span>
<span class="c"># set area 2 stub</span>
</pre></div>
</div><!-- /.entry-content -->
</div>
</div>
<div class="span2">
<div class="well">
<ul class="nav nav-list">
<li class="nav-header">Blog</li>
<!-- <li ><a href="">Home</a></li> -->
<li ><a href="index.html">Home</a></li>
<li ><a href="/tags/">Tags</a></li>
<li ><a href="/archives/">Archive</a></li>
<li class="nav-header">Pages</li>
<li><a href="/pages/about.html">About</a></li>
</ul>
</div><!-- /#menu -->
</div>
</div>
<hr />
<div class="row">
<div class="span12">
<div id="about">
<p>Proudly powered by <a href="http://twitter.github.com/bootstrap/">bootstrap</a>, <a href="http://docs.notmyidea.org/alexis/pelican/">pelican</a>, <a href="http://python.org">python</a> and <a href="http://www.julo.ch/about/">Alex</a></p>
</div><!-- /#about -->
</div><!-- /#contentinfo -->
</div>
</div>
</body>
</html>