-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathiptables.yml
38 lines (30 loc) · 972 Bytes
/
iptables.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
- hosts: all
tasks:
- name: alias an interface
sudo: yes
command: ifconfig eth0:0 192.168.1.6 up
- name: flush input table
sudo: yes
command: iptables -F INPUT
- name: flush output table
sudo: yes
command: iptables -F OUTPUT
- name: flush zero-zero-count table
sudo: yes
command: iptables -F zero-zero-count
- name: kill zero-zero-count table
sudo: yes
command: iptables -X zero-zero-count
- name: create user iptable for zero-zero-count
sudo: yes
command: iptables -N zero-zero-count
- name: add iptables null rule to count packets in
sudo: yes
command: iptables -A INPUT -d 192.168.1.6 -j zero-zero-count
- name: add iptables null rule to count packets out
sudo: yes
command: iptables -A OUTPUT -s 192.168.1.6 -j zero-zero-count
- name: add rule to table
sudo: yes
command: iptables -A zero-zero-count -j ACCEPT