Juniper SSG セッション関連

Firewall使ってると、ちゃんとトラフィックが流れているか見たくなるのでメモ。

コマンドメモ

get session ?
 >                    redirect output
 |                    match output
 
 dst-ip               destination ip address
 dst-mac              destination mac address
 dst-port             destination port number or range
 id                   show sessions with id
 ike-nat              show ike-nat ALG info
 info                 show sessions summary info
 ipsec-nat            show ipsec pinhole ALG info
 policy-id            policy id
 protocol             protocol number or range
 rm                   show sessions for resource management
 service              show sessions with service type
 src-ip               source ip address
 src-mac              source mac address
 src-port             source port number or range
 tunnel               show tunnel sessions
 vsd-id               get vsd-id specified sessions

get session

alloc 15432/max 256064, alloc failed 0, mcast alloc 0, di alloc failed 0
total reserved 0, free sessions in shared pool 240632
id 127878/s**,vsys 0,flag 00000000/0000/0001/0000,policy 20,time 6, dip 10 module 0
 if 0(nspflag 800801):xx.xx.xx.xx/59269->xx.xx.xx.xx/161,17,02e052fe4664,sess token 16,vlan 0,tun 0,vsd 0,route 8
 if 5(nspflag 10800800):xx.xx.xx.xx/50328<-xx.xx.xx.xx/161,17,00005e000104,sess token 17,vlan 0,tun 0,vsd 0,route 11
(以下略)

Src/DstなどでFilter

Filterして必要な物だけ見る。

get session src-ip xx.xx.xx.xx dst-ip xx.xx.xx.xx dst-port 23
alloc 15801/max 256064, alloc failed 0, mcast alloc 0, di alloc failed 0
total reserved 0, free sessions in shared pool 240263
Total 1 sessions according filtering criteria.
id 232969/s**,vsys 0,flag 0c000000/0000/0001/0000,policy 92,time 4320, dip 0 module 0
 if 0(nspflag 801801):xx.xx.xx.xx/53168->xx.xx.xx.xx/23,6,02e052fe4664,sess token 16,vlan 0,tun 0,vsd 0,route 8,wsf 0
 if 5(nspflag 801800):xx.xx.xx.xx/53168<-xx.xx.xx.xx/23,6,00005e000104,sess token 17,vlan 0,tun 0,vsd 0,route 11,wsf 7

Juniper SRX セッション関連

Firewall使ってると、ちゃんとトラフィックが流れているか見たくなるのでメモ。

コマンドメモ

show security flow session
Possible completions:
  <[Enter]>            Execute this command
  application          Application protocol name
  application-firewall  Show application-firewall sessions
  application-firewall-rule-set  Show application-firewall session by rule-set
  brief                Show brief output (default)
  destination-port     Destination port (1..65535)
  destination-prefix   Destination IP prefix or address
  dynamic-application  Dynamic application name
  dynamic-application-group  Dynamic application group name
  extensive            Show detailed output
  family               Protocol family
  idp                  IDP sessions
  interface            Name of incoming or outgoing interface
  nat                  Sessions with network address translation
  protocol             IP protocol number
  resource-manager     Sessions with resource manager
  session-identifier   Show session with specified session identifier
  source-port          Source port (1..65535)
  source-prefix        Source IP prefix or address
  summary              Show output summary
  tunnel               Tunnel sessions
  |                    Pipe through a command

show security flow session

 node0:
 --------------------------------------------------------------------------

Session ID: 115, Policy name: xxxxx, State: Active, Timeout: 1766, Valid
  In: xx.xx.xx.xx/57050 --> xx.xx.xx.xx/5073;tcp, If: reth0.0, Pkts: 106939, Bytes: 9412714
  Out: xx.xx.xx.xx/5073 --> xx.xx.xx.xx/57050;tcp, If: reth1.0, Pkts: 92082, Bytes: 71627805

Session ID: 118, Policy name: xxxxx, State: Active, Timeout: 8, Valid
  In: xx.xx.xx.xx/37123 --> xx.xx.xx.xx/161;udp, If: reth0.0, Pkts: 52, Bytes: 7354
  Out: xx.xx.xx.xx/161 --> xx.xx.xx.xx/59284;udp, If: reth1.0, Pkts: 52, Bytes: 8221
(以下略)

