Follow

Setting iptables for Docker

Setting rules

iptables -N CUSTOM_ES
iptables -A CUSTOM_ES -p tcp --dport 9200 --source 8.8.8.8 --destination 172.19.0.2 -j ACCEPT
iptables -A CUSTOM_ES -p tcp --dport 9200 --source 0.0.0.0/0 --destination 172.19.0.2 -j DROP
iptables -R DOCKER 1 -p tcp --source 0.0.0.0/0 --destination 172.19.0.2 --dport 9200 -j CUSTOM_ES

List existing rules

iptables -t filter -nL

Source: https://stackoverflow.com/a/42934516/8083009

· · Web · 0 · 0 · 1
Sign in to participate in the conversation
小森林

每个人都有属于自己的一片森林,也许我们从来不曾走过,但它一直在那里,总会在那里。迷失的人迷失了,相逢的人会再相逢。愿这里,成为属于你的小森林。