Skip to content

Instantly share code, notes, and snippets.

@rdymc
Created April 3, 2019 07:33
Show Gist options
  • Select an option

  • Save rdymc/626c092a2ee059837dd23700e01d0757 to your computer and use it in GitHub Desktop.

Select an option

Save rdymc/626c092a2ee059837dd23700e01d0757 to your computer and use it in GitHub Desktop.
#!/bin/bash
firewall-cmd --remove-service=ssh --permanent
#firewall-cmd --add-service=http --add-source=1.1.1.1/32 --permanent
#firewall-cmd --add-service=ssh --add-source=1.1.1.1/32 --permanent
firewall-cmd --add-rich-rule="rule family="ipv4" source address="1.1.1.1" service name="ssh" accept" --permanent
firewall-cmd --add-rich-rule="rule family="ipv4" source address="1.1.1.1" service name="http" accept" --permanent
firewall-cmd --reload
firewall-cmd --list-all
iptables -S
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment