JuniperSRX DHCPサーバが動作しない

JuniperSRXのDHCPサーバがうまく動作しなくて、他にDHCPサーバを立てる事で逃げていたのですが、上手く動作させることが出来たようです。

  • Juniper SRX210H - Junos 11.4 R4.4で、ソースルートを書くと複雑になってしまうので、複数routing-instanceを立ててVlan毎にルーティングを別々に制御している。
  • SRXのデフォルトインスタンスにDHCP serverを動作させたが、クライアントからDHCPでIPアドレスを取得できない
ge-0/0/1インターフェースにTrustゾーンに属する192.168.100.0/24のネットワーク(routing-instanceはデフォルトインスタンスに属する)を作って、SRXをDHCPサーバをしたいので
SRX Getting Started - Configure DHCP Serverに書いてあるとおり、
user@host# set system services dhcp pool 192.168.100.0/24 address-range low 192.168.100.33
user@host# set system services dhcp pool 192.168.100.0/24 address-range high 192.168.100.64
user@host# set system services dhcp pool 192.168.100.0/24 domain-name example.net
user@host# set system services dhcp pool 192.168.100.0/24 name-server 192.168.100.2
user@host# set system services dhcp pool 192.168.100.0/24 router 192.168.100.1
user@host# set system services dhcp pool 192.168.100.0/24 default-lease-time 3600
user@host# set security zones security-zone trust interfaces ge-0/0/1.0 host-inbound-traffic system-services dhcp
user@host# set interfaces ge-0/0/1 unit 0 family inet address 192.168.100.1/24
user@host# commit and-quit
としたのですが、クライアントにIPアドレスは割り当てされなくて
user@host> show syster services dhcp binding
    (なにも表示されない)
user@host> 
という状態に・・・。色々調べたのですが、host-inbound-trafficを書けば良いというのが多くて、あまり役に立ちませんでした。
ただ、
user@host> show interfaces ge-0/0/1.0 extensive 
  Logical interface ge-0/0/1.0 (Index 72) (SNMP ifIndex 515) (Generation 137)
   (省略)
	Security: Zone: trust
    Allowed host-inbound traffic : dns igmp ospf pim router-discovery vrrp ident-reset ping ssh ntp
    Flow Statistics :  
   (省略)
Allowed host-inbound trafficの項目にdhcp、bootpが表示されていないことは気になったので、コンフィグを確認すると、ゾーンtrustにたいしてhost-inbound-trafficの設定が入っていてその項目が有効になっていて、上記のインターフェースに対するhost-inbound-trafficが効いていなそうという事が判りました。
で、バッサリ削除して、全部インターフェース側の設定にしました。
user@host# delete security zones security-zone trust host-inbound-traffic system-services ping
user@host# delete security zones security-zone trust host-inbound-traffic system-services ident-reset
user@host# delete security zones security-zone trust host-inbound-traffic system-services dns
user@host# delete security zones security-zone trust host-inbound-traffic system-services ntp
user@host# delete security zones security-zone trust host-inbound-traffic system-services ssh
user@host# delete security zones security-zone trust host-inbound-traffic protocols ospf
user@host# delete security zones security-zone trust host-inbound-traffic protocols vrrp
user@host# delete security zones security-zone trust host-inbound-traffic protocols pim
user@host# delete security zones security-zone trust host-inbound-traffic protocols router-discovery
user@host# delete security zones security-zone trust host-inbound-traffic protocols igmp
user@host# commit and-quit

結果として無事、show interface extensiveのAllowed host-inbound trafficの項目にdhcpが表示されるようになりました。
host-inbound-trafficeの設定はゾーン→インターフェースという形で単純に継承される訳では無さそうです。設定項目で考えるとゾーンにはdhcpは適用出来ないけど、インターフェースにはdhcpが適用出来るので、継承されてても良さそうなものですが。
ここまでやっても、まだDHCPが取得出来ませんでした。

切り分ける方法が無いのでSRXのコンソールでtcpdumpを取ってみると、クライアントからのDHCP Requestパケットが入ってきていない事が判りました。

そうなると、疑わしいのがネットワーク→SRXと入ってくるinboundトラフィックに掛かっているfirewallという事になります。
それらしい項目としては、上記のsecurity zones security-zone [zone] interfaces [インターフェース] host-inbound-trafficの設定と、firewallですが、show configuration firewallは何も設定していなかったので、何も入っていませんでした。

Juniperの資料に、[SRX] How to setup the DHCP server on SRX with the DHCP clients in a non-default routing instanceというのがあって、デフォルトインスタンスに属していないゾーン・インターフェースでDHCPを動作させると、DHCPDがデフォルトルーティング以外のルーティングインスタンスから入ってくるパケットはドロップするという表記があったのですが、これを読むとデフォルトインスタンスからのパケットはドロップしない・・・という風に取れると思います。

が、結論は違ってて、、、

user@host# set firewall family inet filter default-vr term skip-dhcp from port 68
user@host# set firewall family inet filter default-vr term skip-dhcp from port 67
user@host# set firewall family inet filter default-vr term skip-dhcp then count dhcp-packet
user@host# set firewall family inet filter default-vr term skip-dhcp then accept
という具合にAcceptのフィルターを記述して動作するようになりました。

最初に書いた通り最終的に動作するようにはなりましたが、ちょっと腑に落ちないです。