Skip to content

Instantly share code, notes, and snippets.

@odevodyssey
odevodyssey / firewall
Created September 26, 2022 01:41
Site to Site VPN Config - Site A
# /etc/config/firewall
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option synflood_protect '1'
option forward 'REJECT'
config zone
@odevodyssey
odevodyssey / conmon.sh
Created February 27, 2024 12:55
Scripts to monitor cellular connection for 4G LTE RPi on OpenWrt
#!/bin/sh
# Internet Monitoring Script for QMI Modem
# Modem: Quectel EG25-G
# Script inspired from conmon.sh in ROOter project.
# https://www.ofmodemsandmen.com/
# What is most likely to happen in my experience is modem gets a new IP from ISP, randomly, and interface does not update, therefore outbound traffic stops
# This script will cover both scenarios
@odevodyssey
odevodyssey / dhcp
Last active May 31, 2023 04:03
RPi4 DSA VLANs Switch Config - OpenWrt 21.02
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
@odevodyssey
odevodyssey / firewall
Created September 26, 2022 01:29
Site to Site VPN Config - Site B
# /etc/config/firewall
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
config zone
option name 'lan'
@odevodyssey
odevodyssey / .config
Created April 11, 2022 15:55
4G LTE Cellular OpenWrt Build Image Config for Raspberry Pi 4B
#
# Automatically generated file; DO NOT EDIT.
# OpenWrt Configuration
#
CONFIG_MODULES=y
CONFIG_HAVE_DOT_CONFIG=y
# CONFIG_TARGET_sunxi is not set
# CONFIG_TARGET_apm821xx is not set
# CONFIG_TARGET_ath25 is not set
# CONFIG_TARGET_ath79 is not set
@odevodyssey
odevodyssey / dhcp
Last active December 29, 2022 14:56
RPi4 DSA VLANs Router Config - OpenWrt 21.02
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
@odevodyssey
odevodyssey / dhcp
Created February 9, 2022 14:46
RPi4 Non DSA VLANs Switch Config - OpenWrt 21.02
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
@odevodyssey
odevodyssey / config.txt
Created December 19, 2022 01:05
OpenWrt Custom Hotspot
################################################################################
# Bootloader configuration - config.txt
################################################################################
################################################################################
# For overclocking and various other settings, see:
# https://www.raspberrypi.org/documentation/configuration/config-txt/README.md
################################################################################
# OpenWrt config
// usage: node pdf-parser-express
// the below packages are required to run this server, and can be installed with npm
const express = require('express')
const bodyParser = require('body-parser')
const pdf = require('pdf-parse')
const crawler = require('crawler-request')
const multer = require('multer')
//var upload = multer({ dest: 'uploads/' })
@odevodyssey
odevodyssey / privoxy
Created November 2, 2022 12:48
Privoxy Sample Configuration - Forwarding (HTTP and SOCKS) on OpenWrt
# /etc/config/privoxy
# replace username and password with proxy provided credentials
config privoxy 'privoxy'
option confdir '/etc/privoxy'
option logdir '/var/log'
option logfile 'privoxy.log'
list filterfile 'default.filter'
list actionsfile 'match-all.action'