要调试两台应当进行通信但未进行通信的主机,可以使用 Trusted Extensions 和 Oracle Solaris 调试工具。例如,提供了诸如 snoop 和 netstat 之类的 Oracle Solaris 网络调试命令。有关详细信息,请参见 snoop(1M) 和 netstat(1M) 手册页。有关特定于 Trusted Extensions 的命令,请参见Appendix D, Trusted Extensions 手册页列表。
有关连接有标签区域的问题,请参见管理区域。
有关调试 NFS 挂载的信息,请参见如何解决 Trusted Extensions 中的挂载故障。
开始之前
您必须位于全局区域中,并充当可以检查网络属性值的角色。"Security Administrator"(安全管理员)角色或 "System Administrator"(系统管理员)角色可以检查这些值。只有 root 角色可以编辑文件。
# svccfg -s name-service/switch listprop config config/value_authorization astring solaris.smf.value.name-service.switch config/default astring ldap ... config/tnrhtp astring "files ldap" config/tnrhdb astring "files ldap"
# svccfg -s name-service/switch setprop config/tnrhtp="files ldap" # svccfg -s name-service/switch setprop config/tnrhdb="files ldap"
# svcadm restart name-service/switch
使用命令行检查网络信息是否正确。检验每台主机上的指定是否与网络中其他主机上的指定匹配。根据要查看的内容,使用 tncfg 命令、tninfo 命令或 txzonemgr GUI。
tninfo -t 命令以字符串和十六进制格式显示标签。
# tninfo -t template-name template: template-name host_type: one of cipso or UNLABELED doi: 1 min_sl: minimum-label hex: minimum-hex-label max_sl: maximum-label hex: maximum-hex-label
tncfg -t 命令以字符串格式显示标签并列出指定的主机。
# tncfg -t template info name=<template-name> host_type=<one of cipso or unlabeled> doi=1 min_label=<minimum-label> max_label=<maximum-label> host=127.0.0.1/32 /** Localhost **/ host=192.168.1.2/32 /** LDAP server **/ host=192.168.1.22/32 /** Gateway to LDAP server **/ host=192.168.113.0/24 /** Additional network **/ host=192.168.113.100/25 /** Additional network **/ host=2001:a08:3903:200::0/56/** Additional network **/
tninfo -h 命令显示指定主机的 IP 地址以及所指定的安全模板的名称。
# tninfo -h hostname IP Address: IP-address Template: template-name
tncfg get host= 命令显示定义指定主机的安全模板名称。
# tncfg get host=hostname|IP-address[/prefix] template-name
tncfg -z 命令在每一行列出一个 MLP。
# tncfg -z zone-name info [mlp_private | mlp_shared] mlp_private=<port/protocol-that-is-specific-to-this-zone-only> mlp_shared=<port/protocol-that-the-zone-shares-with-other-zones>
tninfo -m 命令在一行中列出专用 MLP,在另一行中列出共享 MLP。使用分号分隔 MLP。
# tninfo -m zone-name private: ports-that-are-specific-to-this-zone-only shared: ports-that-the-zone-shares-with-other-zones
要以 GUI 形式显示 MLP,请使用 txzonemgr 命令。双击区域,然后选择 "Configure Multilevel Ports"(配置多级别端口)。
例如,以下输出显示未定义模板名称 internal_cipso:
# tnchkdb checking /etc/security/tsol/tnrhtp ... checking /etc/security/tsol/tnrhdb ... tnchkdb: unknown template name: internal_cipso at line 49 tnchkdb: unknown template name: internal_cipso at line 50 tnchkdb: unknown template name: internal_cipso at line 51 checking /etc/security/tsol/tnzonecfg ...
该错误表明未使用 tncfg 和 txzonemgr 命令创建和指定 internal_cipso 安全模板。
要进行修复,请将 tnrhdb 文件替换为原始文件,然后使用 tncfg 命令创建并指定安全模板。
在引导时,会使用数据库信息置备高速缓存。SMF 服务 name-service/switch 决定是使用本地数据库还是使用 LDAP 数据库来置备内核。
# route get [ip] -secattr sl=label,doi=integer
有关详细信息,请参见 route(1M) 手册页。
# snoop -v
–v 选项显示包标头的详细信息,包括标签信息。此命令提供大量详细信息,因此您可能需要限定此命令检查的包。有关详细信息,请参见 snoop(1M) 手册页。
# netstat -aR
–aR 选项显示套接字的扩展安全属性。
# netstat -rR
–rR 选项显示路由表项。有关详细信息,请参见 netstat(1M) 手册页。