Skip to content

Instantly share code, notes, and snippets.

View jeffcav's full-sized avatar

Jefferson Cavalcante jeffcav

  • CESAR
  • Brazil
View GitHub Profile
@jeffcav
jeffcav / docker-nat.sh
Created May 15, 2021 20:22
NAT docker containers
# Enable ip forwarding in the host
sudo bash -c 'echo 1 > /proc/sys/net/ipv4/ip_forward'
# Create WAN 10.0.0.0/24 and LAN 192.168.66.0/24 networks
docker network create --driver bridge --subnet 10.0.0.0/24 --attachable wan
docker network create --driver bridge --subnet 192.168.66.0/24 --attachable --gateway 192.168.66.254 lan
# Create hosts and router
## Create the 'wan-host' and connect to the WAN network
docker run -itd --rm --ip 10.0.0.10 --network wan --name wan-host ubuntu
@jeffcav
jeffcav / Kubernetes-Cluster
Last active March 5, 2021 15:26
K8S cluster
Code below is used to deploy a full-fledged kubernetes cluster with N nodes.
Tested in March of 2021.