Src/DstなどでFilter

Filterして必要な物だけ見る。

show security flow session source-prefix xx.xx.xx.xx destination-prefix xx.xx.xx.xx
 node0:
 --------------------------------------------------------------------------

Session ID: 447495, Policy name: xxxxx, State: Active, Timeout: 16, Valid
  In: xx.xx.xx.xx/48291 --> xx.xx.xx.xx/80;tcp, If: reth0.0, Pkts: 2, Bytes: 120
  Out: xx.xx.xx.xx/80 --> xx.xx.xx.xx/48291;tcp, If: reth1.0, Pkts: 0, Bytes: 0
Total sessions: 1

 node1:
 --------------------------------------------------------------------------

Session ID: 19666, Policy name: xxxxx/39, State: Backup, Timeout: 14400, Valid
  In: xx.xx.xx.xx/48291 --> xx.xx.xx.xx/80;tcp, If: reth0.0, Pkts: 0, Bytes: 0
  Out: xx.xx.xx.xx/80 --> xx.xx.xx.xx/48291;tcp, If: reth1.0, Pkts: 0, Bytes: 0
Total sessions: 1

NetApp volumeの拡張方法(SnapMirror環境下)

NetAppのvolumeは柔軟に拡張(縮小)ができる。
拡張時の備忘録。

Aggregateのサイズ確認

df -Ah
Aggregate                total       used      avail capacity
aggr0                   xxxxGB     xxxxGB     xxxxGB      xx%
aggr0/.snapshot            xGB       xxGB        xGB     ---%

Aggregateの容量を確認し、拡張に必要な空き容量があるか確認。

volume容量確認

df -h
Filesystem               total       used      avail capacity  Mounted on
/vol/vol0/               xxxGB     xxxxMB      xxxGB       x%  /vol/vol0/
/vol/vol0/.snapshot      xxxGB     xxxxMB      xxxGB       x%  /vol/vol0/.snapshot
/vol/vol1/               xxxGB      xxxGB       xxGB      xx%  /vol/vol1/
/vol/vol1/.snapshot      xxxGB       xxGB       xxGB      xx%  /vol/vol1/.snapshot
(略)

拡張前に容量を確認しておく

fs_size_fixedの設定確認

vol status vol1
         Volume State           Status            Options
           vol1 online          raid_dp, flex     create_ucode=on, convert_ucode=on,
                                64-bit            maxdirsize=10470, fs_size_fixed=on
                         Volume UUID: ~
                Containing aggregate: 'aggr0'

Src側は拡張時に一旦offにする必要がある。Dst側はoffにしなくても良い

Dst側volume拡張

 vol size vol1 +200g

vol1を200G拡張する場合。

Warning: Volume 'vol1' is a replica.  This will not change the
file system size in the replica, which is set from the replica source.
The new volume size will be used to set the upper limit on replica
transfers into this volume.

拡張時、上記警告がでるけどSrc側の拡張に合わせて自動的にされる仕組み。

volume容量拡張確認

df -h
Filesystem               total       used      avail capacity  Mounted on
/vol/vol0/               xxxGB     xxxxMB      xxxGB       x%  /vol/vol0/
/vol/vol0/.snapshot      xxxGB     xxxxMB      xxxGB       x%  /vol/vol0/.snapshot
/vol/vol1/               xxxGB      xxxGB       xxGB      xx%  /vol/vol1/
/vol/vol1/.snapshot      xxxGB       xxGB       xxGB      xx%  /vol/vol1/.snapshot
(略)

NetApp quota設定

NetApp quotaまわりの設定備忘録

quotaコマンド

> quota help
usage: quota {off | resize} volume
       quota status [ volume ]
       quota on [-w] volume
       quota report [-q][-s][-t][-u | -x] [ path ]
       quota logmsg { on [] | off } [-v  | all]

設定ファイルに関して

/etc/quotasにある。下記は書式の例

 #Quota target  type                   disk  files  thold  sdisk  sfile
 #------------  ----                   ----  -----  -----  -----  -----
 target01       user@/vol/vol1/xx      500G  -      -      480G   -
 *              user@/vol/vol2/Home     5G   -      -      -      -
 *              user@/vol/vol2/Profiles 5G   -      -      -      -
 *              user@/vol/vol2/Works    10G  -      -      -      -
 /vol/vol2/xxxx tree                    700G  -     -      680G   -

