Created
May 18, 2021 08:30
-
-
Save egeneralov/8d94d1363aafafa7cc7af1a330a70b87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -xe | |
apt-get install iptables{,-persistent} | |
iptables -N node-exporter | |
iptables -A node-exporter -s 1.1.1.1 -j ACCEPT | |
iptables -A node-exporter -s 1.0.0.1 -j ACCEPT | |
iptables -A node-exporter -s 8.8.8.8 -j ACCEPT | |
iptables -A node-exporter -s 127.0.0.0/8 -j ACCEPT | |
iptables -A node-exporter -j REJECT | |
iptables -A INPUT -p tcp --dport 9100 -j node-exporter | |
iptables-save > /etc/iptables/rules.v4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment