当前位置:网站首页>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 comprehensive exercise: application in signal and system
- 【练习-3】(Uva 442)Matrix Chain Multiplication(矩阵链乘)
- 区间和------离散化
- Indonesian medical sensor Industry Research Report - market status analysis and development prospect forecast
- Cost accounting [14]
- VS2019初步使用
- D - Function(HDU - 6546)女生赛
- 【练习-11】4 Values whose Sum is 0(和为0的4个值)
- Research Report on market supply and demand and strategy of Chinese graphic screen printing equipment industry
- Opencv learning log 30 -- histogram equalization
猜你喜欢

力扣刷题记录

7-1 懂的都懂 (20 分)

Learning record: STM32F103 clock system overview working principle

Matlab example: two expressions of step function

C语言数组的概念

STM32 learning record: LED light flashes (register version)

【练习-7】Crossword Answers

D - Function(HDU - 6546)女生赛

ucorelab3

STM32 learning record: input capture application
随机推荐
Learning record: Tim - capacitive key detection
信息安全-史诗级漏洞Log4j的漏洞机理和防范措施
学习记录:如何进行PWM 输出
Hospital privacy screen Industry Research Report - market status analysis and development prospect forecast
China's peripheral catheter market trend report, technological innovation and market forecast
C 基本语法
入门C语言基础问答
STM32学习记录:LED灯闪烁(寄存器版)
Research Report on pharmaceutical R & D outsourcing service industry - market status analysis and development prospect forecast
区间和------离散化
对iptables进行常规操作
力扣刷题记录
Cost accounting [17]
China exterior wall cladding (EWC) market trend report, technical dynamic innovation and market forecast
VS2019初步使用
Ball Dropping
Research Report on market supply and demand and strategy of geosynthetics industry in China
学习记录:串口通信和遇到的错误解决方法
HDU - 6024 Building Shops(女生赛)
Opencv learning log 33 Gaussian mean filtering