轉換 Oracle® Solaris 10 至 Oracle Solaris 11.2

結束列印檢視

更新日期: 2014 年 12 月
 
 

比較 ndd 指令與 ipadm 指令

    相較於 ndd 指令,ipadm 指令提供了下列優點:

  • 提供與每個 TCP/IP 特性有關的資訊,例如特性的目前值與預設值,以及可能的值範圍。因此,會比較容易取得除錯資訊。

  • 依循一致的指令語法,所以較容易使用。

  • 路由及傳輸階層之可調整參數的永久配置,讓使用者能夠使用 ipadm 子指令,而不像之前需使用未確定的 ndd 指令 (需使用自訂 SMF 程序檔或 /etc/rc*.d 程序檔)。

下表比較選取的 ndd 指令選項和等效的 ipadm 指令選項。請參閱 ipadm(1M) 線上手冊,取得更完整的指令選項清單。

表 7-2  ndd 指令與 ipadm 指令比較
ndd 指令
ipadm 指令
bash-3.2# ndd -get /dev/ip ?
ip_def_ttl         (read and write)
ip6_def_hops       (read and write)
ip_forward_directed_broadcasts
                   (read and write)
ip_forwarding      (read and write)
...
...
bash-3.2# ndd -get /dev/ip \
ip_def_ttl
100
bash-3.2# ndd -get /dev/ip \
ip6_def_hops
255
bash-3.2# ndd -get /dev/tcp ?
tcp_cwnd_max       (read and write)
tcp_strong_iss     (read and write)
tcp_time_wait_interval
                   (read and write)
tcp_tstamp_always  (read and write)
tcp_tstamp_if_wscale
                   (read and write)
...
bash-3.2# ndd -get /dev/tcp ecn
1
bash-3.2# ndd -get /dev/tcp sack
2

bash-3.2# ipadm show-prop ip
PROTO PROPERTY     PERM   CURRENT  PERSISTENT   DEFAULT   POSSIBLE
ipv4  forwarding   rw     off      --           off       on,off
ipv4  ttl          rw     255      --           255       1-255
ipv6  forwarding   rw     off      --           off       on,off
ipv6  hoplimit     rw     255      --           255       1-255
...
bash-3.2# ipadm show-prop -p ttl,hoplimit ip
PROTO PROPERTY   PERM   CURRENT   PERSISTENT   DEFAULT   POSSIBLE
ipv4  ttl        rw     255       --           255       1-255
ipv6  hoplimit   rw     255       --           255       1-255
bash-3.2# ipadm show-prop tcp
PROTO PROPERTY        PERM CURRENT PERSISTENT DEFAULT    POSSIBLE
tcp   ecn             rw   passive --         passive    never,passive,
                                                         active
tcp   extra_          rw   2049    2049,4045  2049,4045  1-65535
      priv_ports
tcp   largest_        rw   65535   --         65535      1024-65535
      anon_port
tcp   recv_           rw   128000  --         128000     2048-1073741824
      maxbuf
tcp   sack            rw   active  --         active     never,passive,
                                                         active
tcp   send_           rw   49152   --         49152      4096-1073741824
      maxbuf
tcp   smallest_       rw   32768   --         32768      1024-65535
      anon_port
tcp   smallest_       rw   1024    --         1024       1024-32768
      nonpriv_port
...
bash-3.2# ipadm show-prop -p ecn,sack tcp
PROTO PROPERTY PERM CURRENT PERSISTENT DEFAULT  POSSIBLE
tcp   ecn      rw   passive --         passive  never,passive,active
tcp   sack     rw   active  --         active   never,passive,active