1) Filter Table
Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.
# Custom Execution Module - SUDO ACCESS | |
# tested for Centos 7 | |
import salt | |
import time | |
import os | |
import logging | |
import re | |
from datetime import datetime, timedelta | |
import subprocess |
#!/usr/bin/env python3 | |
# GistID: 0fcc596bf72973eef955aa2361cc0e73 | |
import sys | |
import os | |
import tempfile | |
from subprocess import call | |
import unidiff | |
if len(sys.argv) != 2: |
1) Filter Table
Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.
## Original Rules | |
# Generated by iptables-save v1.4.21 on Wed Oct 11 21:54:52 2017 | |
*nat | |
:PREROUTING ACCEPT [5687:339260] | |
:INPUT ACCEPT [5673:337852] | |
:OUTPUT ACCEPT [74556:5261167] | |
:POSTROUTING ACCEPT [74560:5261407] | |
-A PREROUTING -p tcp -m tcp --dport 5222 -m state --state NEW -m statistic --mode nth --every 7 --packet 0 -m comment --comment tetra-proxy-0-chat-port -j DNAT --to-destination :5232 | |
-A PREROUTING -p tcp -m tcp --dport 5223 -m state --state NEW -m statistic --mode nth --every 7 --packet 0 -m comment --comment tetra-proxy-0-chat-port-ssl -j DNAT --to-destination :5233 |
#!/usr/bin/env python | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
# Required packages (available from pip) : pyqrcode, pypng | |
import pyqrcode | |
import base64 |