labunix's blog

labunixのラボUnix

【小休憩】この先に進む前にvSRXの簡単な正常性確認をしてみる。

■【小休憩】この先に進む前にvSRXの簡単な正常性確認をしてみる。

 vmplayerでvSRXを試す。
 http://labunix.hateblo.jp/entry/20150412/1428767862

 vSRXの電源OFFを行うタイミングについて確認してみる。
 http://labunix.hateblo.jp/entry/20150830/1440878778

■シングル構成でのバージョンとルーティングエンジンの確認。

$ ssh root@192.168.152.15
Password:
root@% cli
root> show version 
Model: firefly-perimeter
JUNOS Software Release [12.1X47-D20.7]
root> show chassis routing-engine 
Routing Engine status:
    Total memory              2048 MB Max   901 MB used ( 44 percent)
      Control plane memory    1150 MB Max   345 MB used ( 30 percent)
      Data plane memory        898 MB Max   566 MB used ( 63 percent)
    CPU utilization:
      User                       1 percent
      Background                 0 percent
      Kernel                     1 percent
      Interrupt                  0 percent
      Idle                      98 percent
    Model                          FIREFLY-PERIMETER RE
    Start time                     2015-09-02 20:31:41 JST
    Uptime                         4 minutes, 12 seconds
    Last reboot reason             Router rebooted after a normal shutdown.
    Load averages:                 1 minute   5 minute  15 minute
                                       0.10       0.38       0.21

■コンソールログインユーザとリモートログインユーザ

root> show system users 
 8:42PM  up 11 mins, 2 users, load averages: 0.00, 0.09, 0.12
USER     TTY      FROM                              LOGIN@  IDLE WHAT
root     v0       -                                8:32PM      8 cli           
root     p0       192.168.152.1                    8:35PM      - cli           

■ハードウエア情報の確認

root> show chassis hardware 
Hardware inventory:
Item             Version  Part number  Serial number     Description
Chassis                                XXXXXXXXXXXX      FIREFLY-PERIMETER
Midplane        
System IO       
Routing Engine                                           FIREFLY-PERIMETER RE
FPC 0                                                    Virtual FPC
  PIC 0                                                  Virtual GE
Power Supply 0  

■稼働時間の確認

root> show system uptime 
Current time: 2015-09-02 20:52:24 JST
System booted: 2015-09-02 20:31:42 JST (00:20:42 ago)
Protocols started: 2015-09-02 20:32:08 JST (00:20:16 ago)
Last configured: 2015-09-02 20:47:16 JST (00:05:08 ago) by root
 8:52PM  up 21 mins, 2 users, load averages: 0.03, 0.03, 0.06

■ifconfig/ipconfig風のコマンド。

root> show interfaces routing detail ge*                  
ge-0/0/0.0
  Index: 69, Refcount: 2, State: <Up Broadcast Multicast> Change: <>
  0 metric, 0 up/down transitions, reth state 0, full-duplex
  Link layer: Ethernet Encapsulation: Ethernet Bandwidth: 1000Mbps
  Link address #0 0.c.29.5b.1a.c8
  INET address 192.168.152.15
    State: <Up Broadcast Multicast Localup> Change: <> Flags: <RT-Change>
    Preference 0, metric 0, MTU 1500 bytes
    Broadcast address 192.168.152.255
    Destination: 192.168.152.0/24
    System flags: <Is-Default Is-Preferred Is-Primary>

■L2情報の確認

root> show arp    
MAC Address       Address         Name                      Interface           Flags
00:50:56:c0:00:08 192.168.152.1   192.168.152.1             ge-0/0/0.0          none

■L3アドレスの確認

root> show interfaces routing brief 
Interface        State Addresses
sp-0/0/0.16383   Up    INET  enabled
                       INET  10.0.0.1
                       INET  10.0.0.6
                       INET  128.0.0.1
                       INET  128.0.0.6
sp-0/0/0.0       Up    INET  enabled
                       INET6 enabled
ge-0/0/0.0       Up    INET  192.168.152.15
lo0.32768        Up
lo0.16385        Up    INET  10.0.0.1
                       INET  10.0.0.16
                       INET  128.0.0.1
                       INET  128.0.0.4
                       INET  128.0.1.16
lo0.16384        Up    INET  127.0.0.1

■物理NICのIPアドレスの確認

root> show interfaces | grep "Dest|Logical"   
  Logical interface ge-0/0/0.0 (Index 69) (SNMP ifIndex 508) 
        Destination: 192.168.152/24, Local: 192.168.152.15,
  Logical interface sp-0/0/0.0 (Index 70) (SNMP ifIndex 516) 
  Logical interface sp-0/0/0.16383 (Index 71) (SNMP ifIndex 517) 
        Destination: 10.0.0.16, Local: 10.0.0.1
        Destination: 128.0.1.16, Local: 128.0.0.1
  Logical interface lo0.16384 (Index 65) (SNMP ifIndex 21) 
  Logical interface lo0.16385 (Index 66) (SNMP ifIndex 22) 
  Logical interface lo0.32768 (Index 64) (SNMP ifIndex 248) 

■ルーティングテーブルの確認

root> show route 

inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

172.16.16.0/24     *[Static/5] 00:36:21
                    > to 192.168.152.1 via ge-0/0/0.0
192.168.152.0/24   *[Direct/0] 00:36:21
                    > via ge-0/0/0.0
