Linux/Docker/Networking: Difference between revisions

From Wiki
< Linux‎ | Docker
mNo edit summary
mNo edit summary
Line 8: Line 8:
docker network create wireguard
docker network create wireguard
docker network create --subnet 172.1.50.0/24 wireguard
docker network create --subnet 172.1.50.0/24 wireguard
docker network create --subnet 172.1.50.0/24 --ip-range=172.1.50.0/25 wireguard
docker network inspect wireguard
docker network inspect wireguard
</pre>
</pre>

Revision as of 20:52, 15 November 2023

  • List docker container with IPs
docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}} {{ .Name }}' | sed 's/ \// /'
  • Create docker network
docker network create wireguard
docker network create --subnet 172.1.50.0/24 wireguard
docker network create --subnet 172.1.50.0/24 --ip-range=172.1.50.0/25 wireguard
docker network inspect wireguard