<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Firewall on Shaowen Chen's Website</title><link>https://www.chenshaowen.com/en/tags/firewall/</link><description>Recent content in Firewall on Shaowen Chen's Website</description><generator>Hugo -- gohugo.io</generator><language>en</language><copyright>&amp;copy;2016 - {year}, All Rights Reserved.</copyright><lastBuildDate>Sat, 20 Aug 2022 08:00:00 +0000</lastBuildDate><sy:updatePeriod>weekly</sy:updatePeriod><atom:link href="https://www.chenshaowen.com/en/tags/firewall/atom.xml" rel="self" type="application/rss+xml"/><item><title>How to Make a Port Accessible Only to a Specified IP</title><link>https://www.chenshaowen.com/en/blog/set-port-to-be-accessible-only-to-a-specified-ip.html</link><pubDate>Sat, 20 Aug 2022 08:00:00 +0000</pubDate><atom:modified>Sat, 20 Aug 2022 08:00:00 +0000</atom:modified><guid>https://www.chenshaowen.com/en/blog/set-port-to-be-accessible-only-to-a-specified-ip.html</guid><description>1. Host Service Ports 1 2 iptables -I INPUT -p tcp --dport 80 -j DROP iptables -I INPUT -p tcp -s 1.2.3.4 --dport 80 -j ACCEPT This allows only 1.2.3.4 to access port 80 on the local host.
2. Docker Service Ports For services started like docker run -d -p 80:80 shaowenchen/demo:whoami, the method above does not work; the rule has to be added to the DOCKER-USER chain.</description><dc:creator>WeChat Official Account</dc:creator><category>Docker</category><category>Linux</category><category>Security</category><category>Restriction</category><category>Operations</category><category>Learning</category><category>iptables</category><category>Firewall</category><category>Network</category></item></channel></rss>