192.168.152.15/32  *[Local/0] 00:36:27
                      Local via ge-0/0/0.0

■firewallの確認

root> show firewall 

Filter: __default_bpdu_filter__                                

root> show policy            

■ログの確認

root> show log messages         
Aug 30 05:00:00  newsyslog[1156]: logfile turned over due to size>1024K
Aug 30 05:00:11   alarmd[1079]: syslog: unknown facility/priority: ff04
Aug 30 05:00:17   chassisd[1078]: LICENSE_CONN_TO_LI_CHECK_SUCCESS: Connected to license-check
...

■ハードウエア情報以外はBSDの基本コマンドで確認出来ます。

root@% uname -r
12.1X47-D20.7

root@% top -b -n 0
last pid:  1959;  load averages:  0.02,  0.01,  0.00  up 0+00:49:49    21:21:01
66 processes:  2 running, 64 sleeping

Mem: 173M Active, 58M Inact, 957M Wired, 214M Cache, 69M Buf, 592M Free
Swap: 

root@% w
 9:21PM  up 50 mins, 2 users, load averages: 0.01, 0.01, 0.00
USER     TTY      FROM                              LOGIN@  IDLE WHAT
root     v0       -                                 8:32PM    14 cli
root     p0       192.168.152.1                     8:35PM     - w

root@% arp -a
MAC Address       Address         Name                     Interface     Flags     
00:50:56:c0:00:08 192.168.152.1   192.168.152.1            ge-0/0/0.0    none     

root@% uptime 
 9:21PM  up 50 mins, 2 users, load averages: 0.01, 0.00, 0.00

root@% ifconfig | grep "^[a-z]\|local" | grep -v null
lo0:    encaps: loopback; framing: local
lo0.16384:      flags=0x8000 <UP|MULTICAST>
        inet mtu 4294967295 local=127.0.0.1
lo0.16385:      flags=0x8000 <UP|MULTICAST>
        inet mtu 4294967295 local=10.0.0.1
            local=10.0.0.16
            local=128.0.0.1
            local=128.0.0.4
            local=128.0.1.16
lo0.32768:      flags=0x0 <UP|MULTICAST>
tap:    encaps: other; framing: pseudo
irb:    encaps: ether; framing: ether
ge-0/0/0:       encaps: ether; framing: ether
ge-0/0/0.0:     flags=0xc000 <UP|MULTICAST>
        inet primary mtu 1500 local=192.168.152.15 dest=192.168.152.0/24 bcast=192.168.152.255
ge-0/0/1:       encaps: ether; framing: ether
sp-0/0/0.0:     flags=0x8010 <UP|POINTOPOINT|MULTICAST>
sp-0/0/0.16383: flags=0x8010 <UP|POINTOPOINT|MULTICAST>
        inet primary mtu 9192 local=10.0.0.1 dest=10.0.0.16
            local=10.0.0.6
            local=128.0.0.1 dest=128.0.1.16
            local=128.0.0.6

root@% netstat -rn -I ge-0/0/0
Name         Mtu Network      Address             Ipkts Ierr    Opkts Oerr  Coll
ge-0/0/0    1514 <Link>     00.0c.29.5b.1a.c8      4351    0     2976    0     0
 unit 0     1500 192.168.152.0/ 192.168.152.15          0    0        0    0     0

root@% netstat -rn -I lo0
Name         Mtu Network      Address             Ipkts Ierr    Opkts Oerr  Coll
lo0          max <Link>                           10060    0    10060    0     0
 unit 16384  max 127.0.0.1/8    127.0.0.1       
 unit 16385  max 10.0.0.1/8     10.0.0.1        
              10.0.0.16/8    10.0.0.16       
              128.0.0.1/8    128.0.0.1       
              128.0.0.4/8    128.0.0.4       
              128.0.1.16/8   128.0.1.16      

root@% netstat -rn -I sp-0/0/0
Name         Mtu Network      Address             Ipkts Ierr    Opkts Oerr  Coll
sp-0/0/0    9192 <Link>                               0    0        0    0     0
 unit 0     9192
            9192
 unit 16383 9192 <PtoP>         10.0.0.1                0    0        0    0     0
              <PtoP>         10.0.0.6                0    0        0    0     0
              <PtoP>         128.0.0.1               0    0        0    0     0
              <PtoP>         128.0.0.6               0    0        0    0     0

root@% vmstat 5 5
 procs      memory      page                   disk   faults      cpu
 r b w     avm    fre  flt  re  pi  po  fr  sr ad0   in   sy  cs us sy id
 2 0 0 4280328 826340  192   4  10   0 122   0   0  205 8694 1253  1  1 98
 1 0 0 4280328 826340    0   0   0   0   0   0   1  204 7611 1032  0  0 100
 1 0 0 4280328 826340    0   0   0   0   0   0   0  203 7487 1031  0  0 100
 1 0 0 4280328 826340    1   0   0   0   1   0   0  203 7721 1096  1  0 99
 1 0 0 4280328 826340    0   0   0   0   0   0   0  203 7484 1031  0  0 100

root@% awk '/Sep. 2 21:30/{print}' /var/log/messages
Sep  2 21:30:00   cron[2014]: (root) CMD (   /usr/libexec/atrun)
Sep  2 21:30:00   cron[2015]: (root) CMD (newsyslog)