File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # allow the network 10.111.11.0/24 and not allow other network connect port 9200
4+ iptables -I INPUT -p tcp --dport 9200 -j DROP
5+ iptables -I INPUT -s 10.111.11.0/24 -p tcp --dport 9200 -j ACCEPT
6+
7+ iptables -I INPUT -p udp --dport 9200 -j DROP
8+ iptables -I INPUT -s 10.111.11.0/24 -p udp --dport 9200 -j ACCEPT
9+
10+ # allow the network 10.111.11.0/24 and not allow other network connect port 9300
11+ iptables -I INPUT -p tcp --dport 9300 -j DROP
12+ iptables -I INPUT -s 10.111.11.0/24 -p tcp --dport 9300 -j ACCEPT
13+
14+ iptables -I INPUT -p udp --dport 9300 -j DROP
15+ iptables -I INPUT -s 10.111.11.0/24 -p udp --dport 9300 -j ACCEPT
16+
17+ service iptables save && /etc/init.d/iptables restart && iptables -L -n
You can’t perform that action at this time.
0 commit comments