Cloud foundry 小区_z1中iptables NAT配置的可能性是什么?

Cloud foundry 小区_z1中iptables NAT配置的可能性是什么?,cloud-foundry,diego,Cloud Foundry,Diego,当我ssh进入cell_z1时。然后我可以看到这些路由表 $ sudo iptables -t nat -L Chain PREROUTING (policy ACCEPT) target prot opt source destination w--prerouting all -- anywhere anywhere Chain INPUT (policy ACCEPT)

当我ssh进入cell_z1时。然后我可以看到这些路由表


    $ sudo iptables -t nat -L

    Chain PREROUTING (policy ACCEPT)
    target     prot opt source               destination
    w--prerouting  all  --  anywhere             anywhere

    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination

    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    w--prerouting  all  --  anywhere             anywhere

    Chain POSTROUTING (policy ACCEPT)
    target     prot opt source               destination
    w--postrouting  all  --  anywhere             anywhere

    Chain w--instance-coiaggg2s3f (1 references)
    target     prot opt source               destination
    DNAT       tcp  --  anywhere             cell-z1-0.node.dc1.cf.internal  tcp dpt:60036 /* ac4154dd-a2bd-41d8-46bb-c5dfa3c8bfb2 */ to:10.254.0.6:8080
    DNAT       tcp  --  anywhere             cell-z1-0.node.dc1.cf.internal  tcp dpt:60037 /* ac4154dd-a2bd-41d8-46bb-c5dfa3c8bfb2 */ to:10.254.0.6:2222

    Chain w--instance-coiaggg2s3l (1 references)
    target     prot opt source               destination
    DNAT       tcp  --  anywhere             cell-z1-0.node.dc1.cf.internal  tcp dpt:60040 /* 74ab1082-7eca-4a09-7364-b266a23a7fdf */ to:10.254.0.2:8080
    DNAT       tcp  --  anywhere             cell-z1-0.node.dc1.cf.internal  tcp dpt:60041 /* 74ab1082-7eca-4a09-7364-b266a23a7fdf */ to:10.254.0.2:2222

    Chain w--postrouting (1 references)
    target     prot opt source               destination
    MASQUERADE  all  --  10.254.0.0/30       !10.254.0.0/30        /* executor-healthcheck-8946f5d6-063c-4bae-474d-0032f72b8fcb */
    MASQUERADE  all  --  10.254.0.4/30       !10.254.0.4/30        /* ef658bba-214d-4eef-5228-410e8e8aeb69 */
    MASQUERADE  all  --  10.254.0.8/30       !10.254.0.8/30        /* 3cb958eb-409a-4aa9-48f1-41bb6573ebc6 */
    MASQUERADE  all  --  10.254.0.12/30      !10.254.0.12/30       /* 9600ee8c-9e63-4682-bed3-b14767ea46d3 */
    MASQUERADE  all  --  10.254.0.16/30      !10.254.0.16/30       /* executor-healthcheck-eda5cee2-81be-4890-6d67-2a9f108d6dda */

    Chain w--prerouting (2 references)
    target     prot opt source               destination
    w--instance-coiaggg2s3f  all  --  anywhere             anywhere             /* ac4154dd-a2bd-41d8-46bb-c5dfa3c8bfb2 */
    w--instance-coiaggg2s3l  all  --  anywhere             anywhere             /* 74ab1082-7eca-4a09-7364-b266a23a7fdf */
问题是:这些目的地的前景如何? 当我在单元格_z1中卷曲时,它返回301错误。所以,我想它被移除了

  • 10.254.0.6:8080
  • 10.254.0.6:2222
  • 10.254.0.2:8080
  • 10.254.0.2:2222
但是,当路由器发射器将某个推送应用程序端口映射到60036600376004060041时,它会导致路由器在该应用程序中返回502错误

我的环境: 主机操作系统:Ubuntu服务器16.10 VirtualBox:5.0.32


    $ bosh -e bosh-lite releases
    Using environment '192.168.50.4' as client 'admin'

    Name               Version          Commit Hash
    cf                 254+dev.1*       80a8305a+
    cf-mysql           34.2.0+dev.1*    b8dcbe32
    cf-rabbitmq        222.15.0+dev.1*  377afa0a+
    cf-rabbitmq-test   0.1.7            98720fb8
    cflinuxfs2-rootfs  1.60.0*          0b44b228+
    diego              1.11.0+dev.1*    4ee830c6
    garden-runc        1.4.0*           60f9e9dd
    routing            0.147.0          255f268f
    ~                  0.136.0          d29132da+
于2017年11月4日更新

我发现这些信息来自川崎(卫报网络图书馆)。 我看到下面的路线表。但与10.254.0.6不同,路由表没有10.254.0.2(10.254.0.0/30)的虚拟NIC和路由


当您将应用程序部署到CF时,它将在一个Diego单元的容器中运行。容器有一个内部端口,目前Diego的端口总是8080,单元发布一个外部端口(到GoRouter)。外部端口通过单元上的iptables规则映射到内部端口。我相信这就是你所看到/询问的

总之,流量从浏览器到容器中的应用程序的路径如下:

Browser -> HTTP(S) -> Load Balancer -> HTTP(S) -> GoRouter -> (HTTP) -> External Port on Cell -> iptables -> Internal Port in Container -> Application
您可能还想知道端口2222,这与此类似,但该端口用于进入容器的
cf ssh
流量

非专业人员不得手动删除或调整Diego单元格上的任何iptables规则

Browser -> HTTP(S) -> Load Balancer -> HTTP(S) -> GoRouter -> (HTTP) -> External Port on Cell -> iptables -> Internal Port in Container -> Application