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.

While the configuration shown in this recipe provides the minimum needed to access<br />

the router from another system on the network, you should add a few other settings<br />

to the configuration to provide a more robust level of basic network connectivity:<br />

[edit]<br />

root@router1# set system ntp server 192.168.2.100<br />

root@router1# set system time-zone America/Los_Angeles<br />

root@router1# set system services ssh<br />

root@router1# set interfaces lo0 unit 0 family inet address 207.17.139.42/32<br />

root@router1# set system login user aviva class superuser<br />

root@router1# set system log user aviva authentication plain-text-password<br />

New password:<br />

Retype new password:<br />

root@router1# commit<br />

The first command, set system ntp server, configures the IP address of an NTP<br />

server so that the router can set its time properly. Because we have already configured<br />

DNS on the router, you could specify the name of the time server instead of an<br />

IP address and it will be translated to an IP address. To have the router obtain accurate<br />

time from the servers, it is good practice to configure a minimum of four NTP<br />

servers. You can also optionally configure the time zone in which the router is<br />

located (see Recipe 6.2); by default, the time zone is UTC.<br />

To be able to log in to the router over the network using SSH, enable SSH services on<br />

the router with the set system services ssh command. For this to work, SSH must<br />

also be configured on the network servers. SSH is also used to copy files to and from<br />

the router. (The JUNOS SSH uses the Unix scp command.) Note that you can also<br />

copy files with FTP or HTTP (see Recipe 2.1), but these are less secure than SSH. On<br />

routers with two Routing Engines, you can copy files between the two (see Recipe 1.30).<br />

The set interfaces command sets the router’s IP address by configuring an address on<br />

the loopback interface (see Recipe 7.3). The last two commands set up a non-root<br />

user account so an individual user can log in to the router (see Recipe 2.5).<br />

If your router has two Routing Engines, you also need to configure a hostname and<br />

IP address for the second Routing Engine (see Recipe 1.30).<br />

Again, issue the commit command for the configuration changes to take effect:<br />

root@router1# commit<br />

Recipes 1.7, 1.15, and 1.16 explain how the commit operation works, including how<br />

to provisionally commit configuration changes.<br />

At this point, you are logged in to the router as the user root, so you have complete<br />

control over the router. As root, you can perform operational actions that shut down<br />

the router or make it inaccessible to the network. While there are times when you<br />

want to legitimately perform these types of operations, you generally want to make<br />

sure that the router continues to operate normally, and you want to minimize the<br />

chance of accidentally interfering with the router’s operation.<br />

16 | Chapter 1: Router Configuration and File Management<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!