可以使用 --security-gateway
属性为 SGD 阵列设置 SGD Gateway 的用法。该属性定义以下内容:
可访问 SGD Gateway 的 SGD Client,基于其 IP 地址或 DNS 名称定义。
客户端设备用于联系 SGD Gateway 的地址。
--security-gateway
属性仅适用于 AIP 连接。HTTP 连接的路由是由 Gateway 的 Apache 反向代理组件上的 HTTP 负载平衡服务处理的。
对 --security-gateway
属性所做的更改将应用于阵列中的所有 SGD 服务器。
--security-gateway
属性的语法如下所示:
--security-gateway filter-spec
...
将 filter-spec
替换为以下类型的过滤器规范:
client-ip-address
|*
:gateway protocol
:gateway-address
:gateway-port
client-ip-address
是 SGD Client 的 IP 地址。对于通过 SGD Gateway 的连接,这是 SGD Gateway 用于连接阵列中的 SGD 服务器的接口。
一个星号 *
表示所有 IP 地址。
客户端 IP 地址字符串可以包含 *
和 ?
通配符,其中 *
匹配多个字符,?
匹配单个字符。例如:
192.169.10.*
匹配 192.169.10
网络上的所有地址。
192.169.10.12?
匹配范围从 192.169.10.120
到 192.169.10.129
的地址。
如果要将外部负载平衡器用于 SGD Gateway,请为 client-ip-address
键入负载平衡器的地址。
对于通过 SGD Gateway 的连接,gateway protocol
是 sgdg
,对于直接连接 SGD 阵列(不通过 SGD Gateway)的 SGD Client,则是 direct
。
gateway-address
是 SGD Gateway 或外部负载平衡器(如果使用)的外部地址。这是客户端设备用于联系 SGD Gateway 的地址。
对于到 SGD 阵列的 direct
(直接)连接,请指定阵列中主服务器的地址。
gateway-port
是客户端设备用于连接 SGD Gateway 或外部负载平衡器(如果使用)的 TCP 端口。
对于到 SGD 阵列的 direct
(直接)连接,请指定阵列中主服务器的端口。
使用逗号分隔多个 filter-spec
条目,并使用双引号 ("
"
) 将整个字符串括起。请参见第 B.31 节 “
使用多个过滤器
”。
以下示例使所有 SGD Client 使用 SGD Gateway gateway1.example.com
的 TCP 端口 443 进行连接。
$ tarantella config edit --security-gateway "*:sgdg:gateway1.example.com:443"
以下示例使所有 SGD Client 使用外部负载平衡器 lb.example.com
进行连接。
$ tarantella config edit --security-gateway "*:sgdg:lb.example.com:443"
以下示例使所有 SGD Client 直接连接 SGD 阵列,而不通过 SGD Gateway。阵列中的主服务器为 sgd1.example.com
。
$ tarantella config edit --security-gateway "*:direct:sgd1.example.com:443"
您可以使用多个过滤器规范,如以下示例中所示。
请考虑图 B.1 “使用多个过滤器规范”中所示的基本部署。该部署使用一个 SGD Gateway gateway1.example.com
和包含两个 SGD 服务器(sgd1.example.com
和 sgd2.example.com
)的 SGD 阵列。阵列中的主服务器为 sgd1.example.com
。
内部网络上的 SGD Gateway 地址为 192.168.0.250
。
以下过滤器规范可用于本示例:
"192.168.0.250:sgdg:gateway1.example.com:443,*:direct:sgd1.example.com:80"
使用此配置时,遵循以下方式:
允许从 SGD Gateway IP 地址 192.168.0.250
建立到阵列中 SGD 服务器的连接。组织外的 SGD Client 使用 SGD Gateway gateway1.example.com
的 TCP 端口 443 进行连接。
所有其他 SGD Client(如局域网 (local area network, LAN) 上的 SGD Client)直接连接到主 SGD 服务器 sgd1.example.com
上的 TCP 端口 80。这些连接不使用 SGD Gateway。
过滤器的顺序很重要。如果过滤器的顺序相反,则所有 SGD Client 将直接连接 SGD 服务器 sgd1.example.com
。