Skip to content

Instantly share code, notes, and snippets.

@BenWhitehead
Created September 30, 2014 21:16
Show Gist options
  • Save BenWhitehead/87eed5ae9958a1beded8 to your computer and use it in GitHub Desktop.
Save BenWhitehead/87eed5ae9958a1beded8 to your computer and use it in GitHub Desktop.
Ansible iptables commands for http(s) routing
---
- name: iptables open 443
command: iptables -A INPUT -i eth0 -p tcp --dport 443 -j ACCEPT
- name: iptables 443 -> 8443
command: iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 8443
- name: iptables open 80
command: iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
- name: iptables 80 -> 8080
command: iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment