Skip to content

Instantly share code, notes, and snippets.

View brett-schneider's full-sized avatar

brett-schneider

View GitHub Profile
@brett-schneider
brett-schneider / network-namespace-demo.sh
Created November 23, 2022 19:02 — forked from agentzh/network-namespace-demo.sh
Create 2 network namespaces and bridge them and the default namespace together so that they can directly talk to each other via static IP addresses; also enable Internet access in all the namespaces via NAT.
#!/usr/bin/env bash
set -x
main_if=ens33
ping_count=1
echo 1 > /proc/sys/net/ipv4/ip_forward || exit 1
ip netns del ns1 > /dev/null 2>&1