Skip to content

Instantly share code, notes, and snippets.

@kandulaganesh
kandulaganesh / snat_dnat_advantech.md
Created March 19, 2023 10:13 — forked from tomasinouk/snat_dnat_advantech.md
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

How to test 'safely'

When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.

How to:

  • Enable reboot via SMS.
  • Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.

masquarade all outgoing packets to be WLAN0 IP

@kandulaganesh
kandulaganesh / iptables_rules.sh
Created March 8, 2023 16:20 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
https://github.com/docker/docker.github.io/issues/1520#issuecomment-305179362
import requests
from playsound import playsound
import sys
import time
import pytz
from datetime import datetime
subscribed_centers=["Bus Depo Buharanpuram Khammam","Rica Bazar High School KMM","Musthafanagar UPHC"]
search_dates=["31-05-2021","01-06-2021","02-06-2021"]

Tcpdump

Tcpdump is a commandline tool that is used to dump traffic on a network. This tool comes in hand when you want to analyse network captures within the command line. Basically it can do most of the wireshark job.

NOTE This guide might not be complete it just serve as a reference to me.

Additional Note & Reference

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal