iptables白名单output配置
时间: 2023-08-29 17:11:14 浏览: 178
根据引用中的配置,要将iptables配置为白名单output,可以使用以下命令:
iptables -A OUTPUT -d 192.111.51.45 -p all -j ACCEPT //开放所有端口给指定ip:192.111.51.45
iptables -A OUTPUT -d 192.111.51.44 -p all -j ACCEPT //开放所有端口给本机
iptables -A OUTPUT -d 192.111.1.51 -p all -j ACCEPT //开放所有端口给指定ip:192.111.1.51
以上命令会将指定的IP地址添加到output链的白名单中,允许该IP地址访问所有端口。请注意,根据引用中的配置,iptables默认的OUTPUT链策略是允许所有的输出流量通过,因此在使用以上命令之前,你需要确认OUTPUT链的默认策略是允许通过的。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [iptables配置ip白名单](https://blog.csdn.net/qq_40844663/article/details/103419964)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Centos7 Iptables 白名单](https://blog.csdn.net/weixin_31600859/article/details/116994812)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [iptables白名单配置](https://blog.csdn.net/weixin_39995943/article/details/113025057)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文