targetを「*」にしておくとAD連携でCIFSマウントした時などに、各ユーザー毎の
quotaを制限出来て良い感じ。

コマンドメモ

quota on

quotaを有効化する。予め/etc/quotasを編集しておくこと。

 > quota on vol1

quota status

quotaのon/offなどが確認できる。

vol0: quotas are off.
vol1: quotas are on.
vol2: quotas are initializing (14% done).

quota report

各種quota情報を閲覧できる

 quota: some quotas are still initializing.
                                  K-Bytes             Files
 Type       ID    Volume    Tree  Used      Limit     Used    Limit   Quota Specifier
 ----- -------- -------- -------- --------- --------- ------- ------- ---------------
 user  xxxxxxxx     vol1       05 126087792 125829120   78081       - xxxxxxxx
 user      xxxx     vol1       06    785276 125829120   25942       - xxxx
 user   xxxxxxx     vol1       06       180 125829120      59       - xxxxxxx

quota resize

quotaを拡張したりする場合に使用する。/etc/quotasを再読み込みして反映させるイメージ。
そのため、予め/etc/quotasの変更を行っておくこと。

 > quota resize vol1

quota logmsg

ロギングをon/offできる。間隔も指定可能。現状の設定閲覧は下記の通り

 > quota logmsg
 vol0: quotas are off. Interval not set.
 vol1: message logging enabled. Interval = 60 minutes.
 vol2: message logging enabled. Interval = 60 minutes.

ethtoolによる設定

スイッチでは100M Full固定に設定しているのに、サーバ側の
auto-negotiationがYesになっているとHalfで上がってしまいます。
(em1はInterface Name。機器によって読み替えて下さい)

# ethtool em1
Settings for em1:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Half
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: g
        Wake-on: d
        Link detected: yes

手動でサーバ側のauto-negotiationを切る場合は、

# ethtool -s em1 autoneg off speed 100 duplex full

こんな感じ。手動で対応できるけど、Linkが一瞬落ちるので要注意。

# less /var/log/messages
kernel: tg3 0000:02:00.0: em1: Link is down
kernel: tg3 0000:02:00.0: em1: Link is up at 100 Mbps, full duplex

OS再起動後もきちんと機能させるには、設定ファイルに書いておきましょう。

# vi /etc/sysconfig/network-scripts/ifcfg-em1
---下記を追記---
ETHTOOL_OPTS="speed 100 duplex full autoneg off"
-----------

Juniper SSG NSRP track-ip threshold設定に関して

Juniper SSG(ScreenOS)に関する備忘録。

■Juniper KB参考
Juniper Networks - [ScreenOS] Best Practices: NSRP and Track-IP - Knowledge Base

NSRPのTrack-ipにthreshold設定があった

set nsrp vsd-group id 0 monitor track-ip threshold xx

ここのthresholdって

get nsrp vsd-group id 0 monitor track-ip
ip address                               interval threshold wei tmout interface   meth fail-count success-rate
xx.xx.xx.xx                                     1         3 255     1 auto        ping          0 99%
failure weight: 255, threshold: 255, not failed: 0 ip(s) failed, weighted sum = 0

threshold設定が入っていない機器を見ると上記のようになっていた。
デフォルトは3。
対象IPに対してICMP応答が3回コケるとFailoverが発生する。

Firefox 36.0 DNS ANYクエリ

Firefox36.0ではWindows環境においてDNSのANYクエリを投げる
ことが話題になっているようです。

ANYクエリは多くの応答を取得出来ることから、DNS Amp攻撃に
使用されることもあります。
通常は必要なレコードだけ指定してクエリを投げれば良いので
ANYクエリの使用は好ましくありません。
(ネットワーク、DNSサーバの負荷増大につながるので)

DNS関連MLでも話題にあがり、他のBug FixとあわせてFirefox
36.0.1で対応したようです。

The use of ANY DNS has been disabled. It disables the use of ANY DNS to get the TTL on Windows. There is a lengthy discussion about this on Bugzilla but it appears that DNS ANY was used in contexts where it should not be used.

正確なTTLを取得するためにANY使っちゃたようです…。

日本DNSオペレーターズグループ
こちらのMLでも話題にあがっていたので紹介しますー。