Skip to content

Instantly share code, notes, and snippets.

@awsvpc
awsvpc / disable_ip6_wifi.sh
Created May 3, 2025 04:21 — forked from natbusa/disable_ip6_wifi.sh
how to disable ip6 connection on wifi
#!/bin/bash
for con in natbusa "natbusa 5G";
do
echo ipv6.method ignore connection: \"$con\"
nmcli con modify "$con" ipv6.method ignore
done;
# ============================================
# Cross-Platform Network Configuration Aliases
# ============================================
# ============================================
# Helper Funcs
# ============================================
# --- Function to get OS type (same as before) ---
_net_get_os() {
@awsvpc
awsvpc / pre-connect.sh
Created May 3, 2025 04:19 — forked from cidrmill/pre-connect.sh
NetworkManager dispatcher script written in Bash to enforce user anonymity just before connecting to a network.
#!/bin/bash
function get_ip {
echo $(ip -br a show $1)
}
function check_ip {
device=$1
ip_addr=$(get_ip "$device" | awk '{print $4}')
if [ -z "$ip_addr" ]
@awsvpc
awsvpc / README.md
Created May 3, 2025 04:19 — forked from pojntfx/README.md
Disable IPv6 privacy extensions, disable MAC address randomization and enable 1.1.1.1 DNS with NetworkManager

Make sure to setup NetworkManager as described in https://wiki.debian.org/NetworkManager first. In particular, be sure to remove the devices you want to manage with NetworkManager from /etc/network/interfaces.

/etc/NetworkManager/NetworkManager.conf should look like the following:

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=true
@awsvpc
awsvpc / network-callout.sh
Created May 3, 2025 04:18 — forked from nstarke/network-callout.sh
Network Callout
#!/bin/bash
# sudo apt install iw curl jq
ALIVE="$1"
check_public_ip() {
INTERFACE="$1"
PUBLIC_IP=$(curl -s https://httpbin.org/ip | jq -r .origin)
if ! [[ -z $PUBLIC_IP ]]; then
echo "[+] Found Public IP $PUBLIC_IP for $INTERFACE"
fi
@awsvpc
awsvpc / global-set-cloudflare-dns.sh
Created May 3, 2025 04:17 — forked from grenade/global-set-cloudflare-dns.sh
set all wifi connections to use cloudflare dns
(
IFS=$'\n'
for line in $(nmcli --fields UUID,TYPE,NAME connection show); do
conn_uuid=$(echo ${line} | cut -d ' ' -f 1)
conn_type=$(echo ${line} | cut -d ' ' -f 3)
conn_name=$(echo ${line} | cut -d ' ' -f 4- | xargs)
if [ "${conn_type}" = "wifi" ]; then
echo "name: $(tput bold)${conn_name}"
echo "$(tput dim)uuid: ${conn_uuid}, type: ${conn_type}"
nmcli connection modify ${conn_uuid} ipv4.dns "1.1.1.1,1.0.0.1"
@awsvpc
awsvpc / net.sh
Created May 3, 2025 04:17 — forked from goffinet/net.sh
Centos7 router config firewalld/networkmanager
#!/bin/bash
connection="System eth0"
ip4="192.168.168"
ip6="fd00:168:168"
1_interfaces () {
hostnamectl set-hostname router
nmcli c mod "$connection" ipv4.addresses $ip4.1/24
nmcli c mod "$connection" ipv4.method manual
nmcli c mod "$connection" ipv6.addresses $ip6::1/64
nmcli c mod "$connection" ipv6.method manual
@awsvpc
awsvpc / bounce_ipv6.sh
Created May 3, 2025 04:16 — forked from satmandu/bounce_ipv6.sh
Bounce IPv6 connection if router is up but IPv6 connectivity is down, and check the connection every 30 seconds.
#!/bin/bash
# Put this script into your crontab e.g.
# @reboot ~/bin/bounce_ipv6.sh
# Bounce IPv6 connection if router is up but IPv6 connectivity is down,
# and check the connection every 30 seconds.
router_address="192.168.0.1"
ipvsixaddress="2600::"
while true;
do
if ping -c1 $router_address &>/dev/null; then
@awsvpc
awsvpc / readme.md
Created May 3, 2025 04:15 — forked from balupton/readme.md
Debugging Ubuntu VPN/Bridge Networking

Networking on my Ubuntu machines is being flaking:

  • docker bridge interface failing
  • traffic not going to vpns
  • when vpn or docker bridge does work it knocks out all dns resolutions

Here are all the things I have tried or yet to try.

docker failures

@awsvpc
awsvpc / ip_alias123.sh
Created May 3, 2025 04:04 — forked from alpominth/ip_alias123.sh
ip_alias123.sh - Create an IP alias (like 10.1.1.1) for any network interface and any of its local IP addresses
#!/bin/bash
FW_MARK="$((RANDOM%2147483646 + 1))"
if [ "$(ip -4 rule show fwmark ${FW_MARK})" ] || [ "$(ip -6 rule show fwmark ${FW_MARK})" ]; then
while [ "$(ip -4 rule show fwmark ${FW_MARK})" ] || [ "$(ip -6 rule show fwmark ${FW_MARK})" ]; do
FW_MARK="$((RANDOM%2147483646 + 1))"
done
fi
TABLE="$((RANDOM%2147483396 + 1))"
if [ ! "$(ip -4 route show table ${TABLE} 2>/dev/null || echo 1)" = "1" ] || [ ! "$(ip -6 route show table ${TABLE} 2>/dev/null || echo 1)" = "1" ]; then