当前位置:网站首页>Perform general operations on iptables
Perform general operations on iptables
2022-07-06 15:46:00 【Empty one by one】
One 、 Sort out the allowed access to IP Address
1、ES client IP Address
192.168.32.120 192.168.32.121
2、 The node's location in cluster IP Address
192.168.32.122 192.168.32.123 192.168.32.124
Two 、 Sign in ES host (ubantu For example ), Execute the following command
# establish iptables Policy save path
mkdir -p /etc/iptables
# Allow hosts in the cluster IP Visit native 9200 port
iptables -A INPUT -s 192.168.32.123 -p tcp --dport 9200 -j ACCEPT
iptables -A INPUT -s 192.168.32.124 -p tcp --dport 9200 -j ACCEPT
# allow ES client IP Address access to this machine 9200 port
iptables -A INPUT -s 192.168.32.120 -p tcp --dport 9200 -j ACCEPT
iptables -A INPUT -s 192.168.32.121 -p tcp --dport 9200 -j ACCEPT
# Prohibit all except the above policy IP Visit native 9200 port ( The last item )
iptables -A INPUT -p tcp --dport 9200 -j REJECT
# If you want to add the above strategy basically iptables Strategy , Use -I Parameters
iptables -I INPUT -s 192.168.32.121 -p tcp --dport 9200 -j ACCEPT
# View the added iptables The rules
iptables -L -n --line-numbers
# Delete an added iptables The rules
iptables -D INPUT 1
# Save added iptables Rule to local file path
iptables-save > /etc/iptables/iptables.rules
# Recover from a saved file iptables The rules
iptables-restore < /etc/iptables/iptables.rules
# Configure automatic loading after power on iptables Policy file
edit iptables after
End of input iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080 after
perform iptables-save
Be careful :iptables-save It's connected , It's a command , It's not a parameter
iptables-save Just list the current settings , This is not to save the configuration
If you use RedHat series , You should use service iptables save preservation , use chkconfig iptables on Enable startup
If it is not RedHat series , You can manually save... Using the following method / Restore configuration
preservation
iptables-save > /root/iptables.conf
recovery
iptables-restore < /root/iptables.conf
边栏推荐
- Matlab example: two expressions of step function
- F - Birthday Cake(山东省赛)
- Accounting regulations and professional ethics [5]
- Research Report on market supply and demand and strategy of geosynthetics industry in China
- Research Report on pharmaceutical R & D outsourcing service industry - market status analysis and development prospect forecast
- Accounting regulations and professional ethics [4]
- Ball Dropping
- Accounting regulations and professional ethics [2]
- 【练习-7】(Uva 10976)Fractions Again?!(分数拆分)
- 信息安全-威胁检测-NAT日志接入威胁检测平台详细设计
猜你喜欢
随机推荐
Cost accounting [19]
SSM框架常用配置文件
编程到底难在哪里?
STM32學習記錄:輸入捕獲應用
【练习-7】(Uva 10976)Fractions Again?!(分数拆分)
Research Report on market supply and demand and strategy of China's Medical Automation Industry
区间和------离散化
Research Report on market supply and demand and strategy of Chinese graphic screen printing equipment industry
洛谷P1102 A-B数对(二分,map,双指针)
Cost accounting [23]
Accounting regulations and professional ethics [5]
Report on the market trend, technological innovation and market forecast of printing and decorative paper in China
STM32学习记录:LED灯闪烁(寄存器版)
C 基本语法
Interesting drink
信息安全-威胁检测-flink广播流BroadcastState双流合并应用在过滤安全日志
Learning record: use stm32f1 watchdog
Cost accounting [15]
HDU - 6024 Building Shops(女生赛)
C语言数组的概念