とあるインフラエンジニアの日常

インフラ、ネットワークに囲まれた日常をつらつらと書いていきます。時々旨い酒

SRX100なれはじめ その1(初期設定)

実際にSRX100を開梱して、設定準備をした際のことです。  

外観

  • 全体的にはSSG5とあまり変わらない印象
  • 一番左の電源ボタンでシャットダウン/起動が可能
  • インタフェースやアラームのランプ点灯が少し変わっているので注意

f:id:kurokiyokiyo:20150919232433j:plain

基本操作

下記の3モードを切り替えて操作することで設定をすることになります。

モード名 モード切り替え用のコマンド 操作時のプロンプト 概要
シェルコマンドモード start shell root@% UNIXのシェル操作で機器の設定やステータス確認が可能(rootでログインした際の初期状態)
オペレーショナルモード cli root> JunOSのコマンドでステータス確認、システム操作等が可能(root以外でログインした際の初期状態)
コンフィグレーションモード configure root# JunOSのコマンドで設定変更を行うことができるモード

exitコマンドで1つ前のモードに戻ったりログアウトすることが可能です。

f:id:kurokiyokiyo:20150919232307p:plain

機器の起動/シャットダウン

起動は今までの機器と同様、電源ケーブルを接続すれば良いのですが、問題はシャットダウンです。 JunOSは起動プロンプトを見るとわかるようにタダのUNIX(BSD系)OSです。 そのため、シャットダウンの際は下記どちらかの方法で、所定のシャットダウン操作が必要となります。

  • 機器の一番左、電源ボタンを押下
  • 機器プロンプト上から、下記を実行
root> request system power-off
※再起動の場合はreboot

初期config

初期ユーザーはroot、パス無しでログインできます。

## Last commit: 2015-09-19 11:30:21 UTC by root
version 10.0R1.8;
system {
    autoinstallation {
        delete-upon-commit; ## Deletes [system autoinstallation] upon change/commit
        traceoptions {
            level verbose;
            flag {
                all;
            }
        }
        interfaces {
            fe-0/0/0 {
                bootp;
            }
        }
    }
    name-server {
        208.67.222.222;
        208.67.220.220;
    }
    services {
        ssh;
        telnet;
        web-management {
            http {
                interface vlan.0;
            }
            https {
                system-generated-certificate;
                interface vlan.0;
            }
        }
        dhcp {
            router {
                192.168.1.1;
            }
            pool 192.168.1.0/24 {
                address-range low 192.168.1.2 high 192.168.1.254;
            }
            propagate-settings fe-0/0/0.0;
        }
    }
    syslog {
        archive size 100k files 3;
        user * {
            any emergency;
        }
        file messages {
            any critical;
            authorization info;
        }
        file interactive-commands {
            interactive-commands error;
        }
    }
    max-configurations-on-flash 5;
    max-configuration-rollbacks 5;
    license {
        autoupdate {
            url https://ae1.juniper.net/junos/key_retrieval;
        }
    }
    ## Warning: missing mandatory statement(s): 'root-authentication'
}
interfaces {
    interface-range interfaces-trust {
        member fe-0/0/1;
        member fe-0/0/2;
        member fe-0/0/3;
        member fe-0/0/4;
        member fe-0/0/5;
        member fe-0/0/6;
        member fe-0/0/7;
        unit 0 {
            family ethernet-switching {
                vlan {
                    members vlan-trust;
                }
            }
        }
    }
    fe-0/0/0 {
        unit 0;
    }
    vlan {
        unit 0 {
            family inet {
                address 192.168.1.1/24;
            }
        }
    }
}
security {
    nat {
        source {
            rule-set trust-to-untrust {
                from zone trust;
                to zone untrust;
                rule source-nat-rule {
                    match {
                        source-address 0.0.0.0/0;
                    }
                    then {
                        source-nat {
                            interface;
                        }
                    }
                }
            }
        }
    }
    screen {
        ids-option untrust-screen {
            icmp {
                ping-death;
            }
            ip {
                source-route-option;
                tear-drop;
            }
            tcp {
                syn-flood {
                    alarm-threshold 1024;
                    attack-threshold 200;
                    source-threshold 1024;
                    destination-threshold 2048;
                    timeout 20;
                }
                land;
            }
        }
    }
    zones {
        security-zone trust {
            host-inbound-traffic {
                system-services {
                    all;
                }
                protocols {
                    all;
                }
            }
            interfaces {
                vlan.0;
            }
        }
        security-zone untrust {
            screen untrust-screen;
            interfaces {
                fe-0/0/0.0 {
                    host-inbound-traffic {
                        system-services {
                            dhcp;
                            tftp;
                        }
                    }
                }
            }
        }
    }
    policies {
        from-zone trust to-zone untrust {
            policy trust-to-untrust {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
    }
}
vlans {
    vlan-trust {
        vlan-id 3;
        l3-interface vlan.0;
    }
}