忍者ブログ

しこてぃっしゅβ

日々の忘備録代わりと、チラシのウラで。

   

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

Juniper 基本設定

目指せJNCIA-Junos!


と、いうことで今回からはJunosでの実際の設定方法などです。




Junosは起動直後、root権限にパスワードが設定されていません。




login: root
Last login: Mon Sep 24 02:46:18 on ttyd0


--- JUNOS 10.4R1.9 built 2010-12-04 09:20:43 UTC
root@%




上記のようにLogin時にrootを入力してenterするとそのままsystemにログインできてしまいます。


したがって、まずはroot権限のセキュリティレベルを上げなければなりません。


また、Junosは基本的にOperaterとして操作しますので、新規userを作成する必要があります。


続いて、シェルの変更です。


Junos起動時はshellモードとなっています。


shellモードでは基本的なコマンドしか実行できないため、まずはcliモードに移行します。





root@%
root@% cli
root>




プロンプトが @% から > に変更されます。


cliモードでは他のネットワーク機器と同様なCLIでの操作が可能となります。


例えば、 ? を入力するとコマンドヘルプが表示されます。


このcliモードがCiscoでのenableモードと同等の階層となります。




root> ?
Possible completions:
  clear                Clear information in the system
  configure            Manipulate software configuration information
  file                 Perform file operations
  help                 Provide help information
  monitor              Show real-time debugging information
  mtrace               Trace multicast path from source to receiver
  op                   Invoke an operation script
  ping                 Ping remote target
  quit                 Exit the management session
  request              Make system-level requests
  restart              Restart software process
  set                  Set CLI properties, date/time, craft interface message
  show                 Show system information
  ssh                  Start secure shell on another host
  start                Start shell
  telnet               Telnet to another host
  test                 Perform diagnostic debugging
  traceroute           Trace route to remote host
root>




次は、Configureモードへの変更です。


cliモードでは設定変更が出来ないため、Configureモードへと移行します。


configreモードがCiscoでのConfigモードと同等の階層となります。


Configureモードへの移行は以下のコマンドを実行します。


configure





root> configure
Entering configuration mode
The configuration has been changed but not committed


[edit]
root#




プロンプトが > から # に変更されます。


なお、CLIモードではCisco機器のようにTab補完が可能です。


デフォルトでは起動時にRootのパスワードが設定されていません。


したがって、systemを操作するためにまずはRootのパスワードを設定します。


Rootのパスワード設定コマンドは以下です。


set system root-authentication plain-text-password





root# set system root-authentication plain-text-password
New password:
Retype new password:


[edit]
root#





root-authenticationコマンドを実行すると、RootのNewパスワードを問われますのでここでRootのパスワードを入力します。


基本的に6文字以上のパスワードを入力します。


Retype passwordではNew passwordで設定したRootパスワードと同じ文字列を入力します。


 


ここまでの設定を一度確認してみましょう。


設定情報の確認は以下のコマンドを実行します。





show | compare


[edit]
root# show | compare
[edit system]
+   root-authentication {
+       encrypted-password "$1$hbwVIYd6$5CQKVoeMgz5yM680VYAwG0"; ## SECRET-DATA
+   }


[edit]
root#




+ が付与されている箇所が追加で変更された部分となります。


なお、showコマンドに | compare を追加することにより、追加部分のみを出力させることが可能です。


Rootのパスワード登録が完了したら、続いてJunosを操作するUserの登録を行ないます。


Junosでは予め以下のclassが存在しますので、新規Userの操作範囲によって適切なclassを設定することが重要です。


1.super-user
  rootと同じ権限を持っています。

2.operator
  一部コマンドが制限されています。

3.read-only
  showコマンドのみ実行できます。

4.unauthorized
  何も実行することができません。


ここでは以下のコマンドでARIADSTというUserをSuper-User権限で新規追加します。


set system login user ARIADST authentication plain-text-password
set system login user ARIADST class super-user





root# set system login user ARIADST authentication plain-text-password
New password:
Retype new password:


[edit]
root# set system login user ARIADST class super-user


[edit]
root#




上記は、authenticationコマンドで新規User ARIADSTのパスワードを設定、classコマンドでclassの定義をしています。


 


それでは、設定情報の確認です。


ここまでの設定情報をshowコマンドで確認します。





root# show
## Last changed: 2012-09-24 04:31:57 UTC
version 10.4R1.9;
system {
    root-authentication {
        encrypted-password "$1$hbwVIYd6$5CQKVoeMgz5yM680VYAwG0"; ## SECRET-DATA
    }
    login {
        user ARIADST {
            class super-user;
            authentication {
                encrypted-password "$1$XJV/XfV8$YKLiRAIyl1wCvGR0998YD1"; ## SECRET-DATA
            }
        }
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}


[edit]
root#




ここまで設定出来たら、設定を保存します。


設定を保存するには以下のコマンドを実行します。


commit





[edit]
PPS# commit
commit complete


[edit]
PPS#




また、commitコマンドを実行した場合、設定を元に戻したい場合があれば rollback コマンドを実行して設定を元に戻します。


rollbackコマンドでは設定を最大50世代前までロールバックすることが可能です。


設定の保存が完了したら、一度logoutし、再度作成した新規Userでloginします。


ログイン後のプロンプトでUser名が表示されれば設定は完了です。


なお、Junosでは基本的にrootモードではloginしません。


 






PR

カレンダー

06 2024/07 08
S M T W T F S
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

忍者カウンター

Copyright ©  -- しこてぃっしゅβ --  All Rights Reserved
Design by CriCri / Photo by Geralt / powered by NINJA TOOLS / 忍者ブログ / [PR]