stapow
V2EX  ›  Docker

Docker 容器的网络隔离问题求解。

  •  
  •   stapow · Jan 15, 2020 · 4519 views
    This topic created in 2349 days ago, the information mentioned may be changed or developed.
    希望 Docker 容器本身只能接收某些 ip 发送的的数据,
    比如只能接收 12.34.0.0/16 这些 ip 的数据,
    容器本身发送不受限制,不知道 linux 下怎么写这个 iptables。谢谢!
    1 replies    2020-01-15 11:05:09 +08:00
    abai
        1
    abai  
       Jan 15, 2020
    iptables -I DOCKER -s 12.34.0.0/16 -p tcp --dport 80 -j ACCEPT
    iptables -I DOCKER -p tcp --dport 80 -j REJECT --reject-with tcp-reset
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   751 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 21:25 · PVG 05:25 · LAX 14:25 · JFK 17:25
    ♥ Do have faith in what you're doing.