当前位置:网站首页>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
边栏推荐
- 通俗地理解什么是编程语言
- Indonesian medical sensor Industry Research Report - market status analysis and development prospect forecast
- 学习记录:如何进行PWM 输出
- Research Report of cylindrical grinder industry - market status analysis and development prospect forecast
- Market trend report, technological innovation and market forecast of pneumonia drugs obtained by Chinese hospitals
- 学习记录:使用STM32F1看门狗
- Medical colposcope Industry Research Report - market status analysis and development prospect forecast
- Alice and Bob (2021牛客暑期多校训练营1)
- China exterior wall cladding (EWC) market trend report, technical dynamic innovation and market forecast
- 0-1背包問題(一)
猜你喜欢
Learning records: serial communication and solutions to errors encountered
数据在内存中的存储&载入内存,让程序运行起来
Learning record: use STM32 external input interrupt
mysql导入数据库报错 [Err] 1273 – Unknown collation: ‘utf8mb4_0900_ai_ci’
毕业才知道IT专业大学生毕业前必做的1010件事
程序员的你,有哪些炫技的代码写法?
MATLAB综合练习:信号与系统中的应用
STM32如何使用STLINK下载程序:点亮LED跑马灯(库版本)
Record of force deduction and question brushing
信息安全-威胁检测引擎-常见规则引擎底座性能比较
随机推荐
数据在内存中的存储&载入内存,让程序运行起来
Stm32 dossiers d'apprentissage: saisie des applications
Alice and Bob (2021牛客暑期多校训练营1)
Medical colposcope Industry Research Report - market status analysis and development prospect forecast
Research Report on market supply and demand and strategy of China's land incineration plant industry
Research Report on surgical fluid treatment industry - market status analysis and development prospect prediction
Research Report on market supply and demand and strategy of geosynthetics industry in China
Determine the Photo Position
Learning records: serial communication and solutions to errors encountered
Learning record: Tim - Basic timer
STM32学习记录:LED灯闪烁(寄存器版)
nodejs爬虫
C语言必背代码大全
E. Breaking the Wall
D - Function(HDU - 6546)女生赛
Truck History
mysql导入数据库报错 [Err] 1273 – Unknown collation: ‘utf8mb4_0900_ai_ci’
TCP的三次握手与四次挥手
China exterior wall cladding (EWC) market trend report, technical dynamic innovation and market forecast
China's earthwork equipment market trend report, technical dynamic innovation and market forecast