28.06.2014 Views

Discussion

Discussion

Discussion

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1.4 Displaying the Commands to Recreate<br />

a Configuration<br />

Problem<br />

You have a copy of a JUNOS router configuration or you need to duplicate a router<br />

configuration on another router and you want to know the commands to use to create<br />

the configuration.<br />

Solution<br />

Use the following command to list the commands for creating a configuration:<br />

[edit]<br />

aviva@RouterA# show | display set<br />

<strong>Discussion</strong><br />

The show | display set command is a handy way to reverse-engineer a router configuration<br />

when you are trying to duplicate portions of a configuration on many routers<br />

or when you need to write up configuration, monitoring, or troubleshooting<br />

procedures for your network operations staff. This command is especially useful if<br />

the configuration is complex and when setting it up involves many long commands<br />

and lots of typing.<br />

When you pipe the output of the configuration mode show command into the<br />

display set command, the JUNOS CLI prints a list of the commands you need to<br />

issue from that hierarchy level to create the existing configuration. When you use the<br />

command at the top level of the configuration (at the [edit] level), the CLI shows all<br />

the commands necessary to configure the router, which for most routers is a lot of<br />

commands. By way of illustration, here’s a sample of the output for four interfaces<br />

on the router from the [edit interfaces] level:<br />

[edit interfaces]<br />

aviva@RouterA# show | display set<br />

set interfaces fe-0/0/1 unit 0 family inet address 10.0.15.2/24<br />

set interfaces se-0/0/2 unit 0 family inet address 10.0.21.1/24<br />

set interfaces se-0/0/3 serial-options clocking-mode dce<br />

set interfaces se-0/0/3 unit 0 family inet address 10.0.16.1/24<br />

set interfaces lo0 unit 0 family inet address 192.168.13.1/32<br />

You can cut and paste these commands individually or all at once. They produce the<br />

following configuration:<br />

[edit interfaces]<br />

aviva@RouterA# show<br />

fe-0/0/1 {<br />

unit 0 {<br />

family inet {<br />

address 10.0.15.2/24;<br />

Displaying the Commands to Recreate a Configuration | 19